PDA

View Full Version : Can someone please tell me which hack this is?


Zzed
03-29-2002, 04:48 PM
I've been boing crazy trying to find it. :(

<---- Look to the left where it says Online/Offline. Can you please tell me which hack it is?

I wanted that hack so badly that I ended up doing my own version. It was as simple as adding an if statement to showthread.php.

Thanks in advence.

filburt1
03-29-2002, 05:24 PM
It's not a hack, just a template mod. Look for offlinebit or something like that, and then you can put it wherever you want. You can see how I mod'ed my postbot at my site.

g-force2k2
03-29-2002, 07:17 PM
Here Zzed i'll give you a hand ;)

first you have to edit the postbit template:

find: $onlinestatus

and place it after the $post[avatar]<p>

then open the both postbit_offline and replace the coding with:

offline

then open the postbit_online and replace the coding with:

online

Hope that helps Zzed :D

~gforce2001~

Zzed
03-29-2002, 07:43 PM
Thank you gforce2001. :)

I was trying to avoid modifying any templates. I have about 15 different styles and it is a pain to modify those 2 templates in every single one of them.

My implementation touches only showthread.php.

I added my code directly below this code:

$counter=0;
while ($post=$DB_site->fetch_array($posts) and $counter++<$perpage) {

if ($postdone[$post[postid]]) {
$counter--;
continue;
} else {
$postdone[$post[postid]]=1;
}



This is what I added:

//Online hack
$datecut = time() - $cookietimeout;
$isonline=$DB_site->query_first("SELECT userid, sessionhash FROM session WHERE userid='$post[userid]' and lastactivity > $datecut");
if(!$isonline[userid]){
$onlinestat="<p>Offline<br>";
}
else{
if($post[invisible]==1){
if(($bbuserinfo[usergroupid]==6) or ($bbuserinfo[userid]==$post[userid])){
$onlinestat="<p><table style=\"filter:glow(color=#C4C400, strength=3)\"><font face=\"verdana\" size=\"1\">Online</font></table><br>";
}
else{
$onlinestat="<p>Offline<br>";
}
}
else{
$onlinestat="<p><table style=\"filter:glow(color=#C4C400, strength=3)\"><font face=\"verdana\" size=\"1\">Online</font></table><br>";
}
}
$post[posts]="$post[posts]$onlinestat";