vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   [HowTo] Categorize Who's Online on Forumhome (https://vborg.vbsupport.ru/showthread.php?t=47527)

KuraFire 01-08-2003 10:00 PM

[HowTo] Categorize Who's Online on Forumhome
 
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

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?

Code:

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

Quote:

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

Quote:

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

Quote:

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

Quote:

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

$activeusers = iif($staffusers!="", "Staff: $staffusers <br />", "") . iif($normalusers!="", "Members: $normalusers", "");
and replace with:
Code:

$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

Quote:

Originally posted by -Sidekick-
anyone have a screehshot of this in action?
You can surf to www.creations.nl and see it live

Bugz 01-11-2003 12:38 AM

Quote:

Originally posted by -Sidekick-
anyone have a screehshot of this in action?

Quote:

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:

Code:

eval("\$activeusers .= \"".gettemplate('forumhome_loggedinuser')."\";");
Did that.

Below that is a closing tag ( } ), and below that closing tag, paste this bit of code:

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:

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



PHP Code:

    }
  
$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:

Code:

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

Code:

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!




Quote:

Line 336 is:

list($key1,$val1)=each($iforumcache["$forumid"]) ) {
Make that:


while(list($key1,$val1)=each($iforumcache["$forumid"]) ) {


All times are GMT. The time now is 04:46 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02713 seconds
  • Memory Usage 1,829KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (2)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete