Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-13-2009, 09:58 PM
mostafa megahed mostafa megahed is offline
 
Join Date: Dec 2008
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default why [if conditions] not working in my new template in my style ?

i've aded a new template to my vb style

and when i put [if condition] like :

PHP Code:
<if condition="$show['member']">
</if> 
it's not working !!!!
Reply With Quote
  #2  
Old 01-13-2009, 11:26 PM
Bellardia Bellardia is offline
 
Join Date: Jul 2007
Location: Hamilton, Ontario
Posts: 378
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It should work, what template are you putting this in?
Reply With Quote
  #3  
Old 01-14-2009, 02:36 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Depending on where you are calling this template from, that variable may not be available.
Reply With Quote
  #4  
Old 01-14-2009, 03:28 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You may want to try this instead (as above, it may not be available in some templates):
Code:
<if condition="$bbuserinfo['userid'] != 0">
Reply With Quote
  #5  
Old 01-14-2009, 05:17 AM
mostafa megahed mostafa megahed is offline
 
Join Date: Dec 2008
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Bellardia View Post
It should work, what template are you putting this in?
Quote:
Originally Posted by Lynne View Post
Depending on where you are calling this template from, that variable may not be available.
thanks Mr Bellardia, Mr Lynne,

there is template i've add it and called it in 'Fourmhome'
and i want to show some contains in this template

in my template 'mytemp' i write this code : [just example]

PHP Code:
<if condition="$show['member']">
<
strong><phrase 1="$bbuserinfo[username]2="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[welcome_x_link_y]</phrase></strong>
<else />
please login ....
</if> 
the same thing in 'navbar' template


Quote:
Originally Posted by Dismounted View Post
You may want to try this instead (as above, it may not be available in some templates):
Code:
<if condition="$bbuserinfo['userid'] != 0">
thanks Mr Dismounted,
i try to use this but it dosn't work for me,
and what if i want to display contains to multi-userid ? [if this code work by another way]

alot of thanks to all of you
Reply With Quote
  #6  
Old 01-14-2009, 05:23 AM
OH-Shoot OH-Shoot is offline
 
Join Date: Jan 2009
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The problem is the phrase isn't available in forumhome template I dont think.

Try this

Code:
<if condition="$show[member]">
<strong>Welcome <a href="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$bbuserinfo[username]</a>
</strong>
</if>
Reply With Quote
  #7  
Old 01-14-2009, 05:28 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mostafa megahed View Post
and what if i want to display contains to multi-userid ?
This will display "Hi" to people with user IDs 1, 2 and 3.
Code:
<if condition="in_array($vbulletin->userinfo['userid'], array(1, 2, 3))">Hi</if>
PS. You may want to know that Lynne is a girl.
Reply With Quote
  #8  
Old 01-14-2009, 05:32 AM
mostafa megahed mostafa megahed is offline
 
Join Date: Dec 2008
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by OH-Shoot View Post
The problem is the phrase isn't available in forumhome template I dont think.

Try this

Code:
<if condition="$show[member]">
<strong>Welcome <a href="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$bbuserinfo[username]</a>
</strong>
</if>
thanks Mr OH-Shoot,

But i think the problem not in my code because it is just example , i was try with semple words, but the the same problem i've ..

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

Quote:
Originally Posted by Dismounted View Post
This will display "Hi" to people with user IDs 1, 2 and 3.
Code:
<if condition="in_array($vbulletin->userinfo['userid'], array(1, 2, 3))">Hi</if>
PS. You may want to know that Lynne is a girl.
1st, thanks 4 ur PS , Sorry Lynne ...

i try ur code mr but it didn't work for me ...

what i should to do now ?
Reply With Quote
  #9  
Old 01-14-2009, 01:37 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mostafa megahed View Post
i try ur code mr but it didn't work for me ...

what i should to do now ?
Are you sure that the template is being evaled? Is anything printing out from the template you added? Did you add it to the array of $globaltemplates in your php page?
Reply With Quote
Reply


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 04:36 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.05040 seconds
  • Memory Usage 2,261KB
  • Queries Executed 13 (?)
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
  • (6)bbcode_code
  • (2)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete