PDA

View Full Version : Conditional image in postbit, viewable only to moderators?


anthroforum
12-11-2008, 05:50 PM
Hi all, simple question I think,

I want an image to show in one particular user's postbit;

and

Only moderator usergroup should be able to see that image.

RLShare
12-11-2008, 08:51 PM
Use template conditionals.....

<if condition="is_moderator() and $post[userid]==TheUsersUserId">
<img src=yourimage.gif/>
</if>

Im pretty sure thats what it would be off the top of my head.

anthroforum
12-12-2008, 11:52 AM
Error:

The following template conditional expression contains function calls:

<if condition="is_moderator() and $post[userid]==107">

Function Name Usage in Expression
is_moderator is_moderator()

With a few exceptions, function calls are not permitted in template conditional expressions. Please go back and re-write this expression.

The following functions are allowed in template conditional expressions:
in_array() is_array() is_numeric() isset() empty() defined() array() can_moderate() can_moderate_calendar() exec_switch_bg() is_browser() is_member_of()


The postbit code:

<if condition="is_moderator() and $post[userid]==107"><img src="images/buttons/edit.gif"></if>

Lynne
12-12-2008, 02:36 PM
I would not use is_moderator (I think he meant can_moderate). I'd do it by usergroup id.

<if condition="is_member_of($bbuserinfo, 5, 6, 7) and $post[userid]==107">That will show something to all users in group 5, 6, and 7 when they see a post by userid 107.

Gio~Logist
12-12-2008, 03:02 PM
That'll work, but keep in mind that not all moderators are added to a usergroup (whether primary or secondary). Depends on the setup.

Lynne
12-12-2008, 03:04 PM
So would you suggest using can_moderate() instead? I've always put my moderators in moderator groups, so that is why I would use the method I suggested if I were to do something like this.

anthroforum
12-12-2008, 04:00 PM
So would you suggest using can_moderate() instead? I've always put my moderators in moderator groups, so that is why I would use the method I suggested if I were to do something like this.

Yes, that worked for me :up: