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)
-   -   [Release v2.0.3] Mods & Admins online (https://vborg.vbsupport.ru/showthread.php?t=30761)

rylin 10-18-2001 10:00 PM

http://www.b0fh.cx/vb2.html :)

Version 1.2

couldn't be arsed writing up upgrade info from the old version, but you should be able to re-trace your steps by checking the old version.. these instructions weren't written when i rewrote the hack, but were compiled now by looking at the current code.. i don't think i've left out anything, but if i have, slap me around a bit, mmkay?

malc 10-19-2001 03:05 PM

thanks for the hack !! :p

Can you update your URL ?! but i have access denied

rylin 10-19-2001 03:07 PM

Oops, had added a block on 217.x.x.x (had to many code red hits from there ;)).. should work now :P

Streicher 10-19-2001 04:01 PM

Can we see a screenshot please?

DarkReaper 10-19-2001 04:10 PM

What about expanding this hack to cover forums themselves. Such as: "Moderators of *this forum* currently online" :)

rylin 10-19-2001 06:08 PM

[QUOTE]Originally posted by Streicher
Can we see a screenshot please?

drumsy 10-20-2001 05:12 AM

Please, forgive my newbiness, but can you please explain where ALL lines of code go in the index.php file???

Your directions give me line numbers (that's fine, I find where it all needs to go) but it does not tell me what code I need to replace it with, or if code needs to be removed, etc.....

For instance, your page says:

locate the line that says:
Code:

if ($loggedin=$DB_site->fetch_array($loggedins)) {
add:
Code:

if($loggedin['usergroupid']==6||$loggedin['usergroupid']==7||$loggedin['usergroupid']==5) {
 $modsloggedin[$loggedin['userid']]=$loggedin['username'];
}

I've screwed up my forums three times tonight, thank God editplus saves a backup!!!!

rylin 10-20-2001 07:46 AM

right below the lines specified, except for the next-to-last one

drumsy 10-21-2001 05:04 AM

Ok, I have SERIOUSLY fugged something up!!! Here's what my index.php line looks like from right where the first edit of this hack goes in till the end of the last hack. Keep in mind, I've since added the hack (what I thought was the right way) and had to go back and try to set everything back as normal. Obviously, it has not worked, as this is what my "Who's Online" is showing!

(not displaying picture, as it is a bit large) http://www.purehonda.com/userpages/H...tors/error.jpg

Can you help???

rylin 10-21-2001 10:12 AM

the complete if($displayloggedin) clause should look like this when you're done (btw.. mods.. how much are we allowed to paste?? cut out some stuff if you have to :o)
PHP Code:

if ($displayloggedin) {
  
$datecut=time()-$cookietimeout;

  
$loggedins=$DB_site->query_first("SELECT COUNT(*) AS sessions FROM session WHERE userid=0 AND lastactivity>$datecut");
  
$numberguest=$loggedins['sessions'];

  
$numbervisible=0;
  
$numberregistered=0;

  
$loggedins=$DB_site->query("SELECT DISTINCT session.userid,usergroupid,username,invisible
                              FROM session
                              LEFT JOIN user ON (user.userid=session.userid)
                              WHERE session.userid>0 AND session.lastactivity>
$datecut
                              ORDER BY invisible ASC, username ASC"
);
  if (
$loggedin=$DB_site->fetch_array($loggedins)) {
    if(
$loggedin['usergroupid']==6||$loggedin['usergroupid']==7||$loggedin['usergroupid']==5) {
     
$modsloggedin[$loggedin['userid']]=$loggedin['username'];
    }

    
$numberregistered++;
    if (
$loggedin['invisible']==or $bbuserinfo['usergroupid']==6) {
      
$numbervisible++;
      
$userid=$loggedin['userid'];
      if (
$loggedin['invisible']==1) { // Invisible User but show to Admin
        
$username=$loggedin['username'];
        
$invisibleuser '*';
      } else {
        
$username=$loggedin['username'];
        
$invisibleuser '';
      }
      
//$location=$loggedin['location'];
      
eval("\$activeusers = \"".gettemplate('forumhome_loggedinuser')."\";");
    }

    while (
$loggedin=$DB_site->fetch_array($loggedins)) {
      if(
$loggedin['usergroupid']==6||$loggedin['usergroupid']==7||$loggedin['usergroupid']==5) {
       
$modsloggedin[$loggedin['userid']]=$loggedin['username'];
      }

      
$numberregistered++;
      
$invisibleuser '';
      if (
$loggedin['invisible']==and $bbuserinfo['usergroupid']!=6) {
        continue;
      }
      
$numbervisible++;
      
$userid=$loggedin['userid'];
      if (
$loggedin['invisible']==1) { // Invisible User but show to Admin
        
$username=$loggedin['username'];
        
$invisibleuser '*';
      } else {
        
$username=$loggedin['username'];
      }
      
$location=$loggedin['location'];
      eval(
"\$activeusers .= \", ".gettemplate('forumhome_loggedinuser')."\";");
    }
    
reset($modsloggedin);
    while(list(
$key,$val)=each($modsloggedin)) {
     
$modloguname=$val;
     
$modlogid=$key;
     eval(
"\$moderatorsloggedin .= \"".gettemplate('forumhome_modsloggedin')."\";");
    }
  }
  
$DB_site->free_result($loggedins);

  
$totalonline=$numberregistered+$numberguest;
  
$numberinvisible=$numberregistered-$numbervisible;

  
$maxusers=explode(" "gettemplate('maxloggedin',0,0));
  if ((int)
$maxusers[0] <= $totalonline) {
    
$time time();
    
$maxloggedin "$totalonline " $time;
    
$DB_site->query("UPDATE template SET template='$maxloggedin' WHERE title='maxloggedin'");
    
$maxusers[0] = $totalonline;
    
$maxusers[1] = $time;
  }
  
$recordusers $maxusers[0];
  
$recorddate vbdate($dateformat,$maxusers[1]);
  
$recordtime vbdate($timeformat,$maxusers[1]);
  eval(
"\$loggedinusers = \"".gettemplate('forumhome_loggedinusers')."\";");



drumsy 10-21-2001 04:26 PM

Thank you SO much!!! This is my first hack (I guess it shows, eh?;)) I've edited out my php code, if you feel comfortable doing the same! Btw, is there a way to seperate the names listed by a comma and then space?? I did go into the forumhome_modsloggedin template and added a comma and a space after the final </a> tag, but then that leaves the last guy on my list with a comma after his name. Anyway around that?

Syphin 10-23-2001 02:40 PM

With that coding, wont it cause an error if there are no mods or admins logged in at the time?

eh, im probably wrong.. lol with my limited coding skills.. :p



-Syphin

rylin 10-23-2001 05:05 PM

[QUOTE]Originally posted by Syphin
With that coding, wont it cause an error if there are no mods or admins logged in at the time?

eh, im probably wrong.. lol with my limited coding skills.. :p



-Syphin

drumsy 10-23-2001 05:28 PM

Quote:

Originally posted by okidoki


it will indeed ;)
i'll update the instructions later tonight.. have it fixed on my development server ;)

Argghhhh, more to edit...well, we'll see what happens!

BTW, how do I add another usergroup ID to it? It's currently displaying admins and super moderators, but I need to throw in moderators which is usergroup ID=51.

rylin 10-23-2001 05:40 PM

[QUOTE]Originally posted by drumsy


Argghhhh, more to edit...well, we'll see what happens!

BTW, how do I add another usergroup ID to it? It's currently displaying admins and super moderators, but I need to throw in moderators which is usergroup ID=51.

Syphin 10-24-2001 06:58 AM

Oh, i was right.. O.o lol Oh well... Cool hack nontha less.. ^^

-Syphin

Syphin 10-25-2001 09:25 PM

okidoki:

Could you please update this to where there is no errors when no mods/admins are online? and post when ya do? lol thnx..

Id like to get rid of those... >_< O.o

-Syphin

Alien 10-26-2001 06:26 AM

Yeah, I look forward to that fix. ;)

