PDA

View Full Version : Show Thread Enhancements - AJAX: Show Users Browsing Threads & Replying


Jafo232
12-04-2007, 10:00 PM
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!

https://vborg.vbsupport.ru/Please Click Install!https://vborg.vbsupport.ru/ (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=164369)

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

soulface
12-05-2007, 04:41 AM
nice hack!

ShawneyJ
12-05-2007, 04:45 AM
very good :) thx

projectego
12-05-2007, 11:11 AM
* projectego clicks install :)

SuperTaz
12-05-2007, 11:46 AM
Installed. Thank you.

yahoooh
12-05-2007, 03:33 PM
how many query?

Jafo232
12-05-2007, 03:41 PM
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
12-05-2007, 06:03 PM
For those of you who said thanks.. Your welcome! :)

FreshFroot
12-05-2007, 06:09 PM
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
12-05-2007, 06:12 PM
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
12-05-2007, 06:59 PM
How do I make it work with 3.6.4? :)

osousous
12-05-2007, 07:07 PM
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
12-05-2007, 07:23 PM
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
12-06-2007, 04:41 AM
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
12-06-2007, 10:59 AM
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
12-06-2007, 12:33 PM
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle]</title>
</head>
<body>
$header
$navbar
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat" colspan="2">
<phrase 1="$totalonline" 2="$numberregistered" 3="$numberguest">$vbphrase[users_viewing_this_thread_x_y_z]</phrase>
</td>
</tr>
<tr>
<td class="alt1" colspan="2">
<span class="smallfont">$activeusers</span>
</td>
</tr>
</table>
$footer
</body>
</html>
replaced
:rolleyes:

Jafo232
12-06-2007, 03:15 PM
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
12-06-2007, 03:25 PM
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle]</title>
</head>
<body>
$header
$navbar
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat" colspan="2">
<phrase 1="$totalonline" 2="$numberregistered" 3="$numberguest">$vbphrase[users_viewing_this_thread_x_y_z]</phrase>
</td>
</tr>
<tr>
<td class="alt1" colspan="2">
<span class="smallfont">$activeusers</span>
</td>
</tr>
</table>
$footer
</body>
</html>
replaced
:rolleyes:

Ok and this is what exactly?

Jafo232
12-06-2007, 03:37 PM
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
12-09-2007, 04:08 AM
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
12-09-2007, 12:48 PM
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
12-09-2007, 01:10 PM
Cant seem to see it working on my site :(

Can anyone help as Ive re-done it again!

BigDog56
12-09-2007, 01:16 PM
Thank you very much!

UltraFanatics
12-09-2007, 01:38 PM
Ive got it working for forum display but not thread display!

Any ideas anyone?

Jafo232
12-10-2007, 02:05 AM
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
12-10-2007, 03:19 PM
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
12-10-2007, 04:05 PM
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
12-10-2007, 04:32 PM
PM sent Jafo

Jafo232
12-10-2007, 05:35 PM
Not really accepting IM's at this time..

UltraFanatics
12-10-2007, 05:40 PM
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
12-10-2007, 06:05 PM
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
12-11-2007, 05:30 PM
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
12-11-2007, 06:35 PM
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-12-2007, 02:57 PM
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-12-2007, 03:36 PM
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-12-2007, 09:35 PM
That's too bad. This is a very nice hack, but performance is important to me.

Jafo232
12-12-2007, 11:49 PM
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
12-13-2007, 04:53 PM
I just moved servers, since my site was running 300% continuously.
Can I activate this hack for certain member groups only?

Jafo232
12-13-2007, 05:24 PM
Yes, just like you do with the non-ajax version..

UltraFanatics
12-13-2007, 05:37 PM
I think ill delete this mod now, can't seem to get it working.

Thanks though, looks a great mod!

Alfa1
12-13-2007, 06:05 PM
Where do you adjust the setting 'Show Users Browsing Threads'?

UltraFanatics
12-13-2007, 06:28 PM
Admin control panel mate in VB

Alfa1
12-13-2007, 06:32 PM
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
12-15-2007, 08:55 PM
You cannot set it via usergroups, but you can limit access to members only.

Alfa1
12-16-2007, 04:03 AM
That is too bad. Please consider adding usergroup permissions.

Jafo232
12-16-2007, 08:17 AM
Not up to me, bring it up with Jelsoft....

Alfa1
01-20-2008, 03:59 PM
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
01-20-2008, 09:26 PM
I just placed your code between
<if condition="is_member_of($bbuserinfo,4,5,6,7)">[Jafo's code]</if>
And now only member groups of my choice can see users browsing a thread.

So my code is:
<!-- currently active users -->
<if condition="$show['activeusers']">

<if condition="is_member_of($bbuserinfo,23,5,6,7)">
<div id='inlineonline' name='inlineonline'></div>

<script>

function getFile(url) {
if (window.XMLHttpRequest) {
AJAX=new XMLHttpRequest();
} else {
AJAX=new ActiveXObject("Microsoft.XMLHTTP");
}
if (AJAX) {
AJAX.open("GET", url, false);
AJAX.send(null);
return AJAX.responseText;
} else {
return false;
}
}

function changeInlineOnline () {

var f = getFile('$vboptions[bburl]/inlineonline.php?t=$threadid' + '&nocache=' + (5 * Math.random() * 1.33));

document.getElementById('inlineonline').innerHTML = f;

setTimeout("changeInlineOnline()", 10000);
}

changeInlineOnline();

</script>
</if>
</if>
<!-- end currently active users -->

Jafo232
01-21-2008, 12:00 PM
I don't see any reason why it wouldn't work.

Alfa1
01-21-2008, 02:57 PM
Seems to work fine.

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

Alfa1
01-21-2008, 11:50 PM
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
02-04-2008, 07:43 AM
Members that use opera of Firefox experience their browser freezing for some moments.

SwollenCranium
03-13-2008, 03:35 AM
Update for 3.7 would be much appreciated.

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

Jafo232
03-18-2008, 01:37 PM
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
03-24-2008, 02:42 PM
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
03-24-2008, 05:42 PM
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
03-25-2008, 03:59 PM
The STYLE is the style of the forum you are using. It could be named ANYTHING. Please read your Vbulletin documentation regarding styles.

forumbust
03-26-2008, 04:08 AM
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.

Skyrider
03-26-2008, 08:08 AM
Agreed, it is not working for me either and I installed it correctly.

Jafo232
03-26-2008, 03:55 PM
If you installed it correctly, it would work.

Skyrider
03-26-2008, 04:12 PM
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
03-27-2008, 02:03 PM
AdminCP > vBulletin Options > Thread Display Options (showthread) > Show Users Browsing Threads

Make sure this is NOT set to no.


And this?

amirlol
03-29-2008, 09:14 AM
exelecnt !

and very very thanks

yeku
03-29-2008, 02:35 PM
Intalled

thank

Jafo232
03-29-2008, 03:37 PM
Your very very welcome. :)

Jafo232
03-30-2008, 03:30 PM
So I am assuming you figured it out?

pedroenf
03-31-2008, 03:53 PM
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
04-01-2008, 09:55 AM
I think this mod is good if you only enable it for a select number of members.

Toxist
09-15-2008, 12:42 PM
Uninstalled

Alfa1
02-10-2009, 07:07 PM
I don't see why it shouldn't work with 3.8.

Alfa1
10-05-2010, 08:11 AM
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?

emath
05-09-2013, 08:48 AM
is there any chance that this mod could be upgraded to be compatible with vb4 ?