View Full Version : [HowTo] Categorize Who's Online on Forumhome
KuraFire
01-08-2003, 10:00 PM
HACK: [HowTo] Categorize Who's Online on Forumhome
BY: KuraFire [www.kurafire.com]
REQUESTED BY: Xiphoid [www.creations.nl]
DESCRIPTION: Divide the active users bit on Forumhome into a Staff: section and Members: section
DIFFICULTY: Easy
INSTALL-TIME: 5 minutes
Xiphoid asked for a categorization on forumhome (Staff / Members) for vB 3, but since it's such an easy thing I decided not to wait for vB 3 but just make the hack myself :)
Kudos to xiphoid for a good idea :)
EXAMPLE HERE: click here for an example of this hack (http://kurafire.com/thecouch/?munchie=1)
Warning / note: The || and && operators in original vB code I put in the instructions here that you need to search on MIGHT BE "or" and "and" in your version. Keep that in mind if you can't find the code!
Note: I wrote this on my own board which is currently still version 2.2.5, it might well work on any version above that but that is not yet tested or confirmed! (nor for versions below)
INSTRUCTIONS ARE IN THE ATTACHMENT :)
If something did not work right, you did not follow the instructions properly :)
Enjoy! :)
Kars10
01-09-2003, 10:54 AM
Damn Cool!! Thanks KuraFire!!
Install this right now!! :)
Xenon
01-09-2003, 11:06 AM
looks nice :)
also can you please delete the instructions from your post and just put it in the textfile, so unlicenced users can't get it?
KuraFire
01-09-2003, 11:19 AM
hmkay...
X-Fan
01-09-2003, 01:09 PM
Is it possible to adapt this for the WOL page proper?
Boofo
01-09-2003, 03:04 PM
Excellent hack. Thanks! :)
My second instance that you said to comment out of this code has a comma in it. Do we need to put a comma back in the line above it or anything?
eval("\$activeusers .= \", ".gettemplate('forumhome_loggedinuser')."\";");
Also, if a staff member is online and invisible, will the staff tag still show up on the line and be blank or will it not show up to regular members? If I am the only staff member online and in Ghost mode, I really don't want the Staff: to show up, if possible. That would pretty well give it away that there is a staff member online but invisible. :)
KuraFire
01-09-2003, 03:44 PM
Do we need to put a comma back in the line above it or anything?
Nope, thanks for pointing that out!
The comma's between usernames are added with the implode() function that I call at the end of the hack part. You should not have any comma's (string-comma's, not code-related ones) in your code anymore....
Also, if a staff member is online and invisible, will the staff tag still show up on the line and be blank or will it not show up to regular members? If I am the only staff member online and in Ghost mode, I really don't want the Staff: to show up, if possible. That would pretty well give it away that there is a staff member online but invisible.
I do believe that it won't appear unless there is at least 1 VISIBLE member in that section (staff or members). I looked at the code and it should work that way, if it doesn't, let me know okay? :)
Is it possible to adapt this for the WOL page proper?
You mean sort the display of Who's Online (online.php) into a Staff and Members (and Guests?) section as well?
That's possible but that can't be done with this hack, I'd have to write a whole different kind of hack for that. The WOL page works quite a bit differently, more complex and all.....
Boofo
01-09-2003, 03:51 PM
Thanks for the quick response. :) It's hard to tell if the Staff shows up since I will see it as the Admin even for invisible staff. I'll check with someone on line at the time and see if they can see it. I'll let you know what I find out. :)
Thanks again for a very useful hack. :)
KuraFire
01-09-2003, 03:57 PM
I could check it out for you right now if you've installed the hack on your live board already... :)
Boofo
01-09-2003, 04:00 PM
Ok, great. I'm there now. Do you need the URL? It is in my profile unless you want it here. :)
KuraFire
01-09-2003, 04:11 PM
I'm looking at the forumhome on your site but I'm not seeing any members logged in, be they staff or normal.
Only 1 member and 1 guest, me being the guest, I'm assuming you're the member, thus the invisible admin, and I can't see you, nor do I see "Staff:" anywhere :)
So I take it that all works then, eh? :)
Boofo
01-09-2003, 04:16 PM
Yes, that was i hiding. :) Great! Thanks for checking it out. Now If I can figure out a way to not have it show up for the amount of users online if I am an invisible Admin, then there would be no way to tell at all when I was on there. :)
Again, thanks for checking it out and releasing another great hack. The quotes hack and search by ID hack are up and running well along with this one now. "If you release it, I will install it." :)
KuraFire
01-09-2003, 04:42 PM
See your PM's boofo :):up:
Boofo
01-09-2003, 04:55 PM
Right back at ya. ;)
Dean C
01-09-2003, 05:27 PM
Nice hack kurafire - good to see you around the place again :p
Chris M
01-09-2003, 07:53 PM
Nice Kura:)
Satan
KuraFire
01-09-2003, 08:21 PM
Originally posted by Mist
Nice hack kurafire - good to see you around the place again :p
Thx :)
I've been quite busy with hacking vB and adding features and all, but they're all so integrated with one another on my site that
a) I can't possibly release one of them unless I release every change and every hack all together;
b) I don't want to release several of these hacks, so that kind of makes it impossible for me to release any of them.
That's why I haven't been around much. Today, xiph pointed me to that Staff/Member thingy and I figured, hey, that's a nice idea for a hack, and also one for vb.org :)
So I did ^_^
Areku
01-09-2003, 08:35 PM
Worked like a charm on vb 2.2.0!
Thanks!!
KuraFire
01-10-2003, 09:54 AM
anyone got this working on vB 2.2.9 yet?
Boofo
01-10-2003, 09:58 AM
That's the version I am running and it works good for me. :)
KuraFire
01-10-2003, 10:13 AM
okay, great :)
Floris
01-10-2003, 11:23 AM
First of all, thank you Kura. Glad you liked my idea and that we could realize it with a little hack.
It works perfectly on my 2.2.9 board at http://creations.nl/ :banana:
I added a little code to it, so the staff links to the forum leaders page and the members link to the memberlist page.
Link 'Staff' to 'Forum Leaders' Page - addon:
and
Link 'Members' to 'Memberlist' Page - addon:
Find:$activeusers = iif($staffusers!="", "Staff: $staffusers <br />", "") . iif($normalusers!="", "Members: $normalusers", "");and replace with:$activeusers = iif($staffusers!="", "<a href=\"$bburl/showgroups.php?s=\">Staff</a>: $staffusers <br />", "") . iif($normalusers!="", "<a href=\"$bburl/memberlist.php?s=\">Members</a>: $normalusers", "");
Just in case someone else also wants to do this, and, if you want to have it show as:
Staff:
<staff members on their own line>
Members:
<members on their own line>
Then just add a <br /> behind the Staff: part
Kiel McLeod
01-10-2003, 02:47 PM
i tried it on 2.2.9 and i couldn't find the code for step 2....
Xanthine
01-10-2003, 06:12 PM
Thanks, works great for me, 2.2.6
www.blackassassins.org/forum
-Sidekick-
01-10-2003, 11:03 PM
anyone have a screehshot of this in action?
Floris
01-10-2003, 11:28 PM
Originally posted by -Sidekick-
anyone have a screehshot of this in action?
You can surf to www.creations.nl and see it live
Originally posted by -Sidekick-
anyone have a screehshot of this in action?
Originally posted by xiphoid
You can surf to www.creations.nl and see it live
i would like to see it on a site were there are admins mods and so forth to see the full bang of it
it looks good from what i can see.
Floris
01-11-2003, 09:09 AM
one admin
one mod
one member
:) happy now? :)
KuraFire
01-12-2003, 10:47 AM
There is also a big EXAMPLE link in the first post which you could check, my board nearly always has a staffmember and 3-5 normal members _at least_ online at any time. Average is about 12 ppl in total of which 2-3 staff.. :)
bromyaur
02-16-2003, 09:49 AM
Will be installing this later but I have a small question, at this site
http://creations.nl/
I see it has a listing for robots, is that a seperate hack? I have searched here for that and cant seem to find reference to it.
Thanks
Floris
02-16-2003, 09:17 PM
Yeah, vB archive.
Conundrum9
03-02-2003, 09:38 PM
Which staff are listed? Obviously admins, but are both supermods and forum mods listed in the staff section or just supermods?
If it's both is there an easy way of changing it so that only supermods are listed with the staff, while forum mods stay listed with members?
impakt
03-05-2003, 06:56 AM
I got this to work on 2.3.0
Great hack, and good job. :)
WEForums
04-23-2003, 02:06 AM
I am using 2.3.0, and I can't seem to find the 'closing' tag.
If you followed the instructions properly, the last thing you did now was to delete (or comment out) the SECOND occurance of this line:
eval("\$activeusers .= \"".gettemplate('forumhome_loggedinuser')."\";");
Did that.
Below that is a closing tag ( } ), and below that closing tag, paste this bit of code:
$staffusers = implode(", ", $su_r);
$normalusers = implode(", ", $nu_r);
$activeusers = iif($staffusers!="", "Staff: $staffusers <br />", "") . iif($normalusers!="", "Members: $normalusers", "");
Anyone who knows where the closing tag is could you please point it out? Thanks.
KuraFire
04-23-2003, 08:33 AM
WEforums:
in vB 2.3.0, around line 196 (unhacked index.php), you will find this bit of code:
}
}
$DB_site->free_result($loggedins);
The first } that you see there, is the closing tag that I'm talking about in the Hack instructions. So, your code should look like this:
}
$staffusers = implode(", ", $su_r);
$normalusers = implode(", ", $nu_r);
$activeusers = iif($staffusers!="", "Staff: $staffusers <br />", "") . iif($normalusers!="", "Members: $normalusers", "");
}
$DB_site->free_result($loggedins);
Lemme know if you got it, now :)
WEForums
04-23-2003, 08:43 PM
I was thinking great, it'll be simple now. That proves incorrect though. I did what you said, and I get this error:
Parse error: parse error, unexpected ',' in /home2/wef/public_html/forums/index.php on line 210
Line 210 is the following:
$staffusers = ", ", $su_r);
Of course this is probably an easy problem to fix for you 'veterans' but I am new to hacking up forums. I tried removing the ','s and of course that failed, lol.
Anyway, if you have an idea of what can be causing this I'd be thankful.
Also, thanks for the reply. :)
KuraFire
04-23-2003, 10:59 PM
<font size="7">I
Hate
vBulletin.org!</font>
*sighs*
stupid PoS system removes php functions from blocks of [php-] code! *mutters furiously*
change:
$staffusers = ", ", $su_r);
$normalusers = ", ", $nu_r);
into:
$staffusers = implode(", ", $su_r);
$normalusers = implode(", ", $nu_r);
Then it should work..
WEForums
04-23-2003, 11:36 PM
I hate feeling like a "newbie." :(
Truth is, I don't have any clue how to fix parse errors. Your instructions worked to fix that parse error, but a separate part of the code (one in which is identical to an 'unhacked' vB index.php) seems to be causing a parse error. (It must be to do with this code or I completely screwed up. heh)
Anyway, the current error is:
Parse error: parse error, unexpected ')' in /home2/wef/public_html/forums/index.php on line 336
Line 336 is:
list($key1,$val1)=each($iforumcache["$forumid"]) ) {
GRRR!
I am sure I am annoying, lol. Can't wait to get enough time to study PHP.
If you need any other info (or if you're willing to help) just let me know what to do. Sorry to burden you. :(
WEForums
04-24-2003, 12:28 AM
Just to give a bit more code... Lines 330 - 342:
if ($depth<$forumhomedepth) {
$forumbits.=makeforumbit($forum['forumid'],$depth+1,$forumperms);
}
} // END if can view
} // END while ( list($key2,$forum)=each($val1) ) {
} // END while )
list($key1,$val1)=each($iforumcache["$forumid"]) ) {
unset($iforumcache["$forumid"]);
return $forumbits;
}
if (!isset($forumid) or $forumid==0 or $forumid=='')
KuraFire
04-24-2003, 08:15 AM
I
Hate
vBulletin.org!
Line 336 is:
list($key1,$val1)=each($iforumcache["$forumid"]) ) {
Make that:
while(list($key1,$val1)=each($iforumcache["$forumid"]) ) {
WEForums
04-24-2003, 07:34 PM
*commits suicide*
Yes, that worked...for that... It seems vB.org needs to fix the problem (or is it intentional? seems stupid)
Sadly enough this is frustrating. Fix one area of code and and another is messed up. This is another parse error... it's just a little bit strange. Something to do with a variable or some crap. Here's the error:
Parse error: parse error, unexpected $ in /home2/wef/public_html/forums/index.php on line 357
What's strange about it? Line 357 is:
?>
Yeah, the closing part of the code.
FRUSTRATING.
EDIT: Are we allowed to post the full script (index.php) or not? I don't think we are so I wouldn't even try.
KuraFire
04-24-2003, 08:26 PM
nope, not allowed to post full scripts, at all...
I dunno what the problem is though, but I think you should try and reinstall it using the (renewed) attachment in post 1 :p
WEForums
04-24-2003, 09:55 PM
Worked perfectly. Thanks for your time AND help.
"Master Hacker" is right. ;)
KuraFire
04-25-2003, 08:05 AM
*grins*
You're welcome, glad you got it working :)
Frozen Dreams
05-01-2003, 08:55 PM
Never thought it - but actually worked on first try for me :D
awesome hack - exactly the one I wanted
thanks Kura ;)
* Frozen Dreams clicks install
I keep getting an error, it says: Parse error: parse error in /home/virtual/site24/fst/var/www/html/forums/online.php on line 101
It comes up whenever I click on the Currently Active Users lino to go to the Who's Online page
here's the code around line 101:
$userinfo[where] = "Creating New Thread in Forum <a href='forumdisplay.php?s=$session[sessionhash]&forumid=$userinfo[forumid]'>".$forum[forumid][$userinfo[forumid]]."</a>";
}
break;
case 'newreply':
if (!$thread[title][$userinfo[threadid]] || !$forum[canview][$thread[forumid][$userinfo[threadid]]] || (!$forum[canviewothers][$thread[forumid][$userinfo[threadid]]] && $thread[postuserid][$userinfo[threadid]] != $bbuserinfo[userid])) {
$userinfo[where] = "Replying to Thread";
} else {
$userinfo[where] = "Replying to Thread <a href='showthread.php?s=$session[sessionhash]&threadid=$userinfo[threadid]'>".$thread[title][$userinfo[threadid]]."</a>";
line 101 is the line right under "case 'newreply':" i think it is anyways :p
Can ANYONE help me here! lol
MGM out
KuraFire
05-23-2003, 02:14 AM
why are you editing online.php ?
Almax
05-23-2003, 09:08 AM
installed worked ok ....but
there are normal members showing up in staff as well as members ?
:confused:
KuraFire
05-23-2003, 11:15 AM
ehm?
err.... hmm.... wrong hack, sorry. I thought this hack edited online.php, i didnt know i edited index.php, argh, well, sorry to bother you. If you know how to fix it, then by all means do so, but I dont wanna bother you with a hack that doesn't belong here :P
MGM out
Areku
11-13-2003, 08:09 AM
I've just turned one moderator back to REGISTERED and he still shows up as part of the STAFF.... He has tried from different computers but results are the same.
He has cleaned cookies and cache but he's still there...
Any ideas??
Floris
11-13-2003, 08:13 AM
I've just turned one moderator back to REGISTERED and he still shows up as part of the STAFF.... He has tried from different computers but results are the same.
He has cleaned cookies and cache but he's still there...
Any ideas??
This has nothing to do with this hack.
KuraFire
11-13-2003, 08:56 AM
I've just turned one moderator back to REGISTERED and he still shows up as part of the STAFF.... He has tried from different computers but results are the same.
He has cleaned cookies and cache but he's still there...
Any ideas??
If he still shows up as staff he is still in at least one staff group.
Areku
11-13-2003, 02:15 PM
This has nothing to do with this hack.
Yes it does.
If he still shows up as staff he is still in at least one staff group.
No. He DOES NOT appear on the SHOWGROUPS.php list.
He's a REGISTERED user now.
He is NOT a moderator of ANY forum.
He does NOT see the HIDDEN moderators forum.
He has cleaned cookies and cache...
But he still appears categorized as part of the STAFF.
What else?
KuraFire
11-13-2003, 10:38 PM
Check your Forum settings to see if he is still listed as a Moderator to a forum (even though he isn't in the moderators usergroup anymore).
If you can't find him there, check the database moderator tables to see if he's still among those. I think that's the problem here (caused by vB not deleting these entries properly when changing mods back to normal members, perhaps...)
Areku
11-13-2003, 10:48 PM
Is that a normal issue (bug) in the 2.3.0 version of the board? I can only think of your second option as he definetly is NOT moderating any forum...
Areku
11-13-2003, 10:50 PM
Found it on moderator table!
Wotta weirdo!!
KuraFire
11-14-2003, 07:38 AM
Hence, 'twas nothing to do with my hack after all :)
Areku
11-14-2003, 08:48 AM
blaaaaaah! :P
U must reckon this was the only place to ask for this issue :P ;)
KuraFire
11-14-2003, 09:13 AM
Fair enough :)
I was the easiest way of getting a fix, for you, cos i know the code of my hack, yup. :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.