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']."'");
Like Linear Helix mentioned earlier.
Is there anyway to make it so that the totals only show threads/posts forums that users have permission to view.
i.e if a member posts in a private forum,the total only goes up for other users that have permission to view it.
Would solve any possible complaints from members when the stats show new threads/posts have been made,but when they click on "new posts" the totals don't match.
Like Linear Helix mentioned earlier.
Is there anyway to make it so that the totals only show threads/posts forums that users have permission to view.
i.e if a member posts in a private forum,the total only goes up for other users that have permission to view it.
Would solve any possible complaints from members when the stats show new threads/posts have been made,but when they click on "new posts" the totals don't match.
BTW, clicks Install.
Something like that probably wouldn't be worth it for the time and power it'll require for a query like that, I'm not too sure right now anyways on how exactly the query would be written out
Like Linear Helix mentioned earlier.
Is there anyway to make it so that the totals only show threads/posts forums that users have permission to view.
i.e if a member posts in a private forum,the total only goes up for other users that have permission to view it.
Would solve any possible complaints from members when the stats show new threads/posts have been made,but when they click on "new posts" the totals don't match.
BTW, clicks Install.
you can use something like this:
PHP Code:
// to check permissions for different users in forums $forumids = array_keys($forumcache); foreach($forumids AS $key => $value)
if (!($fperms & CANVIEW) OR !($fperms & CANSEARCH) OR !verify_forum_password($forumid, $forum['password'], false)) { // get rid of the forumids that the user doesnt have permission to view unset($forumids["$key"]); } }
Then you add (new threads count in this case) ,
PHP Code:
$getnewthread=$DB_site->query_first(" SELECT COUNT(*) AS threads FROM ".TABLE_PREFIX."thread WHERE lastpost IN(" . implode(', ', $forumids) . ") > '".$bbuserinfo['lastvisit']."' ");