Log in

View Full Version : New Posts on page besides forumhome


aymelek
12-19-2010, 12:28 PM
I put the following code into the navbar template:

$vbphrase[new_posts_nav] ({$vbulletin->userinfo['newposts']}) which displays New Posts (#)

and it works fine on the forumhome, but as soon as you go to another part of the forum the new posts don't show so all you see is New Posts () and is not showing the new posts.

Is there a way to show this throughout the entire forum?

kh99
12-19-2010, 01:57 PM
I tried to look at this but I don't find any reference to $vbulletin->userinfo['newposts'] anywhere in the code or any templates, and it doesn't work for me on any pages. Are you sure that's not from a mod or something?

aymelek
12-19-2010, 02:21 PM
It was located at the top of the page where it said
Welcome User: blah blah blah
Private Messages: # unread
New Posts: #

I just moved that from the top of the page and put it into the navbar

Booyakan
12-19-2010, 02:39 PM
I may be totally wrong here but this looks like a problem I had before... The second post in the thread might clear it up for you? Hope this helps, if not, sorry.


https://vborg.vbsupport.ru/showthread.php?t=249175

kh99
12-19-2010, 02:57 PM
I may be totally wrong here but this looks like a problem I had before... The second post in the thread might clear it up for you?

I think that's exactly it (and it explains the php in the template from your other thread :)). I was going to help figure out what code might be needed to make it work, but I still don't see that newposts thing - it might be due to a version difference.

aymelek
12-19-2010, 03:30 PM
I took a look at the link you sent, and it does make sense. However, I'm just editing the navbar template, which appears on every page.

To the showthreads template (just for testing) I added

$numNewPosts = $vbulletin->userinfo['newposts'];

and then replaced the code on the navbar to this:

$vbphrase[new_posts_nav] ($numNewPosts)

and it removed the number from the navbar and I got "= Array['newposts'];"

BTW, I'm using v 3.5.4

Update: I wasn't able to manually create the code, but I did find a place where it created a global variable (which may have been what you guys were getting at) and just inserted some PHP code into it.

Found here (http://www.vbulletin.com/forum/showthread.php?302881-New-posts-since-last-visit-for-v3.8.1&) in case anyone's interested. Thanks for leading me down the right path guys!