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']."'");
Okay the instructions have been updated slightly to be able to incorporate the phrases feature of vB 3. This update is strictly optional, so you do not have to install it, but if you want to have this hack in a different language, then you can install the hack with the updated instructions
Thanks to Bernd Glasstett for the idea of using phrases and Link14716 because I'm actually using the phrases that he suggested
How will I make it into one query, why don't you just post the one query so I can use that instead
It can easily be done with one query. My version in vBindex 3 which uses origional code only uses one query for new threads, posts and updated subscribed threads.
ok, i'm really stupid.... i just managed to upgrade to rc2 myself with no prior experience and it worked out good. i didn't install this hack into it yet cause i was probably going to upgrade first. now i did look for the global.php file and found it in the admincp folder but i couldn't find this text:
******************************
OPEN global.php AND FIND
******************************
echo "End call of global.php: $aftertime\n";
echo "\n<hr />\n\n";
and i looked in the same directory and i looked in the templates folder and i couldn't find this text either:
It can easily be done with one query. My version in vBindex 3 which uses origional code only uses one query for new threads, posts and updated subscribed threads.
Okay I never meant said that it's impossible, and I never had something like "if you're good enough then show me the query"
I just asked for the query, instead of just saying it's possible to do in one query
Also, I can't seem to find the COUNT() function in your code?