Version: 1.00, by Gary King
Developer Last Online: Jun 2020
Version: 3.0.0
Rating:
Released: 01-02-2004
Last Update: Never
Installs: 172
No support by the author.
PLEASE CLICK ON THE INSTALL BUTTON IF YOU INSTALLED THIS! THANKS!
What does this hack do?
This hack basically shows the number of new threads and posts since your last visit, in the navbar (under your nick.) Check out the attached screenshot for more information
Installation
This is a pretty simple hack to install.
Instructions are as follows:
FILE MODIFICATIONS
global.php
TEMPLATE MODIFICATIONS
navbar
PHRASES
navbar_sincelastvisit
OPEN global.php AND FIND
PHP Code:
echo "End call of global.php: $aftertime\n";
echo "\n<hr />\n\n";
}
(NOTE: If you want old threads with new posts to count as a new thread, then skip this next step)
UNDER IT, ADD
PHP Code:
# SINCE YOUR LAST VISIT
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM ".TABLE_PREFIX."thread WHERE lastpost > '".$bbuserinfo['lastvisit']."'");
$getnewpost=$DB_site->query_first("SELECT COUNT(*) AS posts FROM ".TABLE_PREFIX."post WHERE dateline > '".$bbuserinfo['lastvisit']."'");
(NOTE: If you did the step above, then skip this next step)
UNDER IT, ADD
PHP Code:
# SINCE YOUR LAST VISIT
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM ".TABLE_PREFIX."thread WHERE dateline > '".$bbuserinfo['lastvisit']."'");
$getnewpost=$DB_site->query_first("SELECT COUNT(*) AS posts FROM ".TABLE_PREFIX."post WHERE dateline > '".$bbuserinfo['lastvisit']."'");
The COUNT(*) method of doing the query is rather intensive for your server if you have it in phpinclude_start - it's a slow query (the more posts and threads, the slower) that can really hog down a server. I'm interested in seeing NTLDR's method though...
The COUNT(*) method of doing the query is rather intensive for your server if you have it in phpinclude_start - it's a slow query (the more posts and threads, the slower) that can really hog down a server. I'm interested in seeing NTLDR's method though...
For anyone that has installed the instructions_newthreads.txt version you might want to make a grammatical change to the phrase content
From this:
Code:
There have been {1} threads and {2} posts since your last visit!
To this:
Code:
There have been {2} posts in {1} threads since your last visit!
For those arguing over this, it's quite simple. If you installed the version that counts old threads with new posts as new threads, then those threads aren't neccessarily new. Therefore, "There have been {2} posts in {1} threads since your last visit!", because the number of "new threads" is really the number of threads with new posts in them. If you installed the version that only lists threads started since the last visit, then the original phrase is more correct.
Not installing this 'cause of the permissions thing. Gonna take some time and look into it myself.
I've found a problem with this, if I go to new posts, there's 8 new let's say, New Posts shows all 8. But, when I view all of the 8 posts, the hack still shows that they are new. Shouldn't the hack show 5 new threads if I've read 3 of the 8?
I've found a problem with this, if I go to new posts, there's 8 new let's say, New Posts shows all 8. But, when I view all of the 8 posts, the hack still shows that they are new. Shouldn't the hack show 5 new threads if I've read 3 of the 8?
Can this be fixed?
Nope, that's how vBulletin works. Click on 'marks forum read' or wait until you expire (time limit depends on what you set in your Who's Online options) then check back on the forums