Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Details »»

Version: , by bira bira is offline
Developer Last Online: Jun 2013 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 12-30-2001 Last Update: Never Installs: 18
 
No support by the author.

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,
ABOVE it ADD:

Code:
 if ($order!='asc') {
   $sqlorder='DESC';
 } else {
   $sqlorder='ASC';
 }
 if (!$sortby) {
 	$sortby = "username";
 }
 switch ($sortby) {
 	case username:
 		$sqlsort = "user.username";
 		break;
 	case location:
 		$sqlsort = "session.location";
 		break;
 	case time:
 		$sqlsort = "session.lastactivity";
 		break;
 	case host:
 		$sqlsort = "session.host";
 		break;
 }
 
 $sorturl="online.php?s=$session[sessionhash]";
 $oppositesort=iif($order=='asc','desc','asc');
 
 eval("\$sortarrow[$sortby] = \"".gettemplate('whosonline_sortarrow')."\";");
still in online.php, find:

Code:
ORDER BY user.username
REPLACE this with:

Code:
ORDER BY $sqlsort $sqlorder
Save and upload.

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>
save.

OPEN template whosonline

Find (without the spaces in {}):

Code:
	<td bgcolor="{ tableheadbgcolor }"><smallfont color="{ tableheadtextcolor }"><b>User Name</b></smallfont></td>
	<td bgcolor="{ tableheadbgcolor }"><smallfont color="{ tableheadtextcolor }"><b>Location</b></smallfont></td>
	<td bgcolor="{ tableheadbgcolor }"><smallfont color="{ tableheadtextcolor }"><b>Last Active</b></smallfont></td>
REPLACE it with (removes spaces in {}):

Code:
	<td bgcolor="{ tableheadbgcolor }"><a href="$sorturl&order=asc&sortby=username"><smallfont color="{ tableheadtextcolor }"><b>User Name</b></smallfont></a> $sortarrow[username]</td>
	<td bgcolor="{ tableheadbgcolor }"><a href="$sorturl&order=asc&sortby=location"><smallfont color="{ tableheadtextcolor }"><b>Location</b></smallfont></a> $sortarrow[location]</td>
	<td bgcolor="{ tableheadbgcolor }"><a href="$sorturl&order=desc&sortby=time"><smallfont color="{ tableheadtextcolor }"><b>Last Active</b></smallfont></a> $sortarrow[time]</td>
save.

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>
Save.

That's it.

Cheers,

Bira

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 12-31-2001, 08:32 PM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

kewl ...thank you.
Reply With Quote
  #13  
Old 01-01-2002, 06:21 PM
SirSteve SirSteve is offline
 
Join Date: Oct 2001
Posts: 382
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent! Thanks!
Reply With Quote
  #14  
Old 06-08-2002, 05:53 PM
Chris Blount Chris Blount is offline
 
Join Date: Mar 2002
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack but I notice that each time the who's online refreshes, it defaults to the names being in reverse alphabetical order. Is there a way to get them back to alphabetical order by default like they were before the hack?
Reply With Quote
  #15  
Old 06-10-2002, 11:59 AM
Kars10's Avatar
Kars10 Kars10 is offline
 
Join Date: Jun 2002
Location: Germany/Franken
Posts: 748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works nice!!
Thanx 4 this great Hack!! :-)
Reply With Quote
  #16  
Old 06-10-2002, 06:14 PM
inetd inetd is offline
 
Join Date: Nov 2001
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

/me install this hack

Good add-on to Who's Online, bira! :tup:
Reply With Quote
  #17  
Old 09-26-2002, 01:23 AM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice bira. ive had it installed before and it went well under my new 2.2.7 forums.

however im hoping someone can give me a solution for a tiny problem. you see. if you click the link to sort by Last Active, it will sort by user name once WOL is re-loaded.

try it on my forums (guest can view my who's online page) http://www.kousetsu.net/kan/online.php?s=


anyone got any ideas? :ermm:
Reply With Quote
  #18  
Old 10-21-2002, 06:01 PM
BigCheeze BigCheeze is offline
 
Join Date: Oct 2002
Location: Lost in Colorado
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks! Works great!!!
Reply With Quote
  #19  
Old 07-08-2003, 10:21 AM
Bison's Avatar
Bison Bison is offline
 
Join Date: Jun 2002
Location: Virginia Beach, Virginia
Posts: 522
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed!
Reply With Quote
  #20  
Old 08-22-2003, 06:44 AM
julius julius is offline
 
Join Date: Nov 2001
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed.
Thanhs.
Reply With Quote
  #21  
Old 08-23-2003, 07:45 AM
gmarik's Avatar
gmarik gmarik is offline
 
Join Date: May 2002
Location: Mocsow
Posts: 1,288
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Fine, fine

/me likes it
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:21 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06264 seconds
  • Memory Usage 2,300KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (8)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete