View Full Version : New posts since last visit for v3.8.1
NJAquaman
Sun 15th Mar '09, 6:05pm
How do I add the number of new posts since last visit globally so
i can put it anywhere in any template?:confused:
$newposts or $newpost[count] ....... should be a number for that user
Prob has to be a plugin or hook...:rolleyes:
thanks.:D
Jake Bunce
Sun 15th Mar '09, 6:55pm
Here is an old guide for that:
http://www.vbulletin.com/forum/showthread.php?t=101600
But there is no longer a phpinclude_start template. You need to use a plugin now. If you need help with this code then you can post on www.vbulletin.org.
NJAquaman
Sun 15th Mar '09, 7:05pm
Here is an old guide for that:
http://www.vbulletin.com/forum/showthread.php?t=101600
But there is no longer a phpinclude_start template. You need to use a plugin now. If you need help with this code then you can post on www.vbulletin.org (http://www.vbulletin.org).
OK great thanks Jake!!! :D
NJAquaman
Sun 15th Mar '09, 8:05pm
Plugins & Products > Add New Plugin >
Product: vBulletin
Hook Location : global_start
Title : New Posts Global Variable
Execution Order : 5
Plugin PHP Code: .....
if ($vbulletin->userinfo['userid'])
{
$pcount = $vbphrase['no_new_posts_welcome'];
$postcount = $vbulletin->db->query_first("
SELECT COUNT(dateline) as pcount
FROM ".TABLE_PREFIX."post
WHERE dateline > ".$vbulletin->userinfo['lastvisit']
);
if ($postcount['pcount'])
{
if ($postcount['pcount'] == 1)
{
$pcount = "1 ";
}
else
{
$pcount = $postcount['pcount'];
}
}
$pcount = $pcount;
}Global Variable you can put anywhere
$pcountit will display the # of new post for that user when the user is lodged in !
NOTE - if it doesn't display in a certin section of you site , make shore you put the $pcount/pcount in the global section of that product!
Thanks Jake!
Powered by vBulletin™ Version 4.0.2 Copyright © 2010 vBulletin Solutions, Inc. All rights reserved.