PDA

View Full Version : AJAX: Show Users Browsing Threads & Replying


Jafo232
05 Dec 2007, 05:39
This mod will replace the current "Currently Active Users Viewing This Thread" box in threads to an identical one that uses AJAX.. With this method, you can see users viewing the thread in real time (without refreshing) and also see when a user is replying.

By default, it updates every 10 seconds, but you can change that by editing the template code.

Enjoy!

http://www.worldwidecreations.com/install.gifPlease Click Install!http://www.worldwidecreations.com/install.gif (http://www.vbulletin.org/forum/vborg_miscactions.php?do=installhack&threadid=164369)

Brought To You By WorldWideCreations.com (http://www.worldwidecreations.com).

soulface
05 Dec 2007, 05:41
nice hack!

jaycob
05 Dec 2007, 05:45
very good :) thx

projectego
05 Dec 2007, 12:11
/me clicks install :)

SuperTaz
05 Dec 2007, 12:46
Installed. Thank you.

yahoooh
05 Dec 2007, 16:33
how many query?

Jafo232
05 Dec 2007, 16:41
how many query?

There is one query per instance, well, on top of whatever queries go into global.php and fetching templates (if they are not cached)..

Jafo232
05 Dec 2007, 19:03
For those of you who said thanks.. Your welcome! :)

FreshFroot
05 Dec 2007, 19:09
There is one query per instance, well, on top of whatever queries go into global.php and fetching templates (if they are not cached)..
I like the hack idea, but for shared hosting it maybe a lot of queries and cause a large server load.

Jafo232
05 Dec 2007, 19:12
I like the hack idea, but for shared hosting it maybe a lot of queries and cause a large server load.

I have been following it on a couple busy sites and haven't noticed too much of a hit. Restricting "Show Users Browsing Threads" to members only is probably a prudent thing to do. You can also up the timeout in the javascript for fewer calls.

danward
05 Dec 2007, 19:59
How do I make it work with 3.6.4? :)

osousous
05 Dec 2007, 20:07
I really like this - thank you.

If I might suggest a decent extension to this, something In saw in a blog comment section the other day (a paticuarly busy blog comment page).

It basically showed at the bottom in real time - the number of replys that had been made to the comment page since I have started reading it (i.e. in real time).

Jafo232
05 Dec 2007, 20:23
How do I make it work with 3.6.4? :)

Well, I don't currently have any 3.6.4 versions running, but I would imagine it should work with little to no editing.

Chachacha
06 Dec 2007, 05:41
Well, I don't currently have any 3.6.4 versions running, but I would imagine it should work with little to no editing.

I've just installed this on my 3.6.4 board and it is working. Great add-on. Thanks.

Lizard King
06 Dec 2007, 11:59
Did you made tests regarding server load about this mod ? Even the original version had bad effects on server load and i can't imagine it with Ajax. It may totally kill your server.

asj
06 Dec 2007, 13:33
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


replaced
:rolleyes:

Jafo232
06 Dec 2007, 16:15
Did you made tests regarding server load about this mod ? Even the original version had bad effects on server load and i can't imagine it with Ajax. It may totally kill your server.

Yes..

I have been following it on a couple busy sites and haven't noticed too much of a hit. Restricting "Show Users Browsing Threads" to members only is probably a prudent thing to do. You can also up the timeout in the javascript for fewer calls.

Jafo232
06 Dec 2007, 16:25
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


replaced
:rolleyes:

Ok and this is what exactly?

Jafo232
06 Dec 2007, 16:37
Did you made tests regarding server load about this mod ? Even the original version had bad effects on server load and i can't imagine it with Ajax. It may totally kill your server.

Actually I just checked my APC control panel on one server to look at cached hits of scripts to get an idea on how much this file gets called on a moderate site:

forum/includes/init.php: 157227

forum/inlineonline.php: 12643

So basically, the amount of times VB has been activated so far today (APC was reset early this morning) 157,227, out of all of those executions, only 12,643 were member calls to the product script. Considering the non-ajax version would have also made some calls (no way with APC to figure out the difference) I see the load as negligible compared to the benefit. It should be noted that the forum in question restricts this feature to members only.

Hornstar
09 Dec 2007, 05:08
If my server was not lagging, I would love to install this :/ guess i'll have to wait until I can get my server correctly optimized or upgraded again. Thanks for sharing.

