Quote:
Originally Posted by cddw.ltd
Any luck with enabling the RSS user to show a postcount?
I'd like to get an idea how many threads the RSS feeder is automatically creating without having to toal up the posts in the different threads!
Thanks
|
Yes, I actually have that ready but I want to include a few more enhancements before the next release. If you want to add it manually, make the following changes to abouttoday.php
FIND (on or about line 1239)
PHP Code:
$db->query_write("UPDATE " . TABLE_PREFIX . "histtd_rss
SET `datelastupdate` = 0
WHERE id = ".$_GET['rssid']."");
ADD BELOW that:
PHP Code:
// update post count for user
$posts = $db->query_first("
SELECT posts
FROM " . TABLE_PREFIX . "user
WHERE userid = ".$postuserid."
");
$newpostcount = $posts['posts'] + 1;
$db->free_result($posts);
$db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET posts = ".$newpostcount."
WHERE userid = ".$postuserid."
");
That will about the post count of a user who creates a new thread from the feed.
To update the post count for the automatically added feeds, make the following change to includes/plugin_abouttoday.php
FIND (on or about line 344):
PHP Code:
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "histtd_rss
SET `datelastupdate` = 0
WHERE id = ".$rssid."");
BELOW that ADD:
PHP Code:
// update post count for user
$posts = $vbulletin->db->query_first("
SELECT posts
FROM " . TABLE_PREFIX . "user
WHERE userid = ".$postuserid."
");
$newpostcount = $posts['posts'] + 1;
$vbulletin->db->free_result($posts);
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET posts = ".$newpostcount."
WHERE userid = ".$postuserid."
");