Emeralda
10-24-2011, 07:14 PM
And I'm not sure what's wrong, I tried 3 different things:
I had Cyb's Advanced New Posts installed 3 different times before, but it suddenly stopped working the 4th time. It always shows "New Posts: 0," and on different styles, so that's not it.
I also tried these codes:
https://vborg.vbsupport.ru/showthread.php?t=75539 (inserted it to index.php, since I couldn't find the template, and later $newposts into the template)
//New Posts
$getnewposts = $DB_site->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post WHERE dateline >= '$bbuserinfo[lastvisit]'");
$newposts = number_format($getnewposts['count']);
//New Posts
Code used on Wordpress
$newposts = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post AS post " . iif($vbulletin->options['threadmarking'], 'LEFT JOIN ' . TABLE_PREFIX . 'threadread AS threadread ON (threadread.threadid = post.threadid AND threadread.userid = ' . $vbulletin->userinfo['userid'] . ')') . " WHERE dateline >= " . $vbulletin->userinfo['lastvisit'] . iif($vbulletin->options['threadmarking'], ' AND dateline > IF(threadread.readtime IS NULL, ' . (TIMENOW - ($vbulletin->options['markinglimit'] * 86400)) . ', threadread.readtime)'));
None of the three options worked (plugin and codes), so maybe it's some setting on the forum that prevents counting up new posts? It did work on the same vB version on the same server before a reinstall.
EDIT: O.O I just notice vb.org also has something like that. How is it done?
I had Cyb's Advanced New Posts installed 3 different times before, but it suddenly stopped working the 4th time. It always shows "New Posts: 0," and on different styles, so that's not it.
I also tried these codes:
https://vborg.vbsupport.ru/showthread.php?t=75539 (inserted it to index.php, since I couldn't find the template, and later $newposts into the template)
//New Posts
$getnewposts = $DB_site->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post WHERE dateline >= '$bbuserinfo[lastvisit]'");
$newposts = number_format($getnewposts['count']);
//New Posts
Code used on Wordpress
$newposts = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post AS post " . iif($vbulletin->options['threadmarking'], 'LEFT JOIN ' . TABLE_PREFIX . 'threadread AS threadread ON (threadread.threadid = post.threadid AND threadread.userid = ' . $vbulletin->userinfo['userid'] . ')') . " WHERE dateline >= " . $vbulletin->userinfo['lastvisit'] . iif($vbulletin->options['threadmarking'], ' AND dateline > IF(threadread.readtime IS NULL, ' . (TIMENOW - ($vbulletin->options['markinglimit'] * 86400)) . ', threadread.readtime)'));
None of the three options worked (plugin and codes), so maybe it's some setting on the forum that prevents counting up new posts? It did work on the same vB version on the same server before a reinstall.
EDIT: O.O I just notice vb.org also has something like that. How is it done?