vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Admins only can see? (https://vborg.vbsupport.ru/showthread.php?t=189682)

silvermerc 08-31-2008 11:52 PM

Admins only can see?
 
Say if i wanted something like so admins could only see it in the post bit, what code would i put ontop, Like how its done so admins can only see infractions?
Please help asap.
Ross

Lynne 09-01-2008 02:10 AM

Use this in the template:
HTML Code:

<if condition="is_member_of($bbuserinfo,x)">
 Stuff for members of usergroup x
</if>

(If I recall, default admin usergroup is 5.)

Twilkey 09-01-2008 02:19 AM

Quote:

Originally Posted by Lynne (Post 1611642)
Use this in the template:
HTML Code:

<if condition="is_member_of($bbuserinfo,x)">
 Stuff for members of usergroup x
</if>

(If I recall, default admin usergroup is 5.)

Defauly Admin id is 6 not 5.

Lynne 09-01-2008 02:28 AM

Quote:

Originally Posted by Twilkey (Post 1611652)
Defauly Admin id is 6 not 5.

I couldn't remember and can't get to my site right now since the host is doing some network upgrades, so thanks for correcting that!

Twilkey 09-01-2008 02:30 AM

There are alot of upgrades happening to servers lately. On one of the sites that I admin, The host just completely switched servers.

Anyway, yeah its 6 and you are welcome.

silvermerc 10-27-2008 11:45 AM

<if condition="is_member_of($bbuserinfo,149)">
$timespentonline
</if>

It doesnt work 149 is secondary admins btw :P

snakes1100 10-27-2008 11:54 AM

<if condition="in_array($bbuserinfo[usergroupid], array(6,5))">

silvermerc 10-27-2008 11:56 AM

So how do i include $timespentonline in?

snakes1100 10-27-2008 11:58 AM

<if condition="in_array($bbuserinfo[usergroupid], array(6,5))">
$timespentonline
</if>

DJ-Snoop 10-27-2008 12:13 PM

It still doesn't work that code still displays the code to everyone.

snakes1100 10-27-2008 01:58 PM

Then your doing something wrong on your end, both those codes work correctly.

Lynne's version is actually the new functionality in vb, versus mine, its from the 3.6.x tree of vb.

Lynne 10-27-2008 02:34 PM

Why don't you print out the template code you are using.... give us about five lines above to five lines below your added code. And tell us the template name. I really can't think of why that code would show it to everyone (unless everyone is also a member of usergroupid 149). a link to the page (with test account info, if needed) would also help.

DJ-Snoop 10-27-2008 02:51 PM

Code:

                                <if condition="$show['infraction']"><div>$vbphrase[infractions]: $post[warnings]/$post[infractions] ($post[ipoints])</div></if>
                                <if condition="$show['reputation']"><if condition="$show['reppower']">$vbphrase[reppower]: <span id="reppower_$post[postid]_$post[userid]">$post[reppower]</span> </if><div><span id="repdisplay_$post[postid]_$post[userid]">$post[reputationdisplay]</span></div></if>
<if condition="in_array($bbuserinfo[usergroupid], array(6,5))">
$timespentonline
</if>                        $template_hook[postbit_userinfo_right]
                                <div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div>
                        </div>

        </td>

http://www.hhgs.net/showthread.php?p=64471#post64471

Lynne 10-27-2008 03:50 PM

Try using this line instead:
<if condition="is_member_of($bbuserinfo,5,6)">

Also, verify what you usergroupid 5 and 6 are used for (only admins and supermods?). And what template did you add the code to? If you added it to the postbit, then that is incorrect since you are using postbit_legacy.

silvermerc 10-27-2008 03:59 PM

Yeh its for postbit.

DJ-Snoop 10-27-2008 04:00 PM

I'm adding to postbit_legacy and I'll try that code now. I'll edit this when ive done it.

Added the code and it still doesn't work.


All times are GMT. The time now is 03:16 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.01005 seconds
  • Memory Usage 1,743KB
  • 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_code_printable
  • (2)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (16)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