vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   IF conditionals in postbit (https://vborg.vbsupport.ru/showthread.php?t=268991)

Simon Lloyd 08-23-2011 08:54 AM

IF conditionals in postbit
 
Hi all, for some strange reason i cannot get the below to show the individual tables based on usergroup, it always shows the first condition (shows the table with Pic1 as the background) for all the usergroups shown in the code below, it doesn't show for any other usergroups
HTML Code:

<if condition="is_member_of($bbuserinfo, 6)">
<table background="http://www.mysite.com/images/pic1.png">
<tr><td height="23" width="147"></td></tr>
</table>
<else />
<if condition="is_member_of($bbuserinfo, 5)">
<table background="http://www.mysite.com/images/pic2.png">
<tr><td height="23" width="172"></td></tr>
</table>
<else />
<if condition="is_member_of($bbuserinfo, 7)">
<table background="http://www.mysite.com/images/pic3.png">
<tr><td height="23" width="109"></td></tr>
</table>
<else />
<if condition="is_member_of($bbuserinfo, 11)">
<table background="http://www.mysite.com/images/pic4.png">
<tr><td height="23" width="299"></td></tr>
</table>
</if>

Any ideas?

Badshah93 08-23-2011 09:59 AM

try

PHP Code:

$post 

in place of

PHP Code:

$bbuserinfo 


Simon Lloyd 08-23-2011 11:05 AM

I don't think thats right, although out of desperation i did try it :), still no go!

kh99 08-23-2011 11:28 AM

If you're talking about the user group of the poster then it should be $post instead of $bbuserinfo. $bbuserinfo will be the info for the viewing user (and so would be the same for every post).

I don't see anything wrong with what you have except that I think you'd need a </if> for each <if>, so you'd need 3 more </if>s at the end.

Simon Lloyd 08-23-2011 03:43 PM

Thanks for that, the idea is anyone viewing the posts will see the table with the background pic, so if i did it for you (your title is advisor) everyone would see (under your signature) the pic for you but not under theirs, like here at vb.org where it shows if you are developer or coder....etc

as for the </if>(s) i thought i only needed one because of the use of <else />.

Thanks for the replies.

--------------- Added [DATE]1314118699[/DATE] at [TIME]1314118699[/TIME] ---------------

Doh! just worked it out! :)


All times are GMT. The time now is 04:04 PM.

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.01178 seconds
  • Memory Usage 1,723KB
  • 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
  • (1)bbcode_html_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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