| The Arcive of vBulletin Modifications Site. | |
| 
			 
			#1  
			
			
			
			
			
		 | |||
| 
 | |||
|  Conditional image in postbit, viewable only to moderators? 
			
			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. | 
| 
			 
			#2  
			
			
			
			
			
		 | |||
| 
 | |||
|   
			
			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. | 
| 
			 
			#3  
			
			
			
			
			
		 | |||
| 
 | |||
|   
			
			Error: HTML Code: 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: HTML Code: <if condition="is_moderator() and $post[userid]==107"><img src="images/buttons/edit.gif"></if> | 
| 
			 
			#4  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			I would not use is_moderator (I think he meant can_moderate).  I'd do it by usergroup id. HTML Code: <if condition="is_member_of($bbuserinfo, 5, 6, 7) and $post[userid]==107"> | 
| 
			 
			#5  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			That'll work, but keep in mind that not all moderators are added to a usergroup (whether primary or secondary). Depends on the setup.
		 | 
| 
			 
			#6  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			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.
		 | 
| 
			 
			#7  
			
			
			
			
			
		 | |||
| 
 | |||
|   
			
			Yes, that worked for me :up:
		 | 
|  | 
| 
 | 
 | 
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
| 
 | |
|  More Information | |
| Template Usage: 
 Phrase Groups Available: 
 | Included Files: 
 Hooks Called: 
 |