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']."'");
There is no COUNT() because that wouldn't do the job I use a totally different method in order to get the three sets of data I need from just the one query, which with testing on a usual new post/thread count seems equally as fast as two queries.
Remember also thats more queries can sometimes be better and quicker.
There is no COUNT() because that wouldn't do the job I use a totally different method in order to get the three sets of data I need from just the one query, which with testing on a usual new post/thread count seems equally as fast as two queries.
Remember also thats more queries can sometimes be better and quicker.
I know, that's why I've left it at 2 queries (for now anyways, until I find time to test the different queries I could use and their speeds )
Is it just me, or will this let people who have no access to a certain forum realize that a new post has been made even if they can't check it?
I make a post in my Central Command, some registered user sees that the posts since last visit went up by 1, even though he has no permission to view the post.
Anybody know a way to fix this? Check for permission somehow in or after the query?
Yeah I figured it was just a accident. I got it working, now I'm working on trying out vbIndex and eventually replacing vbportal when I switch to 3.0. I got to post on the vbindex topic about an error I'm getting there now
i really want this hack on my forum but when i try to look in the global.php file, i cannot find those commands listed anywhere on that file. i did a search on the global.php file and i can't find anywhere it says echo or anything. and i'm not sure if the navbar template file is the same as the template file in the admincp directory or not.... can someone please help? thanks.