AJAX Who's Online
This modification is in the archives.
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... ### Code:
if ($_GET['do'] == 'online') { echo $activeusers; exit; } 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> 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> Code:
<div>$activeusers</div> 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 |