Heyho,
I'd like to show up new posts in Navbar...
I thought about using the following code from Vbadvanced:
Template navbar
Quote:
<div><a href="$vboptions[bburl]/search.php?$session[sessionurl]do=getnew">$vbphrase[new_posts]</a>: $newposts</div>
|
Where do i have to add the PHP code, to let the number of recent Posts show up???
Quote:
// New posts
if ($mod_options['portal_welcome_newposts'])
{
if (strlen($vbulletin->session->vars['newposts']) > 0 AND !$vbulletin->options['threadmarking'])
{
$newposts = number_format($vbulletin->session->vars['newposts']);
}
else
{
$getnewposts = $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)') . "
AND visible = 1
");
if (!$vbulletin->options['threadmarking'])
{
$db->query_write("UPDATE " . TABLE_PREFIX . "session SET newposts = '$getnewposts[count]' WHERE userid = " . $vbulletin->userinfo['userid']);
}
$newposts = vb_number_format($getnewposts['count']);
}
}
|
--------------- Added [DATE]1207387846[/DATE] at [TIME]1207387846[/TIME] ---------------
ok, got it working by inserting the following Code into Global.php:
Quote:
// ####### New Posts in Currently Active Users #############
if ($vbulletin->userinfo['userid'] != '0')
{
// Posts
$getnewposts = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post WHERE visible = 1 AND dateline >= '{$vbulletin->userinfo['lastvisit']}'");
$newposts = number_format($getnewposts['count']);
}
// #################### New Posts in Currently Active Users #######################
|
BUT it doesnt show count of posts in VbAdvanced Portal ??? Does someone knwo where to add the Code to make the variable $newposts available even in navbar when you are in VBA portal?