PDA

View Full Version : Can i keep attachment views out of who's online?


Sean335
10-08-2002, 04:09 AM
I don't really care about how much bandwidth the site uses up, but i do care about the stats on the board. When people link attached images on other sites, the visitors skyrocket and show hundreds of people all viewing one attachment. Is there a way i can stop attachment views from showing up in who's online, but still allow off-site linking?

Xenon
10-08-2002, 11:44 AM
hmm, open online.php find if (!$thread[title][$post[$userinfo[postid]]] || !$forum[canview][$thread[forumid][$post[$userinfo[postid]]]] || (!$forum[canviewothers][$thread[forumid][$post[$userinfo[postid]]]] && $thread[postuserid][$post[$userinfo[postid]]] != $bbuserinfo[userid])) {
$userinfo[where] = "Viewing Attachment";
} else {
$userinfo[where] = "Viewing Attachment in Thread <a href='showthread.php?s=$session[sessionhash]&postid=$userinfo[postid]'>".$thread[title][$post[$userinfo[postid]]]."</a>";
}
and replace it with $userinfo[where]="";

that means it won't show viewing announcements, but the guest remain listed on who's online, just no location

Sean335
10-08-2002, 10:24 PM
That just took out the text of where they were, but they still showed up as a user. I found something that seemingly works well though.

I replacedelse { // Guest
$guests[$count][location] = $user[location];
$guests[$count][invisible] = 0;
$guests[$count][username] = "Guest";
if ($WOLresolve && $usergroupdef['canwhosonlineip']) {
$guests[$count][ipaddress] = @gethostbyaddr($user[host]);
} else {
$guests[$count][ipaddress] = $user[host];
}
$guests[$count][lastactivity] = $user[lastactivity];
$count++;
} withelse { // Guest
if(!strstr($user[location],'attachment.php'))
{

$guests[$count][location] = $user[location];
$guests[$count][invisible] = 0;
$guests[$count][username] = "Guest";
if ($WOLresolve && $usergroupdef['canwhosonlineip']) {
$guests[$count][ipaddress] = @gethostbyaddr($user[host]);
} else {
$guests[$count][ipaddress] = $user[host];
}
$guests[$count][lastactivity] = $user[lastactivity];
$count++;
}
}

and in index.php i replaced $loggedins=$DB_site->query_first("SELECT COUNT(*) AS sessions FROM session WHERE userid=0 AND lastactivity>$datecut"); with $loggedins=$DB_site->query_first("SELECT COUNT(*) AS sessions FROM session WHERE userid=0 AND lastactivity>$datecut AND location NOT LIKE '%attachment.php%'");
anything i may have missed or messed up?

Xenon
10-09-2002, 09:55 AM
seems ok to me :)