Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
AJAX Who's Online Details »»
AJAX Who's Online
Version: 1.00, by Red Blaze Red Blaze is offline
Developer Last Online: Mar 2016 Show Printable Version Email this Page

Version: 3.5.3 Rating:
Released: 01-12-2006 Last Update: Never Installs: 31
Template Edits
Code Changes Is in Beta Stage  
No support by the author.

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.

Show Your Support

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

Comments
  #12  
Old 01-13-2006, 08:26 PM
IrPr IrPr is offline
 
Join Date: Mar 2005
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

1 newbie question:
what about Ajax Technology and Bandwidth ?
using Ajax Technology and hacks that based on AJAX will Increase BW Usage on my board?
Reply With Quote
  #13  
Old 01-13-2006, 08:36 PM
Red Blaze's Avatar
Red Blaze Red Blaze is offline
 
Join Date: Jan 2003
Location: Texas
Posts: 493
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Moosa, it doesn't have anything to do with the code you just posted. Also, I don't have "Username Management Addon - Latest Username Changes on Forumhome" by Marco.

Unfortunatly, I don't have alot of knowledge about AJAX, but from what I heard is if you have so much AJAX Technology on the site, it can increase your Server Load.
Reply With Quote
  #14  
Old 01-13-2006, 08:54 PM
o0oicebergo0o o0oicebergo0o is offline
 
Join Date: Dec 2005
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

again, these AJAX mods "sound" good, but you won't catch me even testing this script becuase I know the CPU usage will go out the roof... good concept though

I think there should be some study and modification on AJAX its self before these mods are released
Reply With Quote
  #15  
Old 01-13-2006, 09:21 PM
IrPr IrPr is offline
 
Join Date: Mar 2005
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sounds like AJAX Technology based on JS and JS increase CPU usage
Reply With Quote
  #16  
Old 01-13-2006, 09:31 PM
Lea Verou Lea Verou is offline
 
Join Date: Jul 2005
Location: Greece
Posts: 1,856
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh give the guy a break! He released something and he could not have done it and keep it to himself. You know, what you are doing is nothing but discouraging to new coders. If you don't need it don't install it but please respect his work and the members who need it and don't put him off like that.
Advice is good but you've gotten too far away from advice and are actually moaning about his release!
At least he released something and given back to the community. Have you?

Personally, I think it's an awsome idea and I would install if the number also changed...
Reply With Quote
  #17  
Old 01-13-2006, 09:38 PM
Lizard King Lizard King is offline
 
Join Date: Jan 2005
Location: Mersin
Posts: 907
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Michelle
Oh give the guy a break! He released something and he could not have done it and keep it to himself. You know, what you are doing is nothing but discouraging to new coders. If you don't need it don't install it but please respect his work and the members who need it and don't put him off like that.
Advice is good but you've gotten too far away from advice and are actually moaning about his release!
At least he released something and given back to the community. Have you?

Perfectly said
Reply With Quote
  #18  
Old 01-13-2006, 09:47 PM
99SIVTEC 99SIVTEC is offline
 
Join Date: Nov 2001
Posts: 281
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would normally agree, but in this case AJAX is simply not a good solution for this type of mod. Install the hack if you like, but I guarantee you will be back asking why your server load is spiked through the roof. This isn't a bash towards the hack creator, just a simple observation from a programmer. AJAX is great, but people get carried away with it without understanding the technology behind it.

Every time the WOL table is pulled from the database it queries the databse table which in turn places a load on the server. Normally this isn't a big issue because the query is only done on a page refresh. With this hack the table is queried by everyone every few seconds. I hope you can understand why this is a bad idea. It's the same problem everyone has with the vbPager hack. This may work fine if you have VERY small forum that isn't very active, but it WILL kill an active forum.

Quote:
Originally Posted by Michelle
Oh give the guy a break! He released something and he could not have done it and keep it to himself. You know, what you are doing is nothing but discouraging to new coders. If you don't need it don't install it but please respect his work and the members who need it and don't put him off like that.
Advice is good but you've gotten too far away from advice and are actually moaning about his release!
At least he released something and given back to the community. Have you?

Personally, I think it's an awsome idea and I would install if the number also changed...
Reply With Quote
  #19  
Old 01-13-2006, 09:48 PM
IrPr IrPr is offline
 
Join Date: Mar 2005
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry mates ! i just wanna report this bugs cause this hack is in beta stage

really nice work, BRAVO !

at least already installed this hack on my board and thanks to dear coder
Reply With Quote
  #20  
Old 01-13-2006, 09:50 PM
Lea Verou Lea Verou is offline
 
Join Date: Jul 2005
Location: Greece
Posts: 1,856
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

"A simple observation from a programmer", huh? At least the guy is releasing his work not keeping it to himself like others *cough*. One post was enough to warn people. I don't see the need for dozens of such posts that have nothing new to say but only discourage him. I wish my first hack was like that.
Reply With Quote
  #21  
Old 01-13-2006, 09:52 PM
Red Blaze's Avatar
Red Blaze Red Blaze is offline
 
Join Date: Jan 2003
Location: Texas
Posts: 493
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I understand where 99SIVTEC is coming from. I don't have much experience with AJAX, thus proving to him that I did't really know what AJAX does to the server if used improperly. Atleast 99SIVTEC actually left a comment I can work with and not insulting my work.
Reply With Quote
Reply


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 09:24 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.05146 seconds
  • Memory Usage 2,316KB
  • 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
  • (6)bbcode_code
  • (2)bbcode_quote
  • (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
  • (3)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