View Full Version : # of users in forum on forumhome
Ok here it is.. I have seen a few requests for it... so here it is.
Info:
What it does is show the number users in a forums on your forum home / main page.
Install Info:
2 File Adds
6 template edits
Thats it. I will post images below if you need an idea of what it looks like :)
Here is the new version of it. " Thanks Chen :bunny: "
The first file will be posted below it you need to unistall or would like to use it O__O
JulianD
04-29-2002, 08:50 AM
Thanks for sharing neo! Nice hack!
Erwin
04-29-2002, 10:06 AM
Thanks neo - I modified it so that I can show how many users are using a particular forum in the header of every page - My java chat is actually a forum on my site, and this is what I've been looking for to show who's chatting. :)
Admin
04-29-2002, 11:26 AM
This adds another query for each forum you have... ouch.
Admin
04-29-2002, 11:54 AM
This is how I did it, only adds one query to the index page and the query is quite fast as well.
I added this somewhere:
// Users browsing each forum
$getforumbrowsers = $DB_site->query('
SELECT COUNT(*) AS count, inforum
FROM user
WHERE lastactivity>'.($ourtimenow - $cookietimeout).'
AND lastvisit<>lastactivity
GROUP BY inforum
');
$forumbrowsers = array();
while ($getforumbrowser = $DB_site->fetch_array($getforumbrowsers)) {
$forumbrowsers[$getforumbrowser['inforum']] = $getforumbrowser['count'];
}
Then stuck this inside the makeforumbit() function:
global $forumbrowsers;
$browsers = $forumbrowsers[$forum['forumid']];
if (intval($browsers) < 1) {
$browsers = 0;
}
Then used $browsers in the template.
SWFans.net
04-29-2002, 01:42 PM
Originally posted by FireFly
I added this somewhere:
// Users browsing each forum
$getforumbrowsers = $DB_site->query('
SELECT COUNT(*) AS count, inforum
FROM user
WHERE lastactivity>'.($ourtimenow - $cookietimeout).'
AND lastvisit<>lastactivity
GROUP BY inforum
');
$forumbrowsers = array();
while ($getforumbrowser = $DB_site->fetch_array($getforumbrowsers)) {
$forumbrowsers[$getforumbrowser['inforum']] = $getforumbrowser['count'];
}I tried it in several places in index.php withno luck, does it need to be in forumdisplay.php as well?
Admin
04-29-2002, 01:47 PM
No, just index.php.
SWFans.net
04-29-2002, 01:49 PM
Alright, thanks. :)
KuraFire
04-29-2002, 04:01 PM
Thanks Neo, for the idea, and thanks FireFly, for the less server-killing improvement. *hits install button*
Cool Firefly thanks for the insight :)
Old File :
Floris
04-29-2002, 08:57 PM
Nice addition, when I install it next month, then I will add it to the board description though :) Saves me another column in the design.
Twig Deez
04-29-2002, 10:48 PM
hey. groovy!
i put it in my forum description too, tho; right after the forum title.
i dunno, i'll fiddle around with the location a bit in a while.
nice work, neo/firefly! :)
Crazy Mofo
04-29-2002, 10:49 PM
Uh i can't find this :(
In forumhome or where it might be find #####
<td bgcolor="{tableheadbgcolor}"><smallfont color="{tableheadtextcolor}"><b>Threads</b></smallfont></td>
##### And place this under it ( you can place edit this to format your site) #####
<td bgcolor="{tableheadbgcolor}"><smallfont color="{tableheadtextcolor}"><b>Users Viewing</b></smallfont></td>
it might also be in forumhome_forumbit_level1_nopost
Erwin
04-30-2002, 12:42 AM
Originally posted by FireFly
This is how I did it, only adds one query to the index page and the query is quite fast as well.
I added this somewhere:
// Users browsing each forum
$getforumbrowsers = $DB_site->query('
SELECT COUNT(*) AS count, inforum
FROM user
WHERE lastactivity>'.($ourtimenow - $cookietimeout).'
AND lastvisit<>lastactivity
GROUP BY inforum
');
$forumbrowsers = array();
while ($getforumbrowser = $DB_site->fetch_array($getforumbrowsers)) {
$forumbrowsers[$getforumbrowser['inforum']] = $getforumbrowser['count'];
}
Then stuck this inside the makeforumbit() function:
global $forumbrowsers;
$browsers = $forumbrowsers[$forum['forumid']];
if (intval($browsers) < 1) {
$browsers = 0;
}
Then used $browsers in the template.
Chen,
I tried your code in my index.php and all I see is "0" for the $browser value in all my forums. I am fairly sure I've put the code in the right place.
If you don't mind, I will PM you my index.php for your perusal, to see if everything is in the right place.
Crazy Mofo
04-30-2002, 01:03 AM
Erwin which template did u put $browsers in?
verify you have added the code to forumdisplay.php
Erwin
04-30-2002, 01:08 AM
I moved the second bit of code around a bit, and it works now. Basically you cannot just put the makeforumbits code anywhere in that function. You need to place it exactly where neo said in his text file. Sorry to bother all of you. :)
Nice hack Firefly and Neo.
Crazy Mofo
04-30-2002, 01:11 AM
well can u share it with me :D from da begining ;)
grrrrrrrrrrrreat hack!! thanks neo and firefly.
i made a little mod to it and place also a link to online users.. for now. i plan to extend the online users, per forum not global the way it is now, in VB.
for now i use this link:<a href="online.php?s=$session[sessionhash]" title="$activeusers Viewers In $forum[title]">$activeusers Active Users</a>here it is a graphic example...
Crazy Mofo
04-30-2002, 01:16 AM
nice but still i aint got it working :( can some1 make a new installatino txt file the latest one?
the install readme file on the first post is reliable. follow the instructions posted there.
Crazy Mofo
04-30-2002, 01:30 AM
ah oki....
is that the one that vb.org is using here?
Originally posted by Crazy Mofo
is that the one that vb.org is using here? what difference does it makes? i'm sure firefly have his own code for all the hacks he installed here.. he gets the idea and after he "devellop" it.. ;)
the important thing is that the code above works great. :D
let us know how your install went... if you need any help, post it here and we will give you a hand.
Crazy Mofo
04-30-2002, 01:56 AM
Ok thx and sorry for being a newbie :cry: :ermm:
Originally posted by Crazy Mofo
Ok thx and sorry for being a newbie :cry: :ermm: nobody is a newbie here.. we are all toghether to help eachothers.. :D
dont worry and dont feel shy to ask...
Crazy Mofo
04-30-2002, 02:20 AM
should there be a 0 showing up if no1 is browsing?
how would i do a LEFT JOIN to include also the guests?
Originally posted by Crazy Mofo
should there be a 0 showing up if no1 is browsing? yes
Crazy Mofo
04-30-2002, 02:28 AM
o dear i have a problem :/
what is the prob? let us know...
Crazy Mofo
04-30-2002, 02:31 AM
can i send some1 my index and forumdisplay too av a look at?
Crazy Mofo
04-30-2002, 02:32 AM
well nuttin shows up atall no numbers etc.. i actully got the bar too show though thx too you nakkid :D
Crazy Mofo
04-30-2002, 02:36 AM
heres the pic
let's recap toghther crazy.. do this:
in index.php find:// Start makeforumbit
ABOVE this, add:// users browsing each forum
$getforumbrowsers=$DB_site->query('SELECT COUNT(*) AS count,inforum
FROM user
WHERE lastactivity>'.($ourtimenow-$cookietimeout).'
AND lastvisit<>lastactivity
GROUP BY inforum');
$forumbrowsers=array();
while ($getforumbrowser=$DB_site->fetch_array($getforumbrowsers)) {
$forumbrowsers[$getforumbrowser['inforum']]=$getforumbrowser['count'];
}still in index.php, find: if ($forum['cancontainthreads']==1) {
$tempext = '_post';
} else {
$tempext = '_nopost';
}BELOW this, add: global $forumbrowsers;
$count=$forumbrowsers[$forum['forumid']];
if (intval($count)<1) {
$count=0;
}now, in forumdisplay_forumbit_level1_post and forumdisplay_forumbit_level2_post find: <td bgcolor="#F1F1F1"><normalfont>$forum[threadcount]</normalfont></td>BELOW, add this: <td bgcolor="#F1F1F1"><normalfont>$count</normalfont></td>that should do it... let us know if everything is ok.
neo (should i say firefly? ;))... please make me happy and add that LEFT JOIN.. actually can anyone tell me if it will bring the server to it's knees if i do this? add also the guests into it?
here what i did:$getforumbrowsers=$DB_site->query('SELECT COUNT(*) AS count,inforum
FROM user
LEFT JOIN session ON (what do i put here?)
WHERE lastactivity>'.($ourtimenow-$cookietimeout).'
AND lastvisit<>lastactivity
GROUP BY inforum');i guess i have to add a inforum field in the session table... do i have to index it also?
Crazy Mofo
04-30-2002, 02:57 AM
Originally posted by nakkid
let's recap toghther crazy.. now, in that should do it... let us know if everything is ok.
OMG it worked woohooo i love you man :D :bunny:
Crazy Mofo
04-30-2002, 03:01 AM
really graet hack thx :)
Erwin
04-30-2002, 04:00 AM
Yeah, including guests would be a great addition... :)
inetd
04-30-2002, 04:57 AM
FireFly, please post how to put number of users in forumhome near forum[title]. Please.
Originally posted by inetd
FireFly, please post how to put number of users in forumhome near forum[title]. Please. I just used this: - <smallfont>($browsers members browsing)</smallfont>after the </a> following the forum title in forumhome_forumbit_level2_post.
i noticed a little bug in the hack. if i browse a forum and i go back to the forumhome, it still shows that i'm browsing that forum... this is present here at vB.org also. try this. go to an empty forum (0 users browsing), then click on [vBulletin.org Forum >] navigation link at the top. it will still show that you are there. if you refresh the page it goes away... any way to fix this?
thanks.
PS. i still think of a issue to that LEFT JOIN for guests, that i asked earlier in that thread... but i cant index it, i get a database error...
Admin
04-30-2002, 07:22 AM
That's a bug in vBulletin, not this hack.
To fix it, add a call to updateuserforum() in index.php like this:
updateuserforum(0);
eval("dooutput(\"".gettemplate('forumhome')."\");");
Of course it will only be updated next time you load the index page.
KuraFire
04-30-2002, 09:13 AM
What am I doing wrong, I still get a separate query for each forum I have, but I followed FireFly's instructions only, not Neo's.... :/
66 queries on index page.. :'(
thanks firefly. do you think is a good idea to add the guests to the list of browsers?
Admin
04-30-2002, 12:46 PM
You cannot.
Chris M
04-30-2002, 04:28 PM
Hmmm...
Twould be interesting to say the least...
* Chris M nods profusely...
/me's alter-ego concurs...
:D
Satan
Crazy Mofo
04-30-2002, 04:36 PM
how would one align it too the right next too the posts?
firefly, can i ask you to explain to me why i cannot index twice the same field (on 2 different tables) in database? i tried to add inforum to session and used also INDEX (inforum) but i get a database error.
i saw that you cannot LEFT JOIN session. let me know where i go wrong. if i have a inforum field in session, i could do a LEFT JOIN session and include also the guests that browse the specific forum (in theory?)...
i would like to understand a little more the mystery of LEFT JOINs to other tables. it's clear to me the mechanism of associating 2 tables info.. let me know if i should start a thread related to this in General Hacking Discussion. thanks.
Boofo
04-30-2002, 07:15 PM
Neo,
How many places and where do I need to change the colspan from 6 to 7 to have the top bar show right after I add this hack? Thanks in advance.
That is a template edit inetd and I will take a look into the LEFT JOIN nakkid... I am very busy today O_O
Boofo
04-30-2002, 10:29 PM
Firefly,
Where and how would you add this exactly? And could you also put it in the forumdisplay.php or wouldn't it work there?
updateuserforum(0);
eval("dooutput(\"".gettemplate('forumhome')."\");");
It works well for me in forumdisplay.php.. just follow the first instructions I posted.
Boofo
04-30-2002, 11:05 PM
I did follow the instructions in the file to a T. I wasn't sure if I needed to add that code to either of the files Firelfy mentioned. If I do, I have no idea where to add them or how to "call" them as he put it. (Sorry for being a newbie.) :-)
cdcopyworld
05-01-2002, 03:39 AM
Originally posted by FWC
I just used this: - <smallfont>($browsers members browsing)</smallfont>after the </a> following the forum title in forumhome_forumbit_level2_post.
Yep done that and it worked but how do i make the "$browsers members browsing" stay as far right as it can go like here at vb.org.
at the moment at my forum its right next to the forum name like this:
eg:
General Chat (10 members browsing)
i want it like this:
General Chat **********************(10 members browsing)
but without the *'s just a big space so it all stays to the right.
cheers
make a table.. in the left cell you put the title and in the right one the browsers..
Originally posted by cdcopyworld
Yep done that and it worked but how do i make the "$browsers members browsing" stay as far right as it can go like here at vb.org.In forumhome_forumbit_level2_post take the default:<td bgcolor="{ firstaltcolor }" align="left"><a href="forumdisplay.php?s=$session[sessionhash]&forumid=$forum[forumid]">
<normalfont><b>$forum[title]</b></normalfont></a>
<br><smallfont>$forum[description]</smallfont></td>and change it to something like this:<td bgcolor="{ firstaltcolor }">
<table width=100% cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="left">
<a href="forumdisplay.php?s=$session[sessionhash]&forumid=$forum[forumid]"><normalfont><b>$forum[title]</b></normalfont></a></td>
<td width="35%" align="right" valign="top">
<smallfont>($browsers members browsing)</smallfont></td>
</tr>
<td colspan="2">
<smallfont>$forum[description]</smallfont>
</td>
</tr>
</table>
</td>Don't forget to remove the spaces around firstaltcolor.
ZiRu$
05-09-2002, 02:00 AM
how can i have it like firefly has it ONLY! No New Column?
Orlandu
05-09-2002, 04:20 AM
Well Neo, if you don't mind I have a addition to that hack. It will say "1 users" how it is, but I added a little bit and now it will say "1 user" and then "2 users" respectively.
I'll post if, but if you won't allow it then I will remove it.
Instead of add this:
global $forumbrowsers;
$count = $forumbrowsers[$forum['forumid']];
if (intval($count) < 1) {
$count = 0;
}
Add this for the correct term for 1 user:
global $forumbrowsers;
$count = $forumbrowsers[$forum['forumid']];
$s = 's';
if (intval($count) < 1) {
$count = 0;
}
if (intval($count) == 1) {
$s = '';
}
That's in both forumdisplay.php and index.php
Then you have to change the counter to something like this:
($count user$s browsing) in the right template.
Hope you like ;)
ZiRu$
05-12-2002, 09:04 PM
Originally posted by neo
Look Up One Post
do i just install this.....or install the original hack and then that
Warlord
05-14-2002, 05:55 AM
Ummm damn. All I get is grey boxes on the right side of my screen when I add this hack.. Can someone show me what I did wrong?
Warlord
05-14-2002, 06:07 AM
Oh wow.. it worked.. kinda. I just noticed it, because it isn't how vb.org has it set up... but I did end up getting those annoying grey blocks on my page.. how do i get rid of those?
Originally posted by Warlord
Oh wow.. it worked.. kinda. I just noticed it, because it isn't how vb.org has it set up... but I did end up getting those annoying grey blocks on my page.. how do i get rid of those? You need to change forumhome_forumbit_leve1_nopost to <td colspan="7"> for one thing. Same thing with forumhome_loggedinusers.
Warlord
05-14-2002, 06:30 AM
May Jesus have mercy on my soul....
I've attempted to make it look the way vb.org has it and screwed up alot of shi@t
Warlord
05-14-2002, 07:07 AM
Ok, I have some of it fixed...
Question - In subforums, I added the same code as I did for the main page..
<code>
<td bgcolor="{firstaltcolor}">
<table width=100% cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="left">
<a href="forumdisplay.php?s=$session[sessionhash]&forumid=$forum[forumid]"><normalfont><b>$forum[title]</b></normalfont></a></td>
<td width="35%" align="right" valign="top">
<smallfont>($browsers members browsing)</smallfont></td>
</tr>
<td colspan="2">
<smallfont>$forum[description]</smallfont>
</td>
</tr>
</table>
</td>
</code>
But the Members browsing appears exactly right after the forum description, so if the forum has no description, it is almost all the way over to the left.
Also.. none of the forums are picking up any members in them
Take a look and tell me what I'm doing wrong...
http://www.superherochat.com/vb
Orlandu
05-14-2002, 12:43 PM
Did you add the code to index.php and forumdisplay.php? If you don't add that, then it won't work correctly.
Also, if you want it to not add the "s" if there is only one member, then use the code I posted ;)
concept
05-14-2002, 02:33 PM
I'having a problem with my forums thing is i added all the chanegd neo supplyed but only thing is i'm getting an un finished </tr> or </td> somewhere cuz my forums is messed up ....
this is what it looked like now
my forums messed up (http://www.halocraft.com/visuallyinfected/)
i get these grey unclosed tables wtf is up with this can someone tell me what to do
Warlord
05-14-2002, 03:48 PM
Originally posted by Orlandu
Did you add the code to inew.php and forumdisplay.php? If you don't add that, then it won't work correctly.
Also, if you want it to not add the "s" if there is only one member, then use the code I posted ;)
I assume you mean index.php and forumdisplay.php and yes I did add the code...
Got any idea about the second table data not aligning to the right on the first table row with the "forum title" and the "($browsers members browsing)"? It works just fine on then main page, but in the subforums, it aligns both table data's to the left, even though I've specified right.
Warlord
05-14-2002, 04:03 PM
Ok, I figured out why it wasn't counting the users.. it's not $browsers, it supposed to be $count...
Now if I can just get the second table data to align to the right in the subforums...
concept
05-14-2002, 04:32 PM
i looked around iin my templates and i got a friend of mine to work with me on it and we got ti it was innew posts
somewhere
ti was about the colums and stuff
Warlord
05-14-2002, 10:09 PM
Anyone know why it won't align to the right on the sub-forums?
concept
05-15-2002, 12:14 AM
is it doign that to you??? watlord?? thats what it did to me too
lifesourcerec
05-15-2002, 01:03 AM
I have a very minor problem. When adding this, it added an extra column (split the category table into 2 columns instead of 1). The extra column just has a black background. How can I fix this?
Warlord
05-15-2002, 01:29 AM
Originally posted by lifesourcerec
I have a very minor problem. When adding this, it added an extra column (split the category table into 2 columns instead of 1). The extra column just has a black background. How can I fix this?
I had this same problem when I first set it up the way Neo has it... here is the solution, :)
Originally posted by FWC
You need to change forumhome_forumbit_leve1_nopost to <td colspan="7"> for one thing. Same thing with forumhome_loggedinusers.
And yes Concept, it's being rather [better wash my mouth][better wash my mouth][better wash my mouth][better wash my mouth][better wash my mouth]y that way, isn't it? It should work. I've gone over it a million times in my head and can't figure out why it's not working.. :(
lifesourcerec
05-15-2002, 01:42 AM
Fixed! Thanks 2 million :)
Warlord
05-15-2002, 02:32 AM
No problem lifesourcerec, but I was only quoting FWC, he deserves the thanks. ;)
*starts muttering about those [darn-didly-darn] word filters*
Anyone have a solution to concept and my problem about the subforums?
concept
05-15-2002, 03:49 AM
yeah i was just about to post that haha it was set for 6 and i fixed that also....
Originally posted by Warlord
No problem lifesourcerec, but I was only quoting FWC, he deserves the thanks. ;)You're welcome. :)
concept
05-15-2002, 04:32 AM
yeah i never really looked over all the posts i loked aorund with my friend for a long ime tryign to get this code to work hahahaha then we realized the colspan thing
tweak
05-15-2002, 05:10 AM
THANX alot GREAT HACK
lifesourcerec
05-15-2002, 05:31 AM
Originally posted by FWC
You're welcome. :)
U DA MAN!! :)
Warlord
05-15-2002, 05:58 AM
I don't think you guys understand my problem... (either that or I'm not understanding your solution.)
Ok, I have this hack set up the way vbulletin.org has it installed, so that it shows the users browsing a forum in the forum description. On the forumhome page (the main page) i.e.
http://www.superherochat.com/vb
the "(1 user browsing)" etc aligns to the right in the forum description. This is the way I want it.
However when I go into subforums, i.e.
http://www.superherochat.com/vb/forumdisplay.php?forumid=10
the "(1 users browsing)" doesn't align to the right in the forum description. I've used the same code in both instances, why does it not work in the subforums?
Warlord
05-15-2002, 05:16 PM
bump
Warlord
05-16-2002, 08:09 AM
BUMP GODDAMMlT! :p
Ihsahn
05-16-2002, 10:54 AM
Originally posted by Warlord
I don't think you guys understand my problem... (either that or I'm not understanding your solution.)
Ok, I have this hack set up the way vbulletin.org has it installed, so that it shows the users browsing a forum in the forum description. On the forumhome page (the main page) i.e.
http://www.superherochat.com/vb
the "(1 user browsing)" etc aligns to the right in the forum description. This is the way I want it.
However when I go into subforums, i.e.
http://www.superherochat.com/vb/forumdisplay.php?forumid=10
the "(1 users browsing)" doesn't align to the right in the forum description. I've used the same code in both instances, why does it not work in the subforums?
May u share your code for the forumhome ... it doesn't work for me ... pleaze :)
Thx
Ihsahn
Wolf42
05-16-2002, 11:01 AM
Works great, thx neo!
Boofo
05-19-2002, 01:53 AM
FWC,
I had to rework this a little to get it to still have the full box mouse-over, but I figured it out and it works great, thanks!
Now, I know this is a little off topic, but if you can do this, then moving the "Report this Post to Moderator" and "IP Logged" to the bottom of the message box, should be easy for you. :) How about it? :)
Originally posted by FWC
In forumhome_forumbit_level2_post take the default:<td bgcolor="{ firstaltcolor }" align="left"><a href="forumdisplay.php?s=$session[sessionhash]&forumid=$forum[forumid]">
<normalfont><b>$forum[title]</b></normalfont></a>
<br><smallfont>$forum[description]</smallfont></td>and change it to something like this:<td bgcolor="{ firstaltcolor }">
<table width=100% cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="left">
<a href="forumdisplay.php?s=$session[sessionhash]&forumid=$forum[forumid]"><normalfont><b>$forum[title]</b></normalfont></a></td>
<td width="35%" align="right" valign="top">
<smallfont>($browsers members browsing)</smallfont></td>
</tr>
<td colspan="2">
<smallfont>$forum[description]</smallfont>
</td>
</tr>
</table>
</td>Don't forget to remove the spaces around firstaltcolor.
Originally posted by Boofo
Now, I know this is a little off topic, but if you can do this, then moving the "Report this Post to Moderator" and "IP Logged" to the bottom of the message box, should be easy for you. :) How about it? :)
I took the easy way out. I replaced the links with images and moved them to the bottom of the post bit next to the Edit and Quote buttons. :)
Boofo
05-19-2002, 06:02 AM
I know, I thought of doing that myself, but wouldn't it make you feel good just to do it so you can say you did it? (Is any of this working in my favor?) :)
could some pls post an update code to to add ( users browsing )
in the forum like it is at vbulletin.org
thankx for the help :)
desi
Warlord
06-05-2002, 12:18 AM
The template for forumhome_forumbit_level2_post should look like this for it to appear the same way vbulletin.org has it set up...
<tr align="center">
<td bgcolor="{secondaltcolor}" valign="top"><img src="{imagesfolder}/$forum[onoff].gif" border="0" alt=""></td>
<td bgcolor="{firstaltcolor}">
<table width=100% cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="left">
<a href="forumdisplay.php?s=$session[sessionhash]&forumid=$forum[forumid]"><normalfont><b>$forum[title]</b></normalfont></a></td>
<td width="35%" align="right" valign="top">
<smallfont>($count members browsing)</smallfont></td>
</tr>
<td colspan="2">
<smallfont>$forum[description]</smallfont>
</td>
</tr>
</table>
</td>
<td bgcolor="{secondaltcolor}"><normalfont>$forum[replycount]</normalfont></td>
<td bgcolor="{firstaltcolor}"><normalfont>$forum[threadcount]</normalfont></td>
<td bgcolor="{secondaltcolor}"><smallfont>$forum[lastpostinfo]</smallfont></td>
<td bgcolor="{firstaltcolor}"><smallfont>$forum[moderators]</smallfont></td>
</tr>
will try it out right now thankx :)
Boofo
06-05-2002, 05:23 AM
I feel stupid for even asking this, but what template do you edit to have this display in the subforums? I tried to put it in the forumhome_forumbit_level1_post but it didn't show up in the subforums. :nervous:
Originally posted by Warlord
Ok, I have some of it fixed...
Question - In subforums, I added the same code as I did for the main page..
<code>
<td bgcolor="#13486D">
<table width=100% cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="left">
<a href="forumdisplay.php?s=$session[sessionhash]&forumid=$forum[forumid]"><normalfont><b>$forum[title]</b></normalfont></a></td>
<td width="35%" align="right" valign="top">
<smallfont>($browsers members browsing)</smallfont></td>
</tr>
<td colspan="2">
<smallfont>$forum[description]</smallfont>
</td>
</tr>
</table>
</td>
</code>
But the Members browsing appears exactly right after the forum description, so if the forum has no description, it is almost all the way over to the left.
Also.. none of the forums are picking up any members in them
Take a look and tell me what I'm doing wrong...
http://www.superherochat.com/vb
damn my board got all screwed up ..... i got this message after doing the above
Database error in vBulletin 2.2.5:
Invalid SQL: SELECT userid,username
FROM user
WHERE userid<>
AND (usergroupid=5
OR usergroupid=6
OR usergroupid=7
OR usergroupid=2)
ORDER BY RAND()
LIMIT 1
mysql error: You have an error in your SQL syntax near 'AND (usergroupid=5
OR usergroupid=6
' at line 4
mysql error number: 1064
HELP!!!!!!!!!!!!!!!!!!!!
Warlord
06-06-2002, 09:02 AM
For some reason it doesn't work right in the sub-forums. I couldn't tell you why, I tried everything I could think of to make it work, but couldn't so I only have it installed on the main page....
and desi... to fix it, just do the opposite of what you did to cause that error.
Boofo
06-06-2002, 10:25 AM
Chen,
Do you know of a way of doing this on the subforums, too? (If anyone could do it, you could) :)
Originally posted by Warlord
For some reason it doesn't work right in the sub-forums. I couldn't tell you why, I tried everything I could think of to make it work, but couldn't so I only have it installed on the main page....
Wildthinks
06-06-2002, 11:23 AM
is there a possibility to count how many guests are in the forum? I have read the "Left Join", but the query is not complete ...any hints?
Warlord
06-07-2002, 12:26 AM
I believe that was discussed somewhere in this thread (sorry don't know what page). I think it was Firefly who said you can't do it.
And I don't know if you can do the # of users in the subforum listings, as you can see Firefly hasn't done it here at vbulletin.org, and if it were possible I would think he'd be the one who'd know how to do it...
Boofo
06-07-2002, 05:22 AM
Originally posted by Warlord
And I don't know if you can do the # of users in the subforum listings, as you can see Firefly hasn't done it here at vbulletin.org, and if it were possible I would think he'd be the one who'd know how to do it...
That's just what I said above. Just because it isn't done here on vb.org, doesn't mean it can't be done. Firefly doesn't run every hack available here. :)
okay this might have been brought up before, but how can i fix this?!!
Boofo
06-10-2002, 09:58 PM
It was right under your nose all the time. :)
https://vborg.vbsupport.ru/showthread.php?postid=246402#post246402
Originally posted by TaP
okay this might have been brought up before, but how can i fix this?!!
No...its not showing 0 members online...i dont want it to the right, i just want it to say 0...no number is showing up!
Boofo
06-11-2002, 03:20 AM
Next time it might help to explain a little more of what you want, then. And shouting in your message won't get you a lot of help either.
Do you have this as the code in there for getting the number?
$browsers members browsing
Originally posted by TaP
No...its not showing 0 members online...i dont want it to the right, i just want it to say 0...no number is showing up!
bleh...online talk, shouting? i was exaggerating that no number was showing up, but if you took that offensivly :) okey...anyways
here is my forumhome_forumbit_level2_post
<tr align="center">
<td bgcolor="{secondaltcolor}" valign="top"><img src="{imagesfolder}/$forum[onoff].gif" border="0" alt=""></td>
<td bgcolor="{firstaltcolor}" align="left"><a href="forumdisplay.php?s=$session[sessionhash]&forumid=$forum[forumid]"><normalfont><b>$forum[title]</b></normalfont></a>
<br><smallfont>$forum[description]<br><b>Moderated by: $forum[moderators]</b></smallfont> <smallfont>($browsers members browsing)</smallfont> </td>
<td bgcolor="{secondaltcolor}"><normalfont>$forum[replycount]</normalfont></td>
<td bgcolor="{firstaltcolor}"><normalfont>$forum[threadcount]</normalfont></td>
<td bgcolor="{secondaltcolor}"><smallfont>$forum[lastpostinfo]</smallfont></td>
</tr>
Boofo
06-11-2002, 08:38 AM
Did you also install the following hack? It won't work without it. :)
https://vborg.vbsupport.ru/showthread.php?s=&threadid=38012&highlight=number+users+forum+home
Boofo
06-11-2002, 03:21 PM
Well, sir, then you have got me boggled on this one. I would say to re-install the hack and see if maybe you missed something along the way. Sometimes that fixes things. If you are still not seeing it after that, I will take a look at the code you entered for the hack and see if I can figure something out for you. :) Sorry I couldn't be of more help.
Originally posted by TaP
ya...
Felix
06-23-2002, 11:30 AM
I got the same problem (screenshot). I'm using vbb226. Installed the hack without the template modifications and added the template modification to keep the info at the right site, but it doesn't show up an number. Not even 0! The query did run though.
Help is appreciated,
thx :lick:
Felix
06-23-2002, 11:50 AM
Ok I found the error.
DON'T (!) use
$browsers members browsing
instead use:
$count members browsing
Now it should work :D
Boofo
06-23-2002, 12:07 PM
You are exactly right. I just checked my code and that is what I have. I must have changed it somewhere and forgot to notate it. Sorry about the mis-information. I'll double check next time before I post an answer. :)
Originally posted by Felix
Ok I found the error.
DON'T (!) use
$browsers members browsing
instead use:
$count members browsing
Now it should work :D
Mathiau
06-25-2002, 03:48 AM
hey m8, installed and all is well EXCEPT!:
how can i get my tables to extend to the end?
i had this prob with my True Stat area, but fixed it no prob, but i can not seem to get this part fixed.....? HELP!
thnx :D
got it fixed
Mathiau
06-25-2002, 03:48 AM
double post..
Robert9
06-28-2002, 02:56 AM
ok im sorry if i piss anyone off but im lost theres 8 pages with many different codes all i want to do is add this next to chit chat www.ecforums.com/forums go there and see what chit chat is if u dont know, ok i want it to say Chit Chat [new thread] top right corner of that same area i want it to say (# user browsing forum) im so sorry if its been mentioned but i tried alot of different ways that were on here but i cant get it to work maybe if i post this and get new posts after mine i might get something out of it
Guys, I can't get this to work. It always shows "0", no matter what I do. I followed the instructions again and again, read through the whole thread, tried FireFly's code, Neo's code, what Nakkid posted in the "recap" posting - all I get is "0". How do I test? Well, I use a second computer, login as a different user, visit a forum and reload index.php on the first computer. "0"
Help! :)
Hmm ... maybe it doesn't look for the user, but for unique hosts or something?
scottct1
08-22-2002, 04:02 PM
Does this hack show only the regsitered members browsing or does it include guests as well?
If it includes guests I will click install. :)
NTLDR
08-22-2002, 04:05 PM
Only registered members, you have to wait till vB3 for guests ;)
ExcErr
08-27-2002, 05:49 PM
yeah, GUEST ADDON will be very nice...
because i have more guests, than users online........
Tim Wheatley
08-31-2002, 02:26 PM
Is it possible that I could install this so only admins/mods can view the counts?
Hmm, maybe a good idea for a 'x members, y guests viewing forum' style on this hack would be to add a new column to the sessions table and modify admin/sessions.php... In fact, I think I'll mess around with it and try to get it set up like that.
But all in all, this is a pretty dope hack. Looking forward to getting it working later today.
Barret
09-01-2002, 01:49 AM
Clicks install and tries it.
Thanks for the great hack :)
Gohan
09-10-2002, 11:23 AM
Originally posted by Orlandu
Well Neo, if you don't mind I have a addition to that hack. It will say "1 users" how it is, but I added a little bit and now it will say "1 user" and then "2 users" respectively.
I'll post if, but if you won't allow it then I will remove it.
Instead of add this:
global $forumbrowsers;
$count = $forumbrowsers[$forum['forumid']];
if (intval($count) < 1) {
$count = 0;
}
Add this for the correct term for 1 user:
global $forumbrowsers;
$count = $forumbrowsers[$forum['forumid']];
$s = 's';
if (intval($count) < 1) {
$count = 0;
}
if (intval($count) == 1) {
$s = '';
}
That's in both forumdisplay.php and index.php
Then you have to change the counter to something like this:
($count user$s browsing) in the right template.
Hope you like ;)
Better change code ;)
if (intval($count) == 1) {
to:
if (intval($count) == 0 OR intval($count) == 1) {
btw Great hack! also does working on vb 2.2.7
Dan Flynn
09-27-2002, 03:32 AM
This seems like a very easy install. How ever I can't find this
<td bgcolor="#006633"><smallfont color="#FFCC00"><b>Threads</b></smallfont></td> in the forumhome template. You said look there or where it might be find.
Where else could it be. Please Help
Kedmyster
10-05-2002, 05:02 PM
maybe it's a little late but can someone please post the whole code for the ($browsing the forum) - or something like that.
everything is screwed. I did it once but it screwed the forum so I don't want to try it again without having the right instructions.
Thanks.
KaiN6993
11-30-2002, 10:23 PM
works for 2.2.8, is there a way to make it show user id instread of number of users?
MetroSports82
01-07-2003, 03:11 AM
Anyone know how I could set this up, where it would show # of users in thread on forum display? that would be real cool IMO. :) Thanks,
Metro.
Snapperhaed
03-23-2003, 05:14 PM
A great hack, thanks! Got it working on v2.3 #3
Suggestion: There is so much good information in this thread, that it outdates the actual initial posting. Because of that, a newbie (such as myself) can pretty much get lost. (I did but managed to survive, lol) - Maybe someone can update it with what the actual best hack is (and complete (most efficent) hack).
SavgeDusk
03-23-2003, 08:44 PM
I hope Neo doesn't mind me adding a revised version of this hack here. All credit to him, FireFly, & Orlandu for the coding in the revised version. I just take credit for the template edits, because I didn't use the ones posted or in the original file. ^^; I'll add a demo of what it looks like in another post.
Here's the file, I installed it on the vB 2.3.0 Candidate 3 btw. :]
SavgeDusk
03-23-2003, 08:45 PM
And this is what it looks like.
Lethal
03-24-2003, 08:38 PM
I thought firefly said that you only have to edit index.php not both index.php and forumdisplay.php?
SavgeDusk
03-25-2003, 10:29 PM
I had to edit both. I just put all the code from the original hack into the .txt file. I only did it to make things easier since codes were here and there. ^^;
Snapperhaed
03-26-2003, 09:48 PM
SavgeDusk: A fine job, and I thank you for condensing it all into an easily installable format. I was running v2.3.3 under the original hack, but I since used your 'updated file' and made the changes to keep up to date with the latest. Many thanks for making a newbies life worth living!
beardbuster
04-05-2003, 09:06 PM
SavgeDusk..
Fine job THANKS!!!!
mvigod
04-12-2003, 05:54 PM
firefly,
any way to adjust the query so it includes all subforums under the parent forum? In other words if there is a forum on the homepage which containts 5 popular forums and the parent forum is a no posting forum then it shows 0 users browsing that forum leading to the appearance nobody is browsing the 5 forums inside of it when in reality it could be 100's of users.
Kriek
07-19-2003, 06:04 PM
/me hits install
Flawless on 2.3.0 including sub-forums.
(vBulletin.org style)
K33nny
08-17-2003, 08:16 AM
This is a modified version of Neo and FireFly's "# of users on forumhome". This hack uses templates to control certain aspects of it. It likely resembles the version Jelsoft used with vBulletin 3 but seeing as how I haven't even downloaded it yet I decided to accomplish the same with vBulletin 2.
. If there is 1 user browsing, you can have it say "1 user" instead of "1 users"
. If there are 0 users browsing, nothing will show up at all.
Note: It does not currently work for sub-forums as far as I can tell, I am looking into that to see if I can figure out to do that.
Example: http://www.ewplanet.org/e/index.php?s=
NOTE: If you find this hack useful and plan on using it, click install.
[v 1.1 fixes]
+ Added templates to $templatesused to save 1 query.
++ Thanks to Mist & Alien for the suggestion.
+ Added forumdisplay_nobrowsers template just incase people want to display something for 0 users browsing.
++ Thanks to MadCat75 for the suggestion.
[v 1.2 fixes]
+ Changed $browsers variable to $numbrowsers variable in template forumdisplay_nobrowsers
++ Thanks to MadCat75 for the alert.
[v 1.3 fixes]
+ Changed $numbrowsers variable back to $browsers in template forumdisplay_nobrowser.
++ Got confused with one users question and made the wrong choice.
[v 1.4 fixes]
+ Assigned 0 to the variable $browsers if there were no users browsing.
K33nny
08-17-2003, 08:20 AM
If you do not wish to follow one of the above links in order to view this hack in action, a screenshot has been provided.
Cal Poly Forum
08-17-2003, 08:34 AM
Keep up with the good work man. :cool:
Floris
08-17-2003, 08:34 AM
Nice work my friend :)
K33nny
08-17-2003, 08:34 AM
Barely work, thanks for the comments. I'm learning, slowly and this is just fun for me. I figure if I do something neat with my forums, that I should release it to this community because my community's features are great due to this place, without it it would be just forums... my small way of giving back.
Mephisteus
08-17-2003, 09:28 AM
I'm quite sure this has been done before (I know almost every hack in this damn db :p). I'll look for it to be sure.
assassingod
08-17-2003, 09:42 AM
Today at 11:28 AM DarkSSJ3 said this in Post #6 (https://vborg.vbsupport.ru/showthread.php?postid=426572#post426572)
I'm quite sure this has been done before (I know almost every hack in this damn db :p). I'll look for it to be sure.
He mentions it has been done before (twice). His looks nicer though.
Good work
K33nny
08-17-2003, 12:04 PM
I said it twice, said it once in the hack file, and gave a link to the original hack. I'm quite well aware of the fact that it's been done before. :)
Alien
08-17-2003, 07:37 PM
How many additional queries does this add to the forumhome?
Also, anyone know if it would be helpful to add the template calls added from this hack into the templatesused line?
Thanks. :)
Dean C
08-17-2003, 08:44 PM
1query I believe and yes it will add two if you don't add the template to templates used ;)
- miSt
MaDCaT75
08-17-2003, 11:24 PM
But what about like here at vb.org? What if I want it to say ( 0 users browsing ) if there are no users browsing? :ermm:
WEForums
08-17-2003, 11:44 PM
Today at 01:24 AM MaDCaT75 said this in Post #11 (https://vborg.vbsupport.ru/showthread.php?postid=426703#post426703)
But what about like here at vb.org? What if I want it to say ( 0 users browsing ) if there are no users browsing? :ermm: You'll probably want to use the original hack. It's in the installation file.
K33nny
08-18-2003, 12:10 AM
I will rework the hack so there is another template for no browsers browsing. So you can either leave it blank or fill it with content. But WEForums is right, you can do what he said and use the original hack by Neo & Firefly.
K33nny
08-18-2003, 12:15 AM
Alright, the attachment has been updated to do what MadCat75 wanted. You can either leave the nobrowsers template blank or put in code.
Good question MadCat75. ;)
psico
08-18-2003, 01:11 AM
Excelent hack dude!
MaDCaT75
08-18-2003, 02:33 AM
Today at 02:15 AM K33nny said this in Post #14 (https://vborg.vbsupport.ru/showthread.php?postid=426714#post426714)
Alright, the attachment has been updated to do what MadCat75 wanted. You can either leave the nobrowsers template blank or put in code.
Good question MadCat75. ;)
Thank you!
MaDCaT75
08-18-2003, 02:44 AM
Oh one more thing.... I made the new changes but it says ( users browsing ) when theres nobody on but I want it to say ( 0 users browsing ) what changes to I need to make?
K33nny
08-18-2003, 02:52 AM
In template forumdisplay_nobrowsers change $browsers to $numbrowsers.
The file attachment has been updated to reflect this.
MaDCaT75
08-18-2003, 02:56 AM
Thanks :)
Edit: I did as you said now the whole thing is screwed up..... any help here? www.sims2forums.com everything got all screwed and so I just put it back to ( users browsing ) :cry:
K33nny
08-18-2003, 10:03 AM
I will check monday when you have users browsing your website.
The Realist
08-18-2003, 01:19 PM
What do I need to do so the browsing members show in a diff colour from the rest of the text so it stands out.
MrNase
08-18-2003, 03:26 PM
Easy, get this one running and open the earlier edited templates that are used for this hack.
Find
has $browsers user browsing
or
has $browsers users browsing
or
has $numbrowsers users browsing
and replace it with
<span style="color:RED">has $browsers user browsing</span>
or
<span style="color:RED">has $browsers users browsing</span>
or
<span style="color:RED">has $numbrowsers users browsing</span>
could use vB variables instead of "RED" like #FF4400 or #666686 or something like this :)
K33nny
08-18-2003, 09:56 PM
I think there is some serious issues with my install fall that I've just picked up on. Let me look over things and double check the code.
K33nny
08-18-2003, 10:07 PM
Alright, on my end I was not able to download the latest version of this script so I deleted my temporary files and was finally able to. If you're not seeing anything new in the attached file, delete all temporary files and you should see the latest version. I fear this maybe why MadCat75 is having issues.
MaDCaT75
08-19-2003, 01:32 AM
Its about time it worked :lick:
K33nny
08-19-2003, 01:53 AM
Well with your addition request it got messed up. ;)
MaDCaT75
08-19-2003, 02:14 AM
:rolleyes:
EvilLS1
08-24-2003, 04:35 AM
Nice hack. I'm using this to show the number of users in my java chatroom. :)
* EvilLS1 clicks install.
Logician
08-26-2003, 07:46 PM
08-17-03 at 04:04 PM K33nny said this in Post #149 (https://vborg.vbsupport.ru/showthread.php?postid=426591#post426591)
I said it twice, said it once in the hack file, and gave a link to the original hack. I'm quite well aware of the fact that it's been done before. :)
Modifications & enhancements on a current hack should be released on the original hack's thread so I merged threads..
Carnage Media
09-22-2003, 02:37 PM
I'm getting this error.
Parse error: parse error, unexpected T_STRING on this line
Users browsing each forum $getforumbrowsers = $DB_site->query(' SELECT COUNT(*) AS count, inforum FROM user WHERE lastactivity>'.($ourtimenow - $cookietimeout).' AND lastvisit<>lastactivity GROUP BY inforum '); $forumbrowsers = array(); while ($getforumbrowser = $DB_site->fetch_array($getforumbrowsers)) { $forumbrowsers[$getforumbrowser['inforum']] = $getforumbrowser['count']; }
got this when I uploaded index.php
thanks
lange
10-27-2003, 07:54 PM
VB2.X
It's working with members only. How to show members AND guests browsing in forums ? Is it possible ?
thx
MaDCaT75
10-27-2003, 07:57 PM
I cant find the one like they have here at vb.org.... please help
NTLDR
10-27-2003, 08:10 PM
I cant find the one like they have here at vb.org.... please help
You'll find it in your vBulletin 3 zip file.
MaDCaT75
10-27-2003, 08:12 PM
You'll find it in your vBulletin 3 zip file.
ROFL but I dont have vbulletin 3.
NTLDR
10-27-2003, 08:13 PM
Thats the only legal place you'll find the one thats in use here ;)
MaDCaT75
10-27-2003, 08:14 PM
Thats the only legal place you'll find the one thats in use here ;)
ok then......
* MaDCaT75 goes to shoot self in the head
VirtualHogwarts
11-30-2003, 01:24 AM
/me clicks insatll works like a charm.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.