couldn't be arsed writing up upgrade info from the old version, but you should be able to re-trace your steps by checking the old version.. these instructions weren't written when i rewrote the hack, but were compiled now by looking at the current code.. i don't think i've left out anything, but if i have, slap me around a bit, mmkay?
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Please, forgive my newbiness, but can you please explain where ALL lines of code go in the index.php file???
Your directions give me line numbers (that's fine, I find where it all needs to go) but it does not tell me what code I need to replace it with, or if code needs to be removed, etc.....
For instance, your page says:
locate the line that says:
Code:
if ($loggedin=$DB_site->fetch_array($loggedins)) {
Ok, I have SERIOUSLY fugged something up!!! Here's what my index.php line looks like from right where the first edit of this hack goes in till the end of the last hack. Keep in mind, I've since added the hack (what I thought was the right way) and had to go back and try to set everything back as normal. Obviously, it has not worked, as this is what my "Who's Online" is showing!
the complete if($displayloggedin) clause should look like this when you're done (btw.. mods.. how much are we allowed to paste?? cut out some stuff if you have to )
PHP Code:
if ($displayloggedin) {
$datecut=time()-$cookietimeout;
$loggedins=$DB_site->query_first("SELECT COUNT(*) AS sessions FROM session WHERE userid=0 AND lastactivity>$datecut");
$numberguest=$loggedins['sessions'];
$numbervisible=0;
$numberregistered=0;
$loggedins=$DB_site->query("SELECT DISTINCT session.userid,usergroupid,username,invisible
FROM session
LEFT JOIN user ON (user.userid=session.userid)
WHERE session.userid>0 AND session.lastactivity>$datecut ORDER BY invisible ASC, username ASC");
if ($loggedin=$DB_site->fetch_array($loggedins)) {
if($loggedin['usergroupid']==6||$loggedin['usergroupid']==7||$loggedin['usergroupid']==5) {
$modsloggedin[$loggedin['userid']]=$loggedin['username'];
}
$numberregistered++;
if ($loggedin['invisible']==0 or $bbuserinfo['usergroupid']==6) {
$numbervisible++;
$userid=$loggedin['userid'];
if ($loggedin['invisible']==1) { // Invisible User but show to Admin
$username=$loggedin['username'];
$invisibleuser = '*';
} else {
$username=$loggedin['username'];
$invisibleuser = '';
}
//$location=$loggedin['location'];
eval("\$activeusers = \"".gettemplate('forumhome_loggedinuser')."\";");
}
while ($loggedin=$DB_site->fetch_array($loggedins)) {
if($loggedin['usergroupid']==6||$loggedin['usergroupid']==7||$loggedin['usergroupid']==5) {
$modsloggedin[$loggedin['userid']]=$loggedin['username'];
}
$numberregistered++;
$invisibleuser = '';
if ($loggedin['invisible']==1 and $bbuserinfo['usergroupid']!=6) {
continue;
}
$numbervisible++;
$userid=$loggedin['userid'];
if ($loggedin['invisible']==1) { // Invisible User but show to Admin
$username=$loggedin['username'];
$invisibleuser = '*';
} else {
$username=$loggedin['username'];
}
$location=$loggedin['location'];
eval("\$activeusers .= \", ".gettemplate('forumhome_loggedinuser')."\";");
}
reset($modsloggedin);
while(list($key,$val)=each($modsloggedin)) {
$modloguname=$val;
$modlogid=$key;
eval("\$moderatorsloggedin .= \"".gettemplate('forumhome_modsloggedin')."\";");
}
}
$DB_site->free_result($loggedins);