vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   AJAX Who's Online (https://vborg.vbsupport.ru/showthread.php?t=105233)

Red Blaze 01-12-2006 10:00 PM

AJAX Who's Online
 
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.

99SIVTEC 01-13-2006 05:18 PM

wont this kill the server on active forums? It runs the WOL queries every second to find out who is online.

waza 01-13-2006 05:24 PM

I don't see why this has to be in ajax..

croportal 01-13-2006 05:58 PM

and screenshots,




I don't see why this has to be in ajax..

goyo 01-13-2006 06:05 PM

Thanks...great modification...

Many of my members using the ajax chatbox (so they're on the index page most of the time)...Now they can track who's in...

Red Blaze 01-13-2006 06:12 PM

I didn't think there had to be a screen shot as that there isn't any visual change. If you don't need this, that's ok. I just wanted to share what I did.

99SIVTEC 01-13-2006 06:24 PM

I would just watch the server load. If you have even a semi active board this is going to bring it to the ground.

Snake 01-13-2006 07:00 PM

Thanks!

ChurchMedia 01-13-2006 07:01 PM

Great hack! Works perfectly. **installs**

I did add the code change for index.php as a plugin instead of hacking the file. It's the forumhome_complete hook.

Thanks!

IrPr 01-13-2006 08:19 PM

Nice Hack! but seems a little buggie

1:Currently Active Users: X ( Y Members And Z Guests )
this code:
Code:

                        <a href="online.php$session[sessionurl_q]" rel="nofollow">$vbphrase[currently_active_users]</a>: $totalonline (<phrase 1="$numberregistered" 2="$numberguest">$vbphrase[x_members_and_y_guests]</phrase>)
                </td>

2:not compatible with Username Management Addon - Latest Username Changes on Forumhome by Marco

Quote:

Warning: implode(): Bad arguments. in \includes\functions_mh_unm.php on line 198


Edit: *installed* and disabled MarcoH64's Addon

IrPr 01-13-2006 08:26 PM

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?

Red Blaze 01-13-2006 08:36 PM

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.

o0oicebergo0o 01-13-2006 08:54 PM

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

IrPr 01-13-2006 09:21 PM

sounds like AJAX Technology based on JS and JS increase CPU usage

Lea Verou 01-13-2006 09:31 PM

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... :)

Lizard King 01-13-2006 09:38 PM

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 :)

99SIVTEC 01-13-2006 09:47 PM

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... :)


IrPr 01-13-2006 09:48 PM

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 :)

Lea Verou 01-13-2006 09:50 PM

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

Red Blaze 01-13-2006 09:52 PM

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.

IrPr 01-13-2006 09:56 PM

it seems this plugin runs AJAX Script once per 20 seconds
this wont make CPU to the roof ;)

99SIVTEC 01-13-2006 09:56 PM

Depends on the size of the forum.

I'm not trying to come down on the guy. It's a great start to hacking and we should all thank him for taking the time to release it. I just want to warn users of large forums that AJAX hacks such as this probably shouldn't be used. That is all.

Michelle, i'm unsure what the first part of your comment means. If you are questioning me as a programmer, then by all means do so, but you don't know me or anything I have created. I'm simply offering advice here.

Red Blaze 01-13-2006 09:57 PM

It's actually every 60 seconds. It can be changed to a higher number if you'd like.

99SIVTEC 01-13-2006 09:58 PM

That will surely help matters :).

IrPr 01-13-2006 09:59 PM

Quote:

Originally Posted by Sonikku
It's actually every 60 seconds. It can be changed to a higher number if you'd like.

sure?
Code:

setTimeout("requestWhoOnline()", 20000)

Lea Verou 01-13-2006 10:00 PM

I wasn't talking about 99SIVTEC. I was talking about the others who said nothing more about the server load and kept moaning. And what bugs me the most is that they have never released anything although they seem to know a bit of coding. I've said in other thread how this kind of .orger annoys me a lot. Just getting with no giving back although they can. They just keep it to themselves to make their forum "unique". And now they are discouraging people who aren't that selfish??? Gosh! :mad:

Sonikku, if your first hack is like that you are going to be a brilliant coder. ;)

Lea Verou 01-13-2006 10:02 PM

99SIVTEC, if you didn't understand what I mean, the better a programmer you are the worse it is that you haven't released anything. It just seems selfish imho...

Red Blaze 01-13-2006 10:07 PM

Code:

                fetch_object('whoisonline').innerHTML = doReqOnline.handler.responseText
                setTimeout("requestWhoOnline()", 60000)

I'm quite sure, yes.

@Michelle: You really think so? ^_^;;

IrPr 01-13-2006 10:10 PM

Quote:

Originally Posted by Sonikku
Code:

                fetch_object('whoisonline').innerHTML = doReqOnline.handler.responseText
                setTimeout("requestWhoOnline()", 60000)

I'm quite sure, yes.

@Michelle: You really think so? ^_^;;

ok Sonikku :)
sorry im newbie in coding

Lea Verou 01-13-2006 10:13 PM

Quote:

Originally Posted by Sonikku
Code:

                fetch_object('whoisonline').innerHTML = doReqOnline.handler.responseText
                setTimeout("requestWhoOnline()", 60000)

I'm quite sure, yes.

@Michelle: You really think so? ^_^;;

You are surely going to be a LOT better than me ;)
Look at my first hack! Only one install and that is mine :p

Brent H 01-13-2006 10:37 PM

Quote:

Originally Posted by Michelle
You are surely going to be a LOT better than me ;)
Look at my first hack! Only one install and that is mine :p

What a great idea :) This is very useful for smaller communities.

If the number changed I'd also install... Great first hack, I'm impressed.

4number8 01-13-2006 11:18 PM

Looks great, I appreciate you sharing this with me, and look foward to seeing more of your releases :)

o0oicebergo0o 01-14-2006 12:43 AM

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... :)

you know what, you need to crawl back into the hole that you came out of. Just becuase a hack is released dosen't mean that it should be automatically accepted as something positive. I'm giving constructive knowledge, a lot of newbies see these mods, run and install them... only finding out a day later that their hosting provider has canceled their account. What these types of mods need when released are ethical warnings, a disclaimer of sort for those who don't understand what cpu & memory server load is, or what ssh is, etc. sigh, basically giving the NEGATIVE effects of these modifications along with their positives. It's only fair :tired:
BTW I have given back to the community, allowing this community to continue to exist by purchasing this thing called a vbulletin licence and giving scientific feedback on modifications for knowledgable and new administrators. Please don't reply to this Mic, you'll only find yourself trapped and lost into a loose loose due to the fact that i'm not interested in this discussion anymore after this last smiliey face :) Now, on to Ruby Tuesday's :)

IrPr 01-14-2006 03:23 AM

any way to put this on vBA Online Users Block ???

EasyTarget 01-14-2006 04:55 AM

way to 'get the last word in' iceberg, you sure showed her.

Lea Verou 01-14-2006 01:21 PM

Quote:

Originally Posted by o0oicebergo0o
you know what, you need to crawl back into the hole that you came out of. Just becuase a hack is released dosen't mean that it should be automatically accepted as something positive. I'm giving constructive knowledge, a lot of newbies see these mods, run and install them... only finding out a day later that their hosting provider has canceled their account. What these types of mods need when released are ethical warnings, a disclaimer of sort for those who don't understand what cpu & memory server load is, or what ssh is, etc. sigh, basically giving the NEGATIVE effects of these modifications along with their positives. It's only fair :tired:
BTW I have given back to the community, allowing this community to continue to exist by purchasing this thing called a vbulletin licence and giving scientific feedback on modifications for knowledgable and new administrators. Please don't reply to this Mic, you'll only find yourself trapped and lost into a loose loose due to the fact that i'm not interested in this discussion anymore after this last smiliey face :) Now, on to Ruby Tuesday's :)

Ok, drowl on to your fantasy but when you wake up please be a little more realistic.
I didn't came out of any hole but I can understand you are judging from your own experiences.
And I will reply, if you are not interested in this disscussion do not read it. If you do reply, which will mean you read it you will prove that you are, indeed, interested in the disscussion.
Purchasing vBulletin is not giving back to this community. It's giving back to Jelsoft. You know, the coders here aren't paid or anything sp they don't benefit from your money, or anyone's money in here. Nope, you haven't given back. Discouraging new coders with stating what has already been said is not something that benefits either the hacker or the people who are going to install. 99SIVTEC's first message was enough, there was absolutely no need for your comments. You have a very big ego and that's not good for anyone here.
These newbies have small forums and CAN install this. If they have big enough forums for their account to be suspended because of this, trust me, they know these things. ;)

o0oicebergo0o 01-14-2006 03:02 PM

Quote:

Originally Posted by Michelle
Ok, drowl on to your fantasy but when you wake up please be a little more realistic.
I didn't came out of any hole but I can understand you are judging from your own experiences.
And I will reply, if you are not interested in this disscussion do not read it. If you do reply, which will mean you read it you will prove that you are, indeed, interested in the disscussion.
Purchasing vBulletin is not giving back to this community. It's giving back to Jelsoft. You know, the coders here aren't paid or anything sp they don't benefit from your money, or anyone's money in here. Nope, you haven't given back. Discouraging new coders with stating what has already been said is not something that benefits either the hacker or the people who are going to install. 99SIVTEC's first message was enough, there was absolutely no need for your comments. You have a very big ego and that's not good for anyone here.
These newbies have small forums and CAN install this. If they have big enough forums for their account to be suspended because of this, trust me, they know these things. ;)

That's funny that nonthing you said about anything is true, please stop talking to me, I think it's called harassment and i'll be giving back to the community by having you muted. God bless.

Borgs8472 01-14-2006 03:11 PM

Hey Sonikku, could you maybe do this with the 'who's online' or somehow shunt this to another page?

It might be fun to watch the online/offline page as people join and leave, however if everyone who's visiting the forum home is doing it, it's too much IMO.

Lea Verou 01-14-2006 05:13 PM

Quote:

Originally Posted by o0oicebergo0o
That's funny that nonthing you said about anything is true, please stop talking to me, I think it's called harassment and i'll be giving back to the community by having you muted. God bless.

How old are you? 14? Geez! :rolleyes:

o0oicebergo0o 01-14-2006 06:26 PM

Quote:

Originally Posted by Michelle
How old are you? 14? Geez! :rolleyes:

i'm 21 and you need to mind your own business woman, god
now you want to come, try to joke, and say "14"
simply annoying, and that's the number one reason why you don't have a real man in your life :)
stop talking to me woman lol got knit a sock


All times are GMT. The time now is 04:31 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
  • Page Generation 0.01415 seconds
  • Memory Usage 1,850KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (11)bbcode_code_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete