vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=168)
-   -   Conditional image in postbit, viewable only to moderators? (https://vborg.vbsupport.ru/showthread.php?t=198628)

anthroforum 12-11-2008 05:50 PM

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.

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:

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>

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.

HTML Code:

<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

Quote:

Originally Posted by Lynne (Post 1683897)
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:


All times are GMT. The time now is 08:36 AM.

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.00952 seconds
  • Memory Usage 1,726KB
  • 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
  • (3)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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