I have this disabled until then!

rylin 10-26-2001 09:38 PM

Version 1.2

couldn't be arsed writing up upgrade info from the old version, but you should be able to re-trace your steps by checking the old version.. these instructions weren't written when i rewrote the hack, but were compiled now by looking at the current code.. i don't think i've left out anything, but if i have, slap me around a bit, mmkay?

Syphin 10-26-2001 10:28 PM

Thnx... Works great now.. ^^

-Syphin

drumsy 10-27-2001 04:09 AM

Worked without a hitch!

Is it possible to get a brief idea of what this updated version does?

Alien 10-27-2001 05:13 AM

This works perfectly for me, however it doesn't seperate the moderators by a space or comma.. Anyway to set it up to display "User 1, User 2, User 3" (of course, with no comma after the last moderator?)

That would make this complete. :)

Quote:

Originally posted by okidoki
Version 1.2

couldn't be arsed writing up upgrade info from the old version, but you should be able to re-trace your steps by checking the old version.. these instructions weren't written when i rewrote the hack, but were compiled now by looking at the current code.. i don't think i've left out anything, but if i have, slap me around a bit, mmkay?


\/ash 10-27-2001 07:17 AM

could u like post the full code in one post because your instructions are dificult for me to understand.

rylin 10-27-2001 10:34 AM

[QUOTE]Originally posted by \/ash
could u like post the full code in one post because your instructions are dificult for me to understand.

rylin 10-27-2001 10:38 AM

If you want to separate with a space, just add a space after </a> in forumhome_modsloggedin

If you want to separate with a comma, add the comma, and then, right before
PHP Code:

eval("\$modlogin .= \"".gettemplate('forumhome_modlogin')."\";"); 

, add
PHP Code:

$modlogin=substr($modlogin,0,-1); 

and it should work


[QUOTE]Originally posted by Alien
This works perfectly for me, however it doesn't seperate the moderators by a space or comma.. Anyway to set it up to display "User 1, User 2, User 3" (of course, with no comma after the last moderator?)

That would make this complete. :)


rylin 10-27-2001 10:39 AM

[QUOTE]Originally posted by drumsy
Worked without a hitch!

Is it possible to get a brief idea of what this updated version does?

Alien 10-27-2001 07:33 PM

Thanks a bunch! :) Great work.

Syphin 10-27-2001 09:36 PM

Oh ya, I forgot... This new version... Does it show the regular mods also? Or do i need to add that grup id?

=) thnx again... :p

now to find out how to make it show whos online in each forum... like on 2.somthing... ^^ Cuz i mostlikley wont be upgrading... lol >_<


Edit: I hope this works on the new version... >_< Ive desided to upgrade... lol

-Syphin


All times are GMT. The time now is 02:45 AM.

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.01702 seconds
  • Memory Usage 1,834KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (28)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete