Duplicate Post checker for Inferno RSS Forum Feeds Technology
------------------------------------------------------------------------------------------
I noticed a lot of users where complaining about the doublepost being made by the RSS feed reader. As there are still alot of users who have installed this hack, underwhich myself, I have made a slight modification for this hack which checks the new posts for titles in the database.
It's a fairly easy modification and it might not be the perfect solution to this problem, but at least it keeps the double posts away.
What does it do?
This mod checks for posts with the same title in the forum where the feed is directed to (so a a feed which is posted in the forum with ID 3 will only check for duplicate titles in the forum with ID 3).
What to do?
Open the /includes/class_ffrss.php file and find the function: post_thread() and replace it with this new post_thread function:
Code:
function post_thread($title, $message, $feed)
{
global $vbulletin;
$getThread = $vbulletin->db->query("SELECT threadid FROM " . TABLE_PREFIX ."thread WHERE title = '" . mysql_real_escape_string($title) . "' AND forumid = '" . mysql_real_escape_string($feed['feed_forum']) . "'");
$ThreadNums = $vbulletin->db->num_rows($getThread);
if($ThreadNums < 1) {
$this->ItemsAdded++;
$newpost['title'] = $title;
$newpost['message'] = $message;
$smilie = true;
$foruminfo = fetch_foruminfo($feed['feed_forum']);
$ThreadDM =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$ThreadDM->set_info('forum', $foruminfo);
$ThreadDM->set_info('thread', $newpost);
$ThreadDM->setr('allowsmilie', $smilie);
$ThreadDM->setr('userid', $feed['feed_user']);
$ThreadDM->setr('title', $newpost['title']);
$ThreadDM->setr('pagetext', $newpost['message']);
$ThreadDM->setr('forumid', $feed['feed_forum']);
$ThreadDM->setr('dateline', $this->get_dateline());
$ThreadDM->set('visible', 1);
$ThreadDM->registry->options['floodchecktime'] = 0; // Disable flood check in memory...
$ThreadDM->pre_save();
if (sizeof($ThreadDM->errors) > 0)
{
$ThreadDM->errors = array();
}
$ThreadDM->save();
}
}
Hopefully it works for everyone
#######################################################
Inferno RSS View Feeds
Installation
Installation in two easy steps:
1. Upload all the files from the "files" directory
in this zip into your forums directory.
2. Import product-1900.xml as a product.
(Via "Plugin System" > "Manage Products" >
"Add/Import Product" in your Admin CP.)
NOT : this Products upload for request
[v1.6] Inferno RSS Forum Feeds Technology
uploaded.
Upload
news.php == forum/news.php
xmlparser.php == forum/includes/xmlparser.php
Template Change
Template: navbar
now open your navbar template:
Admincp >> Styles & Templates >> Style Manager >> *template* >> navbar
Find this code
HTML:
<td class="vbmenu_control"><a href="calendar.php$session[sessionurl_q]">$vbphrase[calendar]</a></td>
Place under it
HTML:
<td class="vbmenu_control"><a href="news.php">Rss News</a></td>
##############################################################
[v1.6] Inferno RSS Forum Feeds Technology
Example BBC UK News Feed:
Feed Name: BBC UK News
Feed Location:
http://newsrss.bbc.co.uk/rss/newsonl...t_page/rss.xml
Feed Prefix: [BBC UK News]
Feed From User:
Assign users username of your own choice
Feed Forum:
Choose a forum you want threads to be posted into
Feed Read Direction: Newest First
Parent RSS Tag Name: channel
Items RSS Tag Name: item
Thread Title RSS Tag Name: title
Thread Post RSS Construct:
HTML:
[b]Published:[/b] {XML[pubDate]}
{XML[description]}
[url={XML[link]}]Read More...[/url]
Note: After adding a new feed i suggest clicking update for that feed, this will manually update that singular feed specified, the cron job included will automatically update all feeds, best not to have it update them all from the start otherwise it could execute a
lot of queries. Further more I highly recommend you do not have lots of feeds unless your server can with-stand it.