<?php



/*

 WAHBWrssReader.php - RSS feed reader webpage script



 Copyright 2006 Work-At-Home-Business-Website.com

 http://www.Work-At-Home-Business-Website.com



 This script may be used and modified freely for business or personal use

 This script may not be resold in any form

 This script may only be redistributed in its original form



 $Id: WAHBWrssReader.php,v 1.00 2006/09/03 11:57:22



 Our WAHBW feeds are instantly updated after each new article is submitted. You

 will always display the newest and freshest articles available to your visitors.

 Our feeds have been tested and comply with RSS Version 2.0. To check the validity

 of any of our category feeds from below, copy and paste this URL in your browser.

 http://feedvalidator.org/check.cgi?url=http://work-at-home-business-website.com/xml/Business.xml



 Save this file as WAHBWrssReader.php in your main site directory.



 To load our daily updated XML code, just call this script from your site like this:

 http://www.YourSite.com/WAHBWrssReader.php?articles=Advertising

 or whatever category you wish to display to your visitors.



 We also have a dynamic URL you can set up if you would like to disply all our

 category articles to your visitors. You determine how many pages you wish to show

 at one time by setting the "limit variable like this, "limit=20".



 Then just call each page to display using the "offset" variable.



 For instance:



 Page 1 of Advertising with 10 listing per page, the URL would be:

  http://www.YourSite.com/WAHBWrssReader.php?articles=Advertising&offset=0&limit=10



 Page 2 of Advertising with 10 listing per page, the URL would be:

  http://www.YourSite.com/WAHBWrssReader.php?articles=Advertising&offset=11&limit=10



 Page 3 of Advertising with 10 listing per page, the URL would be:

  http://www.YourSite.com/WAHBWrssReader.php?articles=Advertising&offset=21&limit=10



 Etc., Etc.



 These are the Available Categorys you can enter in the URLs above:



$Categories = "Accounting|Advertising|Affiliate-Programs|Blogs|Books|Business-Matters|Business-News|Business-Opportunities|Business|Careers|Communications|Computer-Software|Computers-Internet|Copywriting|Crafts|Credit|Customer-Service|Directories|Domains|Ebay|Ebooks|Ecommerce|Email-Marketing|Email|Employment|Ezine-Publishing|Ezine-Sites|Ezines|Female-Entrepreneurs|Finance|Financial|Forums|Free-Web-Resources|Government|Health-Healthcare|Hobbies|Home-Business|Home-Family|Import-Export|Insurance|Internet-Marketing|Internet-Promoting|Internet|Jobs-from-Home|Law-Legal|Legal-Issues|Link-Popularity|Loans|Marketing|MLM|Money|Mortgages|Motivation|Non-Profit-Organizations|Online-Business|Organizing|Pay-Per-Click|Personal-Development|Press-Releases|Promotion|Psychology|Public-Speaking|Publishing|Real-Estate|Reference-Education|Relationships|Research|Sales-Marketing|Search-Engines|Self-Help|Self-Improvement|SEO|Site-Promotion|Small-Business|Software|Taxes|Telecommuting|Travel-Leisure|Web-Hosting|Web-Traffic|Webmasters|Website-Design|World-Wide-Web|Writing-and-Speaking";



 If you would rather use your own XML parser, make sure you call the URL like this

 http://work-at-home-business-website.com/xml/Advertising.xml

 or whatever category you like from the above list.



 You can also paste the code below directly into your own PHP file.

*/



// If using your own site header, enter it's location here and remove comment slashes //.

// require_once("templatehead.php");

?>

<div align="center">

    <table border="0" width="100%" id="table1" cellpadding="5">

        <tr>

            <td valign="top">

<?





// This is the URL link to our RSS/XML directory to call 20 articles.

// Remove Comments "//" to use

$url "http://work-at-home-business-website.com/xml/$_GET[articles].xml";



// This is the URL link to our RSS/XML directory to call any amount of articles.

// Remove Comments "//" to use

// $url = "http://work-at-home-business-website.com/xml/LoadCat.xml?cat=$_GET[articles]&offset=$_GET[offset]&limit=$_GET[limit]";



$rssstring file_get_contents($url);

preg_match_all("#<title>(.*?)</title>#s",$rssstring,$titel);



preg_match_all("#<description>(.*?)</description>#s",$rssstring,$description);



preg_match_all("#<item>(.*?)</item>#s",$rssstring,$items);

$n=count($items[0]);



for(
$i=0;$i<$n;$i++)

    {

    
$rsstemp$items[0][$i];



    
preg_match_all("#<title>(.*?)</title>#s",$rsstemp,$titles);

    
$title[$i]= $titles[1][0];



    
preg_match_all('#<submitBy xmlns="http://work-at-home-business-website.com/Articles.php">(.*?)</submitBy>#s',$rsstemp,$authors);

    
$author[$i]= $authors[1][0];



    
preg_match_all("#<description>(.*?)</description>#s",$rsstemp,$descriptions);

    
$description[$i]= $descriptions[1][0];



    
preg_match_all("#<link>(.*?)</link>#s",$rsstemp,$links);

    
$link[$i]= $links[1][0];

    }



// This area can be edited to match the look and feel of your site.



echo "<h2>".$titel[1][0]."</h2>";

    for(
$i=0;$i<$n;$i++)

    {

        if(!empty(
$title[$i]))

        echo 
"<font size=\"2\" face=\"Verdana\"><b>Title: </b><b><a href=\"$link[$i]\" target=\"_blank\">".$title[$i]."</a></b></font><br>";

        echo 
"<font size=\"2\" face=\"Verdana\"><b>Submitted By: </b>$author[$i]\t\t\t <br><br>";

        echo 
"$description[$i]... <b><a href=\"$link[$i]\" target=\"_blank\">see more</a></b><br><br>";

    }



// If using your own site footer, enter it's location here and remove comment slashes //.

// 
?>

//        </td><td>

// <?

// require_once("templaterightnav.php");



// 
?>

// </td>

<?

// require_once("templatefoot.php");

?>