Back to vBulletin 3.5 Add-ons

AJAX Who's Online
Mod Version: 1.00, by Red Blaze

This modification is in the archives.
vB Version: 3.5.3 Rating: (1 vote - 5.00 average) Installs: 31
Released: 13 Jan 2006 Last Update: Never Downloads: 5
Not Supported Template Edits Code Changes Is in Beta Stage  

First off, this is my first modification. It's tiny, it's obvious, but I'm proud of it. I have Zero Tolerance to thank, he did give me some hints and tips.

Description:
This only refreshes the names of the users in the index page of the forums. Not the "currently online" number of users. It could say currently 4 users online, and there's a huge list of usernames.
I don't really see a need of a picture since there's no visual change. It only calls the names of the users currently online and removes them if they're offline without the need of refreshing the index page of the forums.

Edits:
1 Template to edit (FORUMHOME)
1 File to edit (index.php)

First the File Edit:
Open your index.php file in your forum directory.
Find:
Code:
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTTA HERE... ###
Above add:
Code:
if ($_GET['do'] == 'online')
{
	echo $activeusers;
	exit;
}
Save, close, then upload index.php file to your forum directory.

Next, open your FORUMHOME template.
Find:
Code:
			<div class="smallfont">
				<div style="white-space: nowrap"><phrase 1="$recordusers" 2="$recorddate" 3="$recordtime">$vbphrase[most_users_ever_online_was_x_y_at_z]</phrase>
Above that, add:
Code:
<script type='text/javascript'>
<!--
function requestWhoOnline()
{
	doReqOnline = new vB_AJAX_Handler(true)
	doReqOnline.onreadystatechange(ReqOnlineDone)
	doReqOnline.send('index.php?do=online')
}
function ReqOnlineDone()
{
	if (doReqOnline.handler.readyState == 4 && doReqOnline.handler.status == 200)
	{
		fetch_object('whoisonline').innerHTML = doReqOnline.handler.responseText
		setTimeout("requestWhoOnline()", 60000)
	}
}
setTimeout("requestWhoOnline()", 20000)
-->
</script>
Now Find:
Code:
<div>$activeusers</div>
Replace with:
Code:
<div id="whoisonline">$activeusers</div>
====================

Since this is my first mod, I'd back up the files. Forgive me if this hack has already been done. I made a strict search and found no such thing. I decided to try to do it, and voila! Go me.

Download

No files for download.

Similar Mods

Social Group and Album Enhancements [AJAX] Album Next & Prev Links Use AJAX vBulletin 3.8 Add-ons

vblts.ru supports vBulletin®, 2022-2024