View Single Post
  #154  
Old 08-13-2014, 12:02 AM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you do this part of the instructions?

Go to Admin CP -> Forums & Moderators (on the side menu) -> Forum Blocks Manager

Click on "Add Block"

Choose "Custom HTML/PHP" from the drop down menu and click "Continue"

Title: Staff Online by BOP5
Description: Sideblock shows current forum staff online.
Cache Time: 1
Display Order: (Your Choice)

Content Type: PHP
Template to use: block_staff_online_bop5

Content:

<<<<<<< COPY BELOW THIS LINE >>>>>>>>

PHP Code:
global $vbulletin$vbphrase;
$vbo = &$vbulletin->options;

if (
$vbo['bop5sob_en'])
{
    
$staff_usergroupids $vbo['bop5so_groups']; 
  
    
$bopshowav $vbo['bop5so_showav'];
  
    
$dofonts $vbo['bop5so_intfont'];   
    
$dosizes $vbo['bop5so_intsize'];                 
    
$docolor $vbo['bop5so_intcolor'];                 
      
    
$showinvisible $vbo['bop5so_showinvis'];
    
    
$nostaffuser $vbphrase['bop5_staff_online_none'];
    
$nostaffusertitle $vbphrase['bop5_staff_online_no_staff'];

  if (
THIS_SCRIPT != 'index'
  {
     require_once(
DIR '/includes/functions_bigthree.php');
  } 


  
$cooktimeout TIMENOW $vbulletin->options['cookietimeout'];
  
$staffcount 0;

  
$bop5_fields '';

  if (
$dofonts)
    
$bop5_fields .= " , user.bop5_userfont AS bop5_userfont ";

  if (
$dosizes)
    
$bop5_fields .= " , user.bop5_usersize AS bop5_usersize ";

  if (
$docolor)
    
$bop5_fields .= " , user.bop5_usercolor AS bop5_usercolor ";


  if (
$showinvisible)
  {
    
$forumstaff $vbulletin->db->query_read_slave("
        SELECT
            user.username, user.usergroupid, user.lastvisit, user.usertitle,
            session.userid, session.inforum, session.lastactivity,
            IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
            
$bop5_fields
        FROM " 
TABLE_PREFIX "session AS session
        LEFT JOIN " 
TABLE_PREFIX "user AS user ON(user.userid = session.userid)
        WHERE session.lastactivity > 
$cooktimeout AND user.usergroupid IN (".$staff_usergroupids .")
        ORDER BY username ASC"
);
  }
  else
  {
    
$forumstaff $vbulletin->db->query_read_slave("
        SELECT
            user.username, (user.options & " 
$vbulletin->bf_misc_useroptions['invisible'] . ") AS invisible, user.usergroupid, user.lastvisit, user.usertitle,
            session.userid, session.inforum, session.lastactivity,
            IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
            
$bop5_fields
        FROM " 
TABLE_PREFIX "session AS session
        LEFT JOIN " 
TABLE_PREFIX "user AS user ON(user.userid = session.userid)
        WHERE session.lastactivity > 
$cooktimeout AND user.usergroupid IN (".$staff_usergroupids .")
        ORDER BY username ASC"
);
  }

  
$bp5i 0;
  while (
$staffon $vbulletin->db->fetch_array($forumstaff))
  {
      
$bp5i++;
      
$userid $staffon['userid'];    
      
$userinfos[$userid] = $staffon;
  }

  if (!
$bp5i//No Staff Online
  
{
      
$userid 0;    
      
$userinfos[$userid] = $staffon;  
      
$staffon['showav'] = 0;
      
$staffon['musername'] = $staffon['username'] = $nostaffuser;
      
$staffon['usertitle'] = $nostaffusertitle;
      
$staffon['none'] = true;
      
$activestaff[0] = $staffon;
  }
  else
  {
    
$activestaff = array();
    foreach (
$userinfos AS $userid => $staffon)
    {
        
fetch_musername($staffon);
        
        
$staffon['none'] = false;
        
$staffon['showav'] = $bopshowav;
        
        if (
$bopshowav)
        {
          require_once(
'./includes/functions_user.php');
          
          
$staffon['avatarurl'] = fetch_avatar_url($staffon['userid']);

          if (!
$staffon['avatarurl']) 
            
$staffon['avatarurl'] = $stylevar['imgdir_misc'] . 'images/misc/unknown.gif'
          else 
          { 
            
$staffon['avatarurl'] = $vbulletin->options['bburl'] . '/' 
            
$staffon['avatarurl'][0];   
          }     
        }

        if (
fetch_online_status($staffon))
        {
            
$staffcount++;
            
$activestaff[$staffcount] = $staffon;
        }
    }
  }

  unset(
$userinfos$staffon);

  
$vbulletin->db->free_result($forumstaff);

  
$staffsarray = array('activestaff'    => $activestaff); 

  return 
$staffsarray;

Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02362 seconds
  • Memory Usage 1,848KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete