Log in

View Full Version : Admins only can see?


silvermerc
08-31-2008, 11:52 PM
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:
<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
Use this in the template:
<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
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
<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.