/* /////////////////////// Installation //////////////////////////////// 1) Change the configuration settings below to match your requirements 2) Upload this file into your forum directory 3) The RSS Feedlink can be located anywhere on your site ///////////////////// Installation End ////////////////////////////// */ ///////////////// Configuration settings //////////////////////////// // Required Parameters $title="Test"; //The title of your newsfeed $description="This is a test rss feed link"; //The description of your newsfeed $linkurl="http://www.ozyforums.com.au/test/"; // Link url to your site or forum $webmaster="ozyforums@ozymail.com.au"; //e-mail address of site webmaster $maxnews=10; //The maximum number of news items to display $copyright="test"; // RSS Feed Copyright notice // Optional Parameters $imageurl=""; // URL of News Logo/Forum Logo etc $editor=""; //e-mail address of news editor $feedstatus=1; //Feedstatus 1 for on 0 for off $postorder="ASC"; //ASC show first post in thread DESC show last post in thread $showtopics=0; // Show topics only in feed 1= on 0=off $category=1; //use forum name as newsitem category 1= on 0 = off // Custom Error message Configuration $msgtitle="Forum Feed Is currently Offline";//The title if Newsfeed is offline $msgdesc="The website administrator has temporarily turned off this RSS feed. Please check again later";//Message to display if feed is offline $msgsql="The newsfeeed is currently offline. Please try again later"; //message to display if msyql connection fails ///////////////// Configuration End ///////////////////////////////// echo "\n"; echo "\n"; echo " \n"; echo " $title\n"; echo " $linkurl\n"; echo " $description\n"; echo " en-us\n"; echo " $copyright\n"; echo " TEST Forum RSS Feeder - http://www.ozyforums.com.au/test\n"; echo " $webmaster\n"; // Additional options display if ($editor==""){ }else{ echo " $editor\n"; } if ($imageurl==""){ }else{ echo " \n"; echo " $title\n"; echo" $imageurl\n"; echo" $linkurl\n"; echo" $description\n"; echo" \n"; } switch($feedstatus){ case 1: // Connect to forum and retreive Last 10 Posts @$db = mysql_connect ($dbhost, $dbuser, $dbpw)or die ("\n$msgtitle\n$msgsql\n$edate\n\n\n"); @$result = mysql_select_db ($dbname, $db) or die ("\n$msgtitle\n$msgsql\n$edate\n\n\n"); //Latest 10 posts Not showing Private forums $x=0; $query1 = mysql_query("SELECT lastpost, fid, tid, WHERE fid IN[1,3] threads ORDER BY lastpost DESC"); while($last = mysql_fetch_array($query1)) { //output each forum topic echo " \n"; if ($category==1){ echo" $newscat\n"; } echo " <![CDATA[$newstitle]]>\n"; // } echo " $full_url"; echo"viewthread.php?tid=$last[tid]\n"; echo " $pdate\n"; if($showtopic==0){ echo " By: $author\n\n"; } echo " \n"; $x++; } if ($x == $maxnews){ break; }} mysql_close(); break; case 0: // Offline output statement echo"\n"; echo" $msgtitle\n"; echo" $edate\n"; echo " $msgdesc\n"; echo"\n"; break; } //Finally, close off your XML/RSS tags: echo " \n"; echo " "; /* ////////////////////// Changelog ////////////////////////////////////// 1) included config.php to provide database connection settings 2) added newslogo image support 3) added script configuration settings including no of items to display and ability to turn feed on and off 4) added installation instructions and improved script comments 5)Check and remove all private forums from display 6) Added Copyright info for news 7) Using CDATA and htmlentities to Clean invalid characters from posts (ie £ & etc) 8) Added show first post or last post in thread option 9) Better sql error message now in rss format 10) Added option to Customize error messages 11) Put timestamp as in error feeds 12) Tidied up code and removed un-necessay items from script used during testing 13) Added option to show forum name in Newstitle 14) Using htmlentities to Clean invalid characters from newstitles (ie £ & etc) 15) Removed the forum name in Title infavour of the Item Category option 16) Added the display of the post author in the posd 17) Corrected Link display in each item 18) 24-05-05 Fix added to Topic Titles to correct illegal RSS characters 19) 25-05-04 Added option to Show topic titles only in feed ToDo List 1) allow feedstatus and configuration to be altered from forum Admin 2) add option to use specific forum for newsfeeds? 3) Join queries like today.php */ ?> Largest list of competitions online! View user's profile Visit user's homepage View All Posts By User U2U Member