Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 05 Apr 2008, 09:44
blackmamba16 blackmamba16 is offline
 
Join Date: Oct 2007
Shwo up new Posts in Navbar?

Heyho,

I'd like to show up new posts in Navbar...

I thought about using the following code from Vbadvanced:

Template navbar

<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???

// 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 05 Apr 2008 at 10:30 ---------------

ok, got it working by inserting the following Code into Global.php:

// ####### 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?

Last edited by blackmamba16; 05 Apr 2008 at 10:30. Reason: Auto-Merged DoublePost
Reply With Quote
  #2  
Old 30 Apr 2008, 20:56
blackmamba16 blackmamba16 is offline
 
Join Date: Oct 2007
push
Reply With Quote
  #3  
Old 01 May 2008, 01:09
GameWizard's Avatar
GameWizard GameWizard is offline
 
Join Date: Apr 2004
Try adding the code into a new plugin under the hook global_start
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mini Mods My Posts & Threads in navbar dutchbb Modification Graveyard 69 22 May 2009 07:04



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 00:56.

Layout Options | Width: Wide Color: