![]() |
looking for conditional [if usergroupID = ... show this to all users]
Hi,
In postbit template, I need a conditional to show something to all users if usergroupID who posted it = admin, if usergroupID=moderator show something else. Anyone knows what conditional that is? Thanks |
Here is a basic one for you ;)
Code:
<if condition="$bbuserinfo[usergroupid] == XX"> |
I'm thinking he meant the posters group, not the viewers group is the trigger.
Anywho, I don't think the poster group in in there, but ya can make a hook and preprocess with something like... if( is_member_of(6,$post[userid]) ) $is_admin = true; if( is_member_of(7,$post[userid])) $is_mod = true; There may be better ways. |
Quote:
But I need the one where in the posters post (based on usergroups) it shows something only in their posts. Thanks anyway. Quote:
|
In the showthread_postbit_create hook put the code.
PHP Code:
PHP Code:
|
Quote:
Why not just do this? Code:
<if condition="is_member_of(6,$post[userid])"> |
Because I forgot I can run that function in the template. DOH!
Thanks P.S. My code does work though. I wonder which is more processing, the hook code parsing or the template code parsing? Or if it may even matter. It's nice to know the overhead and code around it if ya can, but I have nothing to go by. |
Quote:
Fatal error: Only variables can be passed by reference in /home/account/domains/mydomain.com/public_html/forum/showthread.php(1031) : eval()'d code on line 19 Quote:
Andreas posted the right conditional for this purpose once but I cant find his post anymore :( Ok basically what I want to achieve is this: https://vborg.vbsupport.ru/showthrea...30#post1003930 |
You should actually use ;
HTML Code:
<if condition="is_member_of($post,6)"> HTML Code:
<if condition="is_member_of($post,5,6,7)"> |
Great thanks Paul! :D
|
All times are GMT. The time now is 06:26 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|