Announcement

Collapse
No announcement yet.

[Release v2.0.3] Mods & Admins online

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Release v2.0.3] Mods & Admins online

    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?
    Last edited by rylin; Fri 26 Oct '01, 2:38pm.
    My open eyes see everything, and you see nothing. . .
    That forum

  • #2
    thanks for the hack !!

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

    Comment


    • #3
      Oops, had added a block on 217.x.x.x (had to many code red hits from there ).. should work now :P
      My open eyes see everything, and you see nothing. . .
      That forum

      Comment


      • #4
        Can we see a screenshot please?
        Streicher

        Comment


        • #5
          What about expanding this hack to cover forums themselves. Such as: "Moderators of *this forum* currently online"
          Seriously! - The Definitive Home of All Things Serious
          Seriously! Forums

          To recieve support on these forums, enter your username here.

          Comment


          • #6
            Originally posted by Streicher
            Can we see a screenshot please?
            Sure
            Although as it's template driven, there's a lot more you can do.. eg. you could make it a dropdown etc. that would send a pm to a mod.. a lot of stuff really
            My open eyes see everything, and you see nothing. . .
            That forum

            Comment


            • #7
              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!!!!

              Comment


              • #8
                right below the lines specified, except for the next-to-last one
                My open eyes see everything, and you see nothing. . .
                That forum

                Comment


                • #9
                  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???
                  Last edited by drumsy; Sun 21 Oct '01, 9:25am.

                  Comment


                  • #10
                    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 )
                    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')."\";");

                    My open eyes see everything, and you see nothing. . .
                    That forum

                    Comment


                    • #11
                      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?

                      Comment


                      • #12
                        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..



                        -Syphin

                        Comment


                        • #13
                          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..



                          -Syphin
                          it will indeed
                          i'll update the instructions later tonight.. have it fixed on my development server
                          My open eyes see everything, and you see nothing. . .
                          That forum

                          Comment


                          • #14
                            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.

                            Comment


                            • #15
                              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.
                              just change the lines (2) that say
                              PHP Code:
                              if($loggedin['usergroupid']==6||$loggedin['usergroupid']==7||$loggedin['usergroupid']==5) { 
                              to
                              PHP Code:
                              if($loggedin['usergroupid']==6||$loggedin['usergroupid']==7||$loggedin['usergroupid']==5||$loggedin['usergroupid']==51) { 
                              My open eyes see everything, and you see nothing. . .
                              That forum

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...
                              X