UltraFanatics
09 Dec 2007, 13:48
I've done this mod but I accidently done all the copying before I put the .php file on my server (eeeek doh!)

Will this still work as im not sure its working or not? can anyone help?

site is http://www.ultrafanatics.com

UltraFanatics
09 Dec 2007, 14:10
Cant seem to see it working on my site :(

Can anyone help as Ive re-done it again!

BigDog56
09 Dec 2007, 14:16
Thank you very much!

UltraFanatics
09 Dec 2007, 14:38
Ive got it working for forum display but not thread display!

Any ideas anyone?

Jafo232
10 Dec 2007, 03:05
Well, if you followed the instructions to the letter, it should NOT work on the forum display. Not sure what kind of editing would even make that a possibility.

Sounds like you missed something in the readme.

Newfarm
10 Dec 2007, 16:19
Is it possible, in any shape or form, to poll the contents of a quick editor (ie. reply or edit) and if it's changing set a user as "replying" ?

I do see how that could cause some serious server strains though, but most people tend to use the quick reply when replying to threads :)

Great hack either way.

Jafo232
10 Dec 2007, 17:05
Is it possible, in any shape or form, to poll the contents of a quick editor (ie. reply or edit) and if it's changing set a user as "replying" ?


I am sure there probably is a way, however I am just as sure your second thought would be true too, that it would create a little burden on the server to do that..

UltraFanatics
10 Dec 2007, 17:32
PM sent Jafo

Jafo232
10 Dec 2007, 18:35
Not really accepting IM's at this time..

UltraFanatics
10 Dec 2007, 18:40
Oh ok mate, I just wondered if you could check this mod on my server for me.

Seems really strange as its working for each forums not threads.

Take a look http://www.ultrafanatics.com

Jafo232
10 Dec 2007, 19:05
Did you follow the directions in the Readme where it says:

AdminCP > vBulletin Options > Thread Display Options (showthread) > Show Users Browsing Threads

Make sure this is NOT set to no.

UltraFanatics
11 Dec 2007, 18:30
Yep I made sure of that mate, which was why I thought "Ill try it for forum display options" too.

When I done that it worked for that! (but not threads)

Jafo232
11 Dec 2007, 19:35
Ok, this hack has NOTHING to do with forum display.. That feature is built in to vbulletin.

I can only assume you have either incorrectly edited the templates, or have edited templates for a style you are not using..

skariko
12 Dec 2007, 15:57
Hello,
just for the record i'd like to notice everyone this mod will cause a huge load on your server. On my dedicated box (VBulletin forum with average 500 users online) it has increased the server load by roughly a 200% factor (from 0.5 to over 1.5 ...) causing 1.500.000 hits in just 2 days. If you care about performances that's just crazy, especially if you're on a shared account and/or your server is near their performance limits.

So be careful. No offence meant to the coder, but i felt right to warn about the huge resource usage of this mod.

Greetings.

Jafo232
12 Dec 2007, 16:36
If you leave the mod open to the public, surely it could have a negative impact, which is why this feature should be restricted to MEMBERS ONLY as stated earlier.

Alfa1
12 Dec 2007, 22:35
That's too bad. This is a very nice hack, but performance is important to me.

Jafo232
13 Dec 2007, 00:49
That's too bad. This is a very nice hack, but performance is important to me.

As I stated before, under most circumstances, performance isn't an issue.

I have an old PC that has less than 300mb RAM, running on a very old pentium chip with two sites on it that get moderate traffic. There has been no substantial hit on performance.

Alfa1
13 Dec 2007, 17:53
I just moved servers, since my site was running 300% continuously.
Can I activate this hack for certain member groups only?

Jafo232
13 Dec 2007, 18:24
Yes, just like you do with the non-ajax version..

UltraFanatics
13 Dec 2007, 18:37
I think ill delete this mod now, can't seem to get it working.

Thanks though, looks a great mod!

Alfa1
13 Dec 2007, 19:05
Where do you adjust the setting 'Show Users Browsing Threads'?

UltraFanatics
13 Dec 2007, 19:28
Admin control panel mate in VB

Alfa1
13 Dec 2007, 19:32
I figured it that far.

I see that it is in adminCP -> vbulletin options -> thread display options

But i see no possibility there to adjust the setting per user group. How and where can I set this?

Jafo232
15 Dec 2007, 21:55
You cannot set it via usergroups, but you can limit access to members only.

Alfa1
16 Dec 2007, 05:03
That is too bad. Please consider adding usergroup permissions.

Jafo232
16 Dec 2007, 09:17
Not up to me, bring it up with Jelsoft....

Alfa1
20 Jan 2008, 16:59
What would happen if I would alter showthread so that instead of replacing the code like instructed, I would add something along the lines of:
<if condition="is_member_of($bbuserinfo,4,5,6,7)">[Jafo's code]<else />[original code]</if>

Would that cause problems?

Alfa1
20 Jan 2008, 22:26
I just placed your code between


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


And now only member groups of my choice can see users browsing a thread.

So my code is:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Jafo232
21 Jan 2008, 13:00
I don't see any reason why it wouldn't work.

Alfa1
21 Jan 2008, 15:57
Seems to work fine.

This function doesn't seem to register when someone uses the back button to navigate.

Alfa1
22 Jan 2008, 00:50
This function would really be handy when it would be on newreply.php as well. That way you would be able to see if others are replying at the same time as you.

Is it possible to add this?

My members really like this hack. They are requesting a function to find the thread with the most members in it. If they would have this then they would be able to see hot threads developing in real time. It would change the browsing experience.

Alfa1
04 Feb 2008, 08:43
Members that use opera of Firefox experience their browser freezing for some moments.

SwollenCranium
13 Mar 2008, 04:35
Update for 3.7 would be much appreciated.

** never mind .. seems to work fine in 3.7b6 **

Jafo232
18 Mar 2008, 14:37
Don't see why it wouldn't, but I for one will not modify any plugin for a beta. When it is released, then I will worry about it.

forumbust
24 Mar 2008, 15:42
Hi,

I have installed it and i didn't see it appearing in the forum. Where is it located? I wonder if i have installed wrongly. i follow the instruction accordingly.

forumbust
24 Mar 2008, 18:42
This is in the documentation of this mod:

Go to the Vbulletin admincp -> Style Manager. Select your style, and in the dropdown box next to it, choose "Add New Template". (if you have multiple styles, you will need to do this multiple times).

I do not understand the part on multiple styles and do this multiple times. I just pull down the menu and click add new template.

Anyone care to enlighten me on this?

I am using ver 3.6.8, they do not have "Your Style". What should i choose instead?

Jafo232
25 Mar 2008, 16:59
The STYLE is the style of the forum you are using. It could be named ANYTHING. Please read your Vbulletin documentation regarding styles.

forumbust
26 Mar 2008, 05:08
i reinstall again and it can't work. nothing show below the thread, so i uninstall again and the old vbulletin default show thread appear.

FF|Skyrider
26 Mar 2008, 09:08
Agreed, it is not working for me either and I installed it correctly.

Jafo232
26 Mar 2008, 16:55
If you installed it correctly, it would work.

FF|Skyrider
26 Mar 2008, 17:12
If you installed it correctly, it would work.
I created the file for both themes we had (to make sure of it), I uploaded the file to the root of the forums, and I overwritten both showthread files on both themes, and it doesn't work.

Jafo232
27 Mar 2008, 15:03
AdminCP > vBulletin Options > Thread Display Options (showthread) > Show Users Browsing Threads

Make sure this is NOT set to no.


And this?

amirlol
29 Mar 2008, 10:14
exelecnt !

and very very thanks

yeku
29 Mar 2008, 15:35
Intalled

thank

Jafo232
29 Mar 2008, 16:37
Your very very welcome. :)

Jafo232
30 Mar 2008, 16:30
So I am assuming you figured it out?

pedroenf
31 Mar 2008, 16:53
I've installed this mod and had unninstall it. It raised my server load almost 6.00. When with the same members number, without the mod, load remais at 1.00 or 2.00. Thanks anyway.

Alfa1
01 Apr 2008, 10:55
I think this mod is good if you only enable it for a select number of members.

Toxist
15 Sep 2008, 13:42
Uninstalled

Alfa1
10 Feb 2009, 20:07
I don't see why it shouldn't work with 3.8.

Alfa1
05 Oct 2010, 09:11
This process is quite server intensive. Even when enabling it for a very limited number of users, it is still near the top resource process. It takes up 630MB and 888.032 hits monthly.
My members really like this function. They are even willing to donate for its use.
Isn't there a more effective way to do this?