![]() |
ok, I wrote this (very small) hack in online.php because I'd rather view the list
sorted by the Last Active time (latest first) than by the sorted by username a-z. And, sometimes I want to view the list sorted by location - which gives a very clear and nice picture of where people are currently crowding. I went on and also added an option to sort by IP address - which allows me to see if there are users from the same IP at the same time, etc. This works exactly the same as the Forum Display sorting (where you can click on "Threads" or "Replies" and the display listing gets sorted by that field, and the sort/opposite sort arrow 'jumps' next to it). Installation: Open online.php and find: Code:
$allusers= $DB_site->query("SELECT user.username, Code:
if ($order!='asc') { Code:
ORDER BY user.username Code:
ORDER BY $sqlsort $sqlorder Templates: ADD NEW templated called whosonline_sortarrow and place in it (remove spaces in { imagesfolder }): Code:
<a href="$sorturl&order=$oppositesort&sortby=$sortby"><img src="{ imagesfolder }/sort$oppositesort.gif" border="0" alt="Reverse Sort Order" align="absmiddle"></a> OPEN template whosonline Find (without the spaces in {}): Code:
<td bgcolor="{ tableheadbgcolor }"><smallfont color="{ tableheadtextcolor }"><b>User Name</b></smallfont></td> Code:
<td bgcolor="{ tableheadbgcolor }"><a href="$sorturl&order=asc&sortby=username"><smallfont color="{ tableheadtextcolor }"><b>User Name</b></smallfont></a> $sortarrow[username]</td> OPEN template whosonline_ip. REPLACE the ENTIRE content of the template with (removes spaces in {}): Code:
<td bgcolor="{ tableheadbgcolor }"><a href="$sorturl&order=asc&sortby=host"><smallfont color="{ tableheadtextcolor }"><b>IP</b></smallfont></a> $sortarrow[host]</td> That's it. Cheers, Bira |
ohh /me installs :D :up:
|
it's great bira~~~:D
but how to move the gif file to the red place?? see my attachment pic~~ |
Nice hack, thanks
|
Quote:
For example, change this: Code:
<a href="$sorturl&order=asc&sortby=username"><smallfont color="{ tableheadtextcolor }"><b>User Name</b></smallfont></a> [high]$sortarrow[username][/high] Code:
[high]$sortarrow[username][/high] <a href="$sorturl&order=asc&sortby=username"><smallfont color="{ tableheadtextcolor }"><b>User Name</b></smallfont></a> |
Man Bira is da Woman LOL
|
very handy. Thanks
|
thankz bira~:D
it's look better now~~~:D:D |
tx bira
|
Very nice, Bira. Another great one! :)
|
All times are GMT. The time now is 06:29 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|