vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   limit viewing of "currently active users" (https://vborg.vbsupport.ru/showthread.php?t=237410)

45wheelgun 03-03-2010 06:07 PM

limit viewing of "currently active users"
 
I would like to limit the viewing of the list of "currently active users" on the main forum page to 3 user groups only (admin/mod/supermod). I can't seem to find a switch in the settings or a hack on vbulletin.org that addresses this need.

Seem like the syntax shouldn't be to hard, but I don't trust myself to not screw it up. Can someone give me the short answer? IE: add the following to thisorthat template before/after thisorthat code.

Thanks,
Dave

--------------- Added [DATE]1267702664[/DATE] at [TIME]1267702664[/TIME] ---------------

Bump to the top. I am assuming this is just a conditional wrapped around the existing code. Can some one throw me a bone?

ChopSuey 03-04-2010 12:41 PM

Use IF Condition to show to the usergroups that you want. But if they go to yousite.com/online.php they will still be able to see it.

swiper the fox 03-04-2010 03:49 PM

AdminCP ---- Usergroups----Usergroup Manager
Edit usergroup & find:

Who's Online Permissions

Can View Who's Online Yes No <=== choose here whether you want viewing or not

is this what you are looking for ?

45wheelgun 03-04-2010 05:37 PM

Quote:

Originally Posted by ChopSuey (Post 1996876)
Use IF Condition to show to the usergroups that you want. But if they go to yousite.com/online.php they will still be able to see it.

I have online.php turned off based on user group permissions.

I am referring to the "currently active users" list that appears on the forum home page in the "What's going on" area. My moderators and I find that a handy tool, but we don't want it visible to the public. Unlike the online.php, "currently active users" only has an "on/off" switch in the adminCP, it doesn't appear in the user group permissions.

I was hoping someone could point me to the template I need to edit. I am thinking it is the forum home template. I think I only need to edit the "logged in" section as I have it turned off for visitors. I was hoping for someone to point me to the section of code that need the If Condition in front of it and the /IF at the end, along with the proper syntax to make it happen.

Thank you for the replies everyone.

Dave

--------------- Added [DATE]1267731761[/DATE] at [TIME]1267731761[/TIME] ---------------

Quote:

Originally Posted by swiper the fox (Post 1997065)
Can View Who's Online Yes No <=== choose here whether you want viewing or not

is this what you are looking for ?

Actually, no, but thanks. I have that turned off for the user groups, but I am referring to the list that appears in the "What is going on?" section. I have that list set so it only shows to people who are logged in, but i want to restrict it even more and only show it to Mods/Admins.

borbole 03-04-2010 08:16 PM

Find that part where logged in users is defined and place it inside the if conditional:

<if condition="is_member_of($bbuserinfo, 5,6,7)">the code here</if> and it should do the trick.

I don''t use vb 3 but if you would post the appropriate code here I will make the changes for you.

45wheelgun 03-04-2010 11:37 PM

Thank you for the replies. I think this is the code I need from the forumhome template. Hopefully someone here can confirm I have the correct spot:

PHP Code:

<if condition="$show['loggedinusers']">
<!-- 
logged-in users -->
<
tbody>
    <
tr>
        <
td class="thead" colspan="2">
            <
a style="float:$stylevar[right]href="#top" onclick="return toggle_collapse('forumhome_activeusers')"><img id="collapseimg_forumhome_activeusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_activeusers].gif" alt="" border="0" /></a>
            <
a href="online.php$session[sessionurl_q]">$vbphrase[currently_active_users]</a>: $totalonline (<phrase 1="$numberregistered2="$numberguest">$vbphrase[x_members_and_y_guests]</phrase>)
        </
td>
    </
tr>
</
tbody>
<
tbody id="collapseobj_forumhome_activeusers" style="$vbcollapse[collapseobj_forumhome_activeusers]">
    <
tr>
        <
td class="alt2"><a href="online.php$session[sessionurl_q]"><img src="$stylevar[imgdir_misc]/whos_online.gif" alt="$vbphrase[view_whos_online]border="0" /></a></td>
        <
td class="alt1" width="100%">
            <
div class="smallfont">
                <
div style="white-space: nowrap"><phrase 1="$recordusers2="$recorddate3="$recordtime">$vbphrase[most_users_ever_online_was_x_y_at_z]</phrase></div>
                <
div>$activeusers</div>
            </
div>
        </
td>
    </
tr>
</
tbody>
<!-- 
end logged-in users -->
</if> 


ChopSuey 03-05-2010 04:29 AM

NO you have the correct spot.
Here ya go
HTML Code:

<if condition="is_member_of($bbuserinfo, 5,6,7)">
<if condition="$show['loggedinusers']">
<!-- logged-in users -->
<tbody>
    <tr>
        <td class="thead" colspan="2">
            <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_activeusers')"><img id="collapseimg_forumhome_activeusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_activeusers].gif" alt="" border="0" /></a>
            <a href="online.php$session[sessionurl_q]">$vbphrase[currently_active_users]</a>: $totalonline (<phrase 1="$numberregistered" 2="$numberguest">$vbphrase[x_members_and_y_guests]</phrase>)
        </td>
    </tr>
</tbody>
<tbody id="collapseobj_forumhome_activeusers" style="$vbcollapse[collapseobj_forumhome_activeusers]">
    <tr>
        <td class="alt2"><a href="online.php$session[sessionurl_q]"><img src="$stylevar[imgdir_misc]/whos_online.gif" alt="$vbphrase[view_whos_online]" border="0" /></a></td>
        <td class="alt1" width="100%">
            <div class="smallfont">
                <div style="white-space: nowrap"><phrase 1="$recordusers" 2="$recorddate" 3="$recordtime">$vbphrase[most_users_ever_online_was_x_y_at_z]</phrase></div>
                <div>$activeusers</div>
            </div>
        </td>
    </tr>
</tbody>
<!-- end logged-in users -->
</if>
</if>


borbole 03-05-2010 08:48 AM

That should do it.


All times are GMT. The time now is 11:47 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.01003 seconds
  • Memory Usage 1,765KB
  • 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
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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