Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 02 Jan 2009, 22:11
MTGDarkness MTGDarkness is offline
 
Join Date: Dec 2008
HTML <if>?

How do you use this? I can't find any guides, or indeed anything about the <if> tag anywhere outside the actual code of forum software itself! I'm trying to work an if clause into a template modification (iTrader based), and I just need to know the correct usage of <if>... Does it have to be
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

? Or could it be
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

?

And what about else options?
Reply With Quote
  #2  
Old 03 Jan 2009, 00:25
TriggerHappy123 TriggerHappy123 is offline
 
Join Date: Jan 2009
I'm not sure if html has if's but javascript does. this may help, you can integrate it with html.
Reply With Quote
  #3  
Old 03 Jan 2009, 00:27
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
The syntax is:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This is a vBulletin-only HTML "tag" -- it is parsed out by PHP when the template is evaluated. You can't just throw it in an HTML document.
__________________
Former vBulletin.org Staff Member

Please feel free to re-use any of the code in any of my projects submitted to vB.org, so long as original attribution is retained.
Reply With Quote
  #4  
Old 03 Jan 2009, 00:29
MTGDarkness MTGDarkness is offline
 
Join Date: Dec 2008
That's what I thought. But all the time I see

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

, and that makes no sense to me...
Reply With Quote
  #5  
Old 03 Jan 2009, 00:32
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
In PHP, $var is the same as isset($var) which returns TRUE if $var exists and FALSE if it does not.

So--

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Will display "Stuff to do" when $var exists.
__________________
Former vBulletin.org Staff Member

Please feel free to re-use any of the code in any of my projects submitted to vB.org, so long as original attribution is retained.
Reply With Quote
  #6  
Old 03 Jan 2009, 01:01
MTGDarkness MTGDarkness is offline
 
Join Date: Dec 2008
Oh, I see. Thanks. I'm going to try out my template modification and see if it works...

Last edited by MTGDarkness; 03 Jan 2009 at 01:31.
Reply With Quote
  #7  
Old 03 Jan 2009, 01:04
sparklywater sparklywater is offline
 
Join Date: Jun 2008
see this tutorial for vB conditionals: http://www.vbulletin.com/docs/html/

type in 'template conditionals' in the search box and click on first link.
Reply With Quote
  #8  
Old 03 Jan 2009, 01:24
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
The condition between the two quotes is parsed as a boolean expression.

Originally Posted by PHP Manual
When converting to boolean, the following values are considered FALSE:
  • the boolean FALSE itself
  • the integer 0 (zero)
  • the float 0.0 (zero)
  • the empty string, and the string "0"
  • an array with zero elements
  • an object with zero member variables (PHP 4 only)
  • the special type NULL (including unset variables)
  • SimpleXML objects created from empty tags
Every other value is considered TRUE (including any resource).
Usually in templates, you'd check the value of options or user settings. Unless you really understand the above, it's best to use comparisons to avoid mix ups.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

etc.
__________________
Sr Software Developer / Tech Lead
Reply With Quote
  #9  
Old 03 Jan 2009, 01:37
MTGDarkness MTGDarkness is offline
 
Join Date: Dec 2008
Thanks for the help guys. Modification works great.
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove HTML tags from thread preview (good for HTML-enabled forums especially) Gary King vBulletin 3.0 Full Releases 16 12 Jun 2004 14:30



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 02:15.

Layout Options | Width: Wide Color: