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']."'");
Same here, I dont use vbaadvance cms but mine will not present numbers, just the phrase text. Ive reinstalled literally 6+ times, double checked everything and again and again.... What to try next?
Same here, I dont use vbaadvance cms but mine will not present numbers, just the phrase text. Ive reinstalled literally 6+ times, double checked everything and again and again.... What to try next?
I'm with you on this one. I've started from scratch many times and it's still not showing the numbers, just the phrase text.
unless there's been a change to the code i missed somewhere in these 12 pages... this hack counts all new posts... is there a way to alter it so that if a user doesn't have access to a particular forum it won't coun't new posts from that forum?
is there a way to alter it so that if a user doesn't have access to a particular forum it won't coun't new posts from that forum?
I asked the same question in this thread a while back and from the replies i got back it would apparently be too complex to exclude non permission forums.
I started installing this and realized it puts those two queries system wide. Forum home is the way to go IMO. The permissions need to be worked out to. Great idea, the codes just not ready yet.
Neither thread nor post have an index on dateline, perhaps that would help performance?
Here's my test with no indexes on...
Threads: 4,164,
Posts: 60,276
no indexes: 1.8818728923798 seconds
try two, much later: 2.7305688858032 seconds
immediate retry, must be a cache: 0.00036907196044922 seconds
five minutes later: 0.23074579238892 seconds
I'll add the indexes and try much later so the cache hopefully expires.