Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Design and Graphics Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 10-02-2007, 09:13 PM
UberMensch UberMensch is offline
 
Join Date: Jun 2006
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default $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?
Reply With Quote
  #2  
Old 10-03-2007, 02:19 AM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 10-03-2007, 05:20 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #4  
Old 10-03-2007, 06:27 AM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ahh...I see.
Reply With Quote
  #5  
Old 10-03-2007, 08:42 AM
UberMensch UberMensch is offline
 
Join Date: Jun 2006
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Also, what other things can I use with $post?
Reply With Quote
  #6  
Old 10-03-2007, 09:39 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 10-03-2007, 10:16 AM
Dankness Dankness is offline
 
Join Date: Nov 2006
Location: Myrtle Beach,SC
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
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> 
Reply With Quote
  #8  
Old 10-03-2007, 11:10 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, you can nest conditionals, but they aren't "true" else ifs.
Reply With Quote
  #9  
Old 10-04-2007, 01:09 AM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dankness View Post
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.
Reply With Quote
  #10  
Old 11-16-2007, 01:20 PM
mem0ries mem0ries is offline
 
Join Date: Feb 2007
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:00 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08996 seconds
  • Memory Usage 2,253KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (3)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete