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']."'");
$forumids = array_keys($forumcache);
foreach($forumids AS $key => $value)
{
$fperms = &$bbuserinfo['forumpermissions']["$forumid"];
$forum = &$forumcache["$forumid"];
if (!($fperms && CANVIEW) OR !($fperms && CANSEARCH) OR !verify_forum_password($forumid, $forum['password'], false)) {
unset($forumids["$key"]);
}
}
$forumids apparently ends up empty, because when the script tries to implode() it later on for use in the IN() in the query, nothing results, breaking the query.
ok, i found out that the reason i couldn't find the phrase in the global.php section was because i was lookin at the wrong global.php file....... the only thing i need help on now is editing the navbar template. where do i find that????
$forumids = array_keys($forumcache); foreach($forumids AS $key => $value) { $fperms = &$bbuserinfo['forumpermissions']["$forumid"]; $forum = &$forumcache["$forumid"]; if (!($fperms && CANVIEW) OR !($fperms && CANSEARCH) OR !verify_forum_password($forumid, $forum['password'], false)) { unset($forumids["$key"]); } }
$forumids apparently ends up empty, because when the script tries to implode() it later on for use in the IN() in the query, nothing results, breaking the query.
Yep, It'll work if you use it for one query only. The second one ends up empty.