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)
-   -   $post['usergroupid'] and <if> Questions (https://vborg.vbsupport.ru/showthread.php?t=159322)

UberMensch 10-02-2007 09:13 PM

$post['usergroupid'] and <if> Questions
 
I'm trying to do this in the postbit_legacy:

Code:

<if condition="$post['usergroupid'] == 8"> (If the post OWNER's usergroup id is 8)
  <!-- HTML here -->
<else />
  <!-- More Code -->
</if>

I'm pretty sure the "$post['usergroupid']" part is wrong. Is there a list of all the $post/$bbuserinfo variables?

Also, which conditions are allowed in the <if> statements? Are they similar/the same as php?

Freesteyelz 10-03-2007 02:19 AM

Conditional for Usergroup is:

Code:

<if condition="is_member_of($bbuserinfo, x,y,z)">
  <!-- HTML here -->
<else />
  <!-- More Code -->
</if>

Just change the x,y,z to the Usergroup ID's. Remove the extras. :)

Dismounted 10-03-2007 05:20 AM

Code:

<if condition="is_member_of($post, x,y,z)">
  <!-- HTML here -->
<else />
  <!-- More Code -->
</if>

I believe he was wanting to base it off the poster (as he is editing postbit_legacy).

Freesteyelz 10-03-2007 06:27 AM

Ahh...I see. :)

UberMensch 10-03-2007 08:42 AM

Thanks very much! So conditions are basically the same as php?

Also, what other things can I use with $post?

Dismounted 10-03-2007 09:39 AM

Whatever's in the post array. Also, keep in mind there is no "else if" template condition, due to the format of which vBulletin parses them.

Dankness 10-03-2007 10:16 AM

Quote:

Originally Posted by Dismounted (Post 1352004)
Whatever's in the post array. Also, keep in mind there is no "else if" template condition, due to the format of which vBulletin parses them.

can't you nest a if inside of a else like this thou? I haven't found the need to test the theory but i belive it possible
PHP Code:

<if condition="this">
  Do 
Something
<else />
 <if 
condition="that"
   
Do Something Else
 </if>
</if> 


Dismounted 10-03-2007 11:10 AM

Yes, you can nest conditionals, but they aren't "true" else ifs.

Freesteyelz 10-04-2007 01:09 AM

Quote:

Originally Posted by Dankness (Post 1352024)
can't you nest a if inside of a else like this thou? I haven't found the need to test the theory but i belive it possible
PHP Code:

<if condition="this">
  Do 
Something
<else />
 <if 
condition="that"
   
Do Something Else
 </if>
</if> 


I've been doing something like that for such things as an avatar. If Flash then custom avatar is overrided; if custom avatar then default avatar is overrided; if Flash and custom avatar is false then default avatar will display.

mem0ries 11-16-2007 01:20 PM

how come it doesnt work for me ?

i'm editing it inside postbit_legacy,

i code this, but cant .
PHP Code:

<if condition="is_member_of($post, 8,9,10)">
  <!-- 
HTML here -->
</if> 

any idea how to code it?
when it show, it will become Group: (the group you are in)


All times are GMT. The time now is 08:30 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.01193 seconds
  • Memory Usage 1,738KB
  • 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_code_printable
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete