Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[HACK] users names in color
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2007-10-03 21:34:27
as requested

usersonline_block.php

<?

//USERS ONLINE

begin_block("Users Online");

$file = "".$site_config["cache_dir"]."/cache_usersonlineblock.txt";

$expire = 600; // time in seconds

if (file_exists($file) &&

filemtime($file) > (time() - $expire)) {

$usersonlinerecords = unserialize(file_get_contents($file));

}else{

$usersonlinequery = mysql_query("SELECT id, username, class FROM users WHERE privacy !='strong' AND UNIX_TIMESTAMP('" . get_date_time() . "') - UNIX_TIMESTAMP(users.last_access) < 900") or die(mysql_error());



while ($usersonlinerecord = mysql_fetch_array($usersonlinequery) ) {

$usersonlinerecords[] = $usersonlinerecord;

}

$OUTPUT = serialize($usersonlinerecords);

$fp = fopen($file,"w");

fputs($fp, $OUTPUT);

fclose($fp);

} // end else

if ($usersonlinerecords == ""){

echo "No Users Online";

}else{

foreach ($usersonlinerecords as $user) {

switch($user["class"]){

case 1:

$color = "black";// user

break;

case 2:

$color = "yellow";// power user

break;

case 3:

$color = "red";// VIP

break;

case 4:

$color = "green";// uploader

break;

case 5:

$color = "brown";//moderator

break;

case 6:

$color = "orange";//super moderator

break;

case 7:

$color = "blue";// you and most trusted :)

break;

}

print("<a href=\"account-details.php?id=".$user["id"]."\"><font style=\" color: ".$color."\">".$user["username"]."</font></a>, ");

}

}



end_block();

?>
Unknown User
2007-10-03 22:18:43
Nice, thanks :P
Unknown User
2007-10-04 12:26:22
thanks it working very good

gia
Unknown User
2007-10-12 07:06:13
Some users do not leave the usersonline.

Although not entering more than 24h
announce-hell.png
announce-hell.png
2007-10-12 09:05:33
it caches the output every 10 mins, it could be they have the index page open (with the shoutbox on) and then it keeps updating their last online time
Unknown User
2007-10-12 10:35:41
They are no longer in the index, did willfully to test this issue...
Unknown User
2007-10-12 20:45:20
I have the same problem.  I've watched a user logout and then close their browser completely only to stay in the users online box for several hours.

"satter21, post: 33922":
Some users do not leave the usersonline.Although not entering more than 24h
Unknown User
2007-10-13 18:17:47
how do you know they closed the browser, they could have 2 browsers open
Unknown User
2007-10-17 19:32:04
Quote:
I have the same problem. I've watched a user logout and then close their browser completely only to stay in the users online box for several hours.

Please help
Unknown User
2007-10-20 22:08:54
i have the same problem

my friend visite the site for 10 min and leave (closed the browser)

after 3 h on the online block show him

Sorry for my bad English i1m Hungarian
Unknown User
2007-10-25 12:55:27
Thanks!
Unknown User
2007-11-16 00:57:29
I applied this .. and its working thanks .. took about 10 min to update
Unknown User
2007-11-23 15:25:53
thanksssssssssssssss  :)  great work
Unknown User
2007-11-23 22:15:59
Thanks for this !!!!!:)
Unknown User
2007-12-16 00:02:07
not work for me in v2.2 , nothing show in my user online block !! you got a idee??not just the colors but no user ........ is empty
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728