An example is shown at http://www.xtreme-forumz.net. Go to the Techno forum under the General category. Then the CNET News sub-forum.
RSS News Feed Hack for vB 3.0.0. As long as vBulletin doesn't change the database structure much, this should be good for the next release also, and those to come.
Allows you to have a live RSS news feed (such as one from Google or CNET) in a forum. The user that posts it will basically be a bot, which *should* only be used for posting the news, but you can even make it for a regular user.
Comments are welcome!
Instructons:
Note: DON'T FORGET TO MAKE A BACKUP OF EACH FILE BEFORE YOU MODIFY IT!
Copy the files to your web server... keep the same directory structure as in the zip file.
Run the rss_install.php file to setup the RSS script.
If you're upgrading run the rss_upgrade.php file to setup the RSS script. Don't forget to remove all previous modifications (you can find them by searching for "LiquidPro")
An example is shown at http://www.xtreme-forumz.net. Go to the Techno forum under the General category. Then the CNET News sub-forum.
RSS News Feed Hack for vB 3.0.0 - RC2. As long as vBulletin doesn't change the database structure much, this should be good for the next release also, and those to come.
Allows you to have a live RSS news feed (such as one from Google or CNET) in a forum. The user that posts it will basically be a bot, which *should* only be used for posting the news, but you can even make it for a regular user.
Comments are welcome!
Instructons:
Note: DON'T FORGET TO MAKE A BACKUP OF EACH FILE BEFORE YOU MODIFY IT!
The first thing that you have to do is upload the modifyTable.php file into the root directory (the directory that includes the forumdisplay.php) file. The next thing that you need to do is run the rss_modifyTable.php file, which will modify your SQL tables in order to make it complient with the RSS News Bot. Once you have successfully modified your tables, you should now open up the forumdisplay.php file in a regular text editor (such as Notepad).
Find the following in the forumdisplay.php file
Note: On an unmodified forumdisplay.php file this will be at line 416
PHP Code:
// get announcements $announcebits = ''; $announcements = $DB_site->query(" SELECT announcementid, startdate, title, announcement.views, user.username, user.userid, user.usertitle, user.customtitle FROM " . TABLE_PREFIX . "announcement AS announcement LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = announcement.userid) WHERE startdate <= " . TIMENOW . " AND enddate >= " . TIMENOW . " AND " . fetch_forum_clause_sql($foruminfo['forumid'], 'forumid') . " ORDER BY startdate DESC " . iif($vboptions['oneannounce'], "LIMIT 1")); while ($announcement = $DB_site->fetch_array($announcements)) { if ($announcement['customtitle'] == 2) { $announcement['usertitle'] = htmlspecialchars_uni($announcement['usertitle']); } $announcement['postdate'] = vbdate($vboptions['dateformat'], $announcement['startdate']); if ($announcement['startdate'] > $lastread) { $announcement['statusicon'] = 'new'; } else { $announcement['statusicon'] = 'old'; } $announcement['views'] = vb_number_format($announcement['views']); $announcementidlink = iif(!$vboptions['oneannounce'] , "&announcementid=$announcement[announcementid]"); eval('$announcebits .= "' . fetch_template('forumdisplay_announcement') . '";'); }
Once you have found that, put this immediately following it.
PHP Code:
// RSS News Feed Hack // ------------------------------ // By: Andrew Wickham of // LiquidPro Inc. //
// get the rss settings include("includes/rss_config.php");
// get the bot`s username $rss_user_query = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = '$rss_userid'"); $rss_user_data = $DB_site->fetch_array($rss_user_query); $rss_username = $rss_user_data['username']; $rss_posts = $rss_user_data['posts'];
// include the RSS class include($rss_pathToClass . "/class.RSS.php"); $rss = new RSS($rss_data, 1); $rss_allItems = $rss->getAllItems(); // check and see what items are in the database, and mark the old ones as old $rss_query = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "thread WHERE rss_feed = '1'");
// insert the new items into the database for($j = 0; $j < count($rss_allItems); $j++) { if(!$rss_allItems[$j]['OLD']) { // update the user profile $rss_posts++;
// get the next available threadid $rss_threadid_query = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "thread ORDER BY threadid DESC"); $rss_threadid_data = $DB_site->fetch_array($rss_threadid_query); $rss_threadid = $rss_threadid_data['threadid'] + 1;
// get the next available postid $rss_postid_query = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "post ORDER By postid DESC"); $rss_postid_data = $DB_site->fetch_array($rss_postid_query); $rss_postid = $rss_postid_data['postid'] + 1;
// // ------------------------------ // End of RSS News Hack
Save your forumdisplay.php file
Open the rss_config.php file included with this zip, and edit the settings to your likings. Make sure you create the specified user or you'll have some major problems.
Copy the rss_config.php file to the "includes" directory on your server.
That's it for the hacking! For the thread you put this hack on, I suggest that you have it so that users other than the bot can't post new threads, only post replies. That way they can post comments on the news feed.
Database error in vBulletin 3.0.0 Release Candidate 3:
Invalid SQL: INSERT INTO post (`threadid`, `username`, `userid`, `title`, `dateline`, `pagetext`, `allowsmilie`, `showsignature`, `visible`) VALUES ('155', 'Scuba NewsHound', '16', 'Raich wins men's slalom in Alpine skiing World Cup', '1075360929', 'English.eastday.com - Wed Jan 28, 04:02 am GMT<br><br>[url=http://english.eastday.com/epublish/gb/paper1/1161/class000100002/hwz179171.htm]View the Entire Article[/url]
', '1', '1', '1')
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 's slalom in Alpine skiing World Cup', '1075360929', 'English.ea
mysql error number: 1064
Date: Thursday 29th of January 2004 01:22:09 AM
Script: [url]http://www.wildaboutscuba.com/forums/forumdisplay.php?f=102[/url]
Sounds really kool Xyphenscreenshot would be nice though please, seems a bit silly to me - signing up to a forum, just to view a modification. hehe! we spent all day signing up to boards and waisting everybodies time LOL
raxafarian thank you for the error update. This is probably because it's RC3. I notice that it's a single quote that's causing the problem. I'll download RC3 and look into it further. Thank you.
Everyone else: I attached a screen shot of it. Enjoy!