GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   webcams.com - Mastering the RSS Feed Parser like a pro - [tutorial part 2] (https://gfy.com/showthread.php?t=938008)

daniel_webcams 11-11-2009 07:30 AM

webcams.com - Mastering the RSS Feed Parser like a pro - [tutorial part 2]
 

We will continue with the second part of the tutorial:
  • Implementation of the template page used for pagination
  • Implementation of the template page used for profile display

For those that didn't read the first part of the tutorial, it can be found here: webcams.com - Mastering the RSS Feed Parser like a pro.

So we've prepared the templates in the end of the first part of this tutorial and now we will insert the RSS PHP parsed variables from the FEED inside them.

Go to the affiliate area -> Promo Tools -> RSS Feeds -> RSS Parser: PHP based -> and search after PHP Tags and Available Variables.

We will find here some technical info regarding the parser's functionality and some necessary info such as the name of all the variables that display the info in your templates.

So let's start with the "Implementation of the template page used for pagination".
Step 1
Let's open the online_models_paging.php. On the first line we can see that the WEBCAMS.COM parser is called ...

http://www.webcams.com/affiliate/new...the_parser.jpg
Let's make sure that it will be permanently available for this pages.

To do this we will create a new directory inside online&pagination, next to online_models_paging.php and profile. Let's say that you will name it "feeds".
Step 2
So we have the directory. Now let's move the WebcamsRSSParser.php from
the main archive directory to "feeds?" directory. Once we've done that we will change the path in the online_models_paging.php, from "../WebcamsRSSParser.php".
http://www.webcams.com/affiliate/new...arser_path.jpg
to "feeds/WebcamsRSSParser.php"
http://www.webcams.com/affiliate/new...r_path_new.jpg
Step 3
Copy the template files in the same directory with online_models_paging.php named online&pagination.

Let's rename the main template file, the one where we want the pagination to be displayed. We will name it "index" and the extension will be php. After this operation we will open it in a text editor and start the implementation.
Step 4
We have both files, index.php and online_models_paging.php, opened in the editor. We will copy the first part of php code from online_models_paging.php starting from

Code:

<?php require_once('feeds/WebcamsRSSParser.php');
and ending with

Code:

return $ret; } ?>
Copy and paste above the header of the template.

As you have noticed the online_models_paging.php has an internal style with classes in the header. There is no need to keep that one if we have our own style in the new template, so we jump over the header and we stop on the first php tag, which is

Code:

<?php if($noOfPages>1){?>
This is the pagination. I assume that we have a certain location especially dedicated in the new layout. If we don't, let's create one and modify the template a little bit. The pagination div/table will be in a visible place. Most of the times it is positioned above the model thumbs. Once we have done that we will start to copy from
Code:

<?php if($noOfPages>1){?>
until the last curly bracket
Code:

<?php }?>
http://www.webcams.com/affiliate/new...pagination.jpg
Step 5
Now you have to insert the foreach that will repeat the process of displaying movies for each model apart. What we have to do is to identify and prepare the spot in the new layout where we want to place the thumbs of the models. Let's move to the next php start tag code

Code:

<? foreach($models as $model) {
and copy until

Code:

<?php } ?>
http://www.webcams.com/affiliate/new...rt_foreach.jpg
Step 6
Start Xampp, open the browser and type : http://127.0.0.1/online&pagination/index.php.
You should see some changes in there, something dynamically is being loaded.
You will see the pagination and the model thumbs. I assume that we have a certain number of model thumbs per line and a certain style per thumb. Well let's go back in the index page and identify the last place where we've made changes and search after foreach. Once found, we will solve the problem regarding displayed thumb limitation per line. We will basically change the old foreach with the new one.

Code:

<? foreach($models as $model) {
with this other one

Code:

<? foreach($models as $key=>$model) { if($key % 5 == 0) echo
"</tr><tr>" {

http://www.webcams.com/affiliate/new..._the_model.jpg
So, what have we changed and what's the difference. Let's analyze it in detail:

Code:

if($key % 5 == 0) echo "</tr><tr>"
5 represents the number of thumbs per line

Code:

</tr><tr>
Represents the table row, it can be easily changed with
Code:

<div></div>
But to use this two methods we will need to add another two parameters.

In the case of the table the one with:
Code:

<tr></tr>
we will add above this tag
Code:

<? foreach($models as ;
Code:

<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr>

and below

Code:

(<?php } ?>)
we will add

Code:

</tr> </table>
In the case of div it will be:

Code:

<div class="main"><div class="model">
and below

Code:

(<?php } ?>)
we will add

Code:

</div><div>
Don't forget to add the class on the table or div that will help you make the styling.

Implementation of the template page used for profile page

How does it work: the $_REQUEST['model_id'] gets the numeric ID and uses the parser to get the model details by calling the feed of the requested model. So we've prepared the templates last week and now we will insert the RSS PHP parsed variables from the FEED inside them.

Go to the "affiliate area -> Promo Tools -> RSS Feeds -> RSS Parser: PHP
based -> and search for PHP Tags and Available "Variables".

Here we will find some technical info regarding the parser's functionality and some other necessary info, such as the name of all the variables that display the info in your templates.

So let's start with the "Implementation of the template page used for profile page".

Open the profile.php file, and change the path of the parser from "../WebcamsRSSParser.php" to "feeds/WebcamsRSSParser.php"

Copy the first part into the template file of the profile page. We will insert it exactly in the same spot as it was copied from, at the top that is.

http://www.webcams.com/affiliate/new..._10_07/1_1.gif
As you may see, there are a lot of variables on this page. All of them are adjustable and begin with
Code:

$model-> (this is were the called parameter is situated). For example: $model->sex_pref;
$model->measurements; $model->eye_color; $model->about_me;

You can find a complete list with all the available variables here: Affiliate area -> Promo Tools -> RSS Feeds -> RSS Parser: PHP based ->and search after PHP Tags and Available Variables

Complete the rest of the template with the variables you want and your done with the profile display.
Below you can see that there is a foreach that indicates other suggestions (online models). This can also be adapted.

http://www.webcams.com/affiliate/new..._10_07/1_2.gif

We will use the same method as we did for pagination, or we can simply create a style for the existing structure and adapt it. And it seems we are done with this part of tutorial also.


Hope to be helpful!

CamsMaster 11-11-2009 01:12 PM

good here it is the second part... thanks...

grumpy 11-11-2009 01:17 PM

te make your site load faster and not wait for the rss feed, do all the above and save it to a local file and insert the file in your html. Every day call the above and refresh your feed

daniel_webcams 11-12-2009 03:16 AM

guys you can email me or hit me up on ICQ at any time, if you have questions about this or any other tool that webcams.com has...

darksoul 11-12-2009 03:21 AM

you need to learn to post gfy stile
nobody is interested in that geeky shit.

no pic ?
you fail


All times are GMT -7. The time now is 08:44 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc