vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   vBulletin Forum Sideblocks - Current Staff Online Forum Sideblock and CMS Widget by BOP5 (https://vborg.vbsupport.ru/showthread.php?t=284617)

BirdOPrey5 07-10-2013 09:23 PM

Quote:

Originally Posted by findingpeace (Post 2432729)
This is great! Is there any way to get the # of Staff currently online? For example, in the block title "Staff Online (#)"

I imagine this must be a SQL query or plugin somewhere. Any help would really be appreciated!

I will see about integrating this into a future version but for now...

Edit the Forum Blocks PHP code...

find
Code:

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

  return $staffsarray;

Near the bottom

and replace both lines with these 3 lines:

Code:

  $nums = "($bp5i)";

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

  return $staffsarray;



Then in the template block_staff_online_bop5

Find the 2nd instance of:

Code:

{vb:rawphrase bop5_staff_online}
and add

Code:

{vb:raw content.nums}
right after it, include a space between them.

snakes1100 07-22-2013 08:07 PM

BOP, how about the ability/option to remove the user title?

Nice add for the Total online call.

craigvm 08-07-2013 05:05 PM

i`ve got this installed on my side block but i`ve noticed after a while no staff are showing online when i`m allways online but if i uninstall and install again it shows staff online for a while but then not showing again any idea , i had this on another site and worked fine tho

BirdOPrey5 08-17-2013 12:06 PM

There is no reason installing/uninstalling should change anything. I would suspect whatever the issue it's with sessions on your site, not caused by this mod.

Amaury 08-17-2013 08:15 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2439318)
There is no reason installing/uninstalling should change anything. I would suspect whatever the issue it's with sessions on your site, not caused by this mod.

Yes, I agree. It's most likely to do with whatever he has the Session Timeout option set to because of caching with the staff online block.

For example, we have the Session Timeout option set to one hour on KH-Flare. If I'm inactive for over an hour and then reload the index, I will not see myself. I have the cache time set for one minute for the staff block, so if I reload the index a few minutes later, I will see myself again.

SPEEDKILLZ 11-02-2013 04:21 PM

1 Attachment(s)
Love the mod but i get this? And it dont show any staff? Suggestions?

franzes80 11-02-2013 07:20 PM

I have the same problem as SPEEDKILLZ on vb 4.2.2

ozzy47 11-02-2013 07:24 PM

You probably did not change the Template to Use field from block_html to block_staff_online_bop5

That would give you the Array results.

franzes80 11-02-2013 07:27 PM

Thank you ozzy47.Working now

ozzy47 11-02-2013 07:30 PM

Not a problem, glad to help. :)

SPEEDKILLZ 11-03-2013 08:06 PM

1 Attachment(s)
Quote:

Originally Posted by ozzy47 (Post 2457852)
Not a problem, glad to help. :)


I got it to show but it is all messed up. Including the boarders?

ozzy47 11-03-2013 08:08 PM

I don't see it on your site, so it is impossible for me to see what is going on.

SPEEDKILLZ 11-03-2013 08:13 PM

Quote:

Originally Posted by ozzy47 (Post 2458045)
I don't see it on your site, so it is impossible for me to see what is going on.

Sorry here i will enable

ozzy47 11-03-2013 08:22 PM

Did you add the css to your additional.css template?

SPEEDKILLZ 11-03-2013 08:27 PM

Quote:

Originally Posted by ozzy47 (Post 2458049)
Did you add the css to your additional.css template?

Yes sir

SPEEDKILLZ 11-03-2013 08:30 PM

This code

Code:


.bop5staffimg {
  max-width: 40px;
  max-height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0 4px 2px 0;
  float: left;
}

.bop5staffli {
  height: 42px;
}

.bop5staffol {
  padding: 1px;
}

.bop5staffuser {
  font-size: 110%;
}

.bop5staffhr {
  display: none;
}


ozzy47 11-03-2013 08:37 PM

If I am not mistaken that is the TF_Ideal_Blue style.

The issue there is, the skin developer had to add <div class="clear"></div> to all the default sideblocks, which adds clear:both to the element basically a glorified, forced linebreak.

That is not standard coding, so of course any sideblocks that are coded to vBulletin default will look off in those styles.

To solve it you need to open the additional.css for each of the styles and find, #sidebar_container .blocksubhead,
#sidebar_container .blocksubhead.smaller


There you will see something like this:

HTML Code:

#sidebar_container .blocksubhead,
#sidebar_container .blocksubhead.smaller {
    background: {vb:stylevar notices_shadow_color} url({vb:stylevar imgdir_misc}/head_bg.png) repeat-x top;
    color: {vb:stylevar blockhead_color};
    font-family: {vb:stylevar blockhead_font};
    font-weight: normal;
    font-size: 20px;
    font-weight: normal;
    text-transform: uppercase;
    text-shadow: 0 0 0 transparent, 0px 1px 0px #000000;
    padding: 4px 10px;
    height: auto !important;
    border-left: 1px solid #dddddd;
    border-top: 1px solid #dddddd;
    border-right: 1px solid #dddddd;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    background-clip: padding-box;
}

After the last entry, before the } add the following:

HTML Code:

overflow: hidden;
That should fix it for you.

SPEEDKILLZ 11-03-2013 08:46 PM

Like a charm ozzy. Thank you

ozzy47 11-03-2013 08:47 PM

Not a problem, I only know about this because I have dealt with that style before, and already had figured out how to fix it. :)

SPEEDKILLZ 11-03-2013 08:49 PM

Well i am glad you are a advisor here. You are a huge help :) Now you can look at my latest post in more share option lol

cshellworld 12-02-2013 11:54 PM

4.2.1 installed , rating 5 , nominated
thanks

RedTrinity 01-29-2014 08:09 AM

Hi, just installed this for the first time, followed the instructions, getting this SQL error when I activate the block, which messes up the forum:

Quote:

Database error in vBulletin 4.2.2:

Invalid SQL:

SELECT
user.username, user.usergroupid, user.lastvisit, user.usertitle,
session.userid, session.inforum, session.lastactivity,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid

FROM redtrin_session AS session
LEFT JOIN redtrin_user AS user ON(user.userid = session.userid)
WHERE session.lastactivity > 1390984366 AND user.usergroupid IN ()
ORDER BY username ASC;

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
ORDER BY username ASC' at line 8
I've double checked everything, can't seem to work out where the problem is. Help!

:)

warfield 02-27-2014 12:37 PM

:( i dont know how to edit additional.css

Meler 03-01-2014 05:10 PM

You can add sorting displayed groups?

edgeless 03-13-2014 02:24 AM

I've just installed this. How do you change the block title 'Current Staff Online' to something else? Changing the title in the 'edit block' form makes no difference.

ozzy47 03-13-2014 02:26 AM

Try changing the phrase bop5_staff_online

edgeless 03-13-2014 03:08 AM

Oh yeah. Thanks :)

ozzy47 03-13-2014 03:13 AM

Not a problem, glad to help. :)

edgeless 03-13-2014 02:58 PM

Well, here's one issue that I'm noticing... the current settings within the provided additional.css code tend to squeeze the larger avatars to the point of image distortion. For example, we have some staff avatars that are 180px × 120px and they end up looking very squeezed within the sidebar.

The actual aspect ratios of member avatars can however be preserved by changing max-width: 40px; to max-width: 60px; ...however, that misaligns the usernames and titles because they are each positioned the same distance from their respective multiple-width avatars.

So my choices seem to be: 1) accept the overly squeezed larger avatars, 2) accept the misaligned usernames, or 3) disable the display of avatars within this sideblock mod. The first two options don't look quite right. Playing around a bit, I've found that I can adjust the padding directive from 4px to, say, 24px. This will move the usernames farther toward the center of the sideblock. But unfortunately they are still misaligned.

I've noticed that various other sideblocks I add to the sidebar will auto-reduce avatar size proportionally in order to preserve aspect ratio and retain alignment of the text margin points. Can this somehow be done for this sideblock mod as well? And if not, is there any other solution that will allow the usernames and title text to line up while retaining the aspect ratios for larger avatars?

Other than this issue, I really love the mod!

Thanks

edgeless 03-13-2014 08:31 PM

Update:
I've changed the max-width to 54 pixels ...while it's not perfect, I think I can live with it if there's no other available solution.

Marcin1 07-15-2014 02:28 PM

How to reorder of the groups displayed? I've got Mod currently on top, Admin below.

Mark_Zuckerberg 08-12-2014 11:58 PM

how to create site block to show staff online i am also using your add on sidebar everywhere after installing this mod edited its settings but when i go to forum block i cant see any block of staff online to create?

ozzy47 08-13-2014 12:02 AM

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;



Mark_Zuckerberg 08-13-2014 12:13 AM

YAAAAYYYYYY!!!!

after posting that code which you have mentioned is working fine.... by the way that code is not mentioned in the readme file nor on the post page? it must be added iznt that? thanks much much for the help you are great

ozzy47 08-13-2014 12:15 AM

It is in the text document that came with this mod, it is named, Staff Online Sideblock & Widget by BOP5 Install

Mark_Zuckerberg 08-13-2014 12:25 AM

True sorry my bad i appologize i didnt scrooled down till end :/ thats why it occurs thank you dear

ozzy47 08-13-2014 12:26 AM

It's cool, it happens to all of us at some point. :)

Buzzle 08-16-2014 03:11 PM

Any idea why i'm getting a databaser error?

Code:

Invalid SQL:

        SELECT
            user.username, user.usergroupid, user.lastvisit, user.usertitle,
            session.userid, session.inforum, session.lastactivity,
            IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
            , user.bop5_userfont AS bop5_userfont
        FROM vB_session AS session
        LEFT JOIN vB_user AS user ON(user.userid = session.userid)
        WHERE session.lastactivity > 1408204549 AND user.usergroupid IN (13,14,5,7,6,-1)
        ORDER BY username ASC;

MySQL Error  : Unknown column 'user.bop5_userfont' in 'field list'


CAG CheechDogg 08-16-2014 03:28 PM

Bummer..even with the update this still doesn't work for me ...I get the following error:

Warning: Invalid argument supplied for foreach() in [path]/includes/class_core.php(4606) : eval()'d code on line 12

CAG CheechDogg 08-16-2014 04:24 PM

Any idea about this BOP5? ....


All times are GMT. The time now is 09:14 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.01401 seconds
  • Memory Usage 1,878KB
  • 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
  • (6)bbcode_code_printable
  • (2)bbcode_html_printable
  • (1)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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