vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   What can I test using template <if condition> ? (https://vborg.vbsupport.ru/showthread.php?t=257439)

richy96 01-19-2011 08:56 PM

What can I test using template <if condition> ?
 
Hi

Having done a lot of playing around with vbulletin php files I'm now having a good go at messing about with templates ;)

I'm Sorry if this has been asked before but the forum search will not allow two character search for 'if condition' so it is hard to find the information I am looking for and this stuff is probably very basic

So can someone tell me what conditions I can check in a template using <if condition>

For example can I do things like

<if condition $post[blahblah]=="something"> <tr><td>$somevariable</td></tr></if>
<if condition $post[blahblah]=="something else"> <tr><td>$someothervariable</td></tr></if>


Also is there some construct like <if condition> do this <else if condition> do that </if> available to me

Finally can I embed php in templates using.......
<?php .
do all this crazy stuff
?> tags

...... and use the embedded php to manipulate globals or other variables and arrays that were available in the vbulletin php file at the time the template was called, then output the results - to save editing the php file itself?

Cheers

Rich

Lynne 01-19-2011 09:15 PM

Check the articles forums and look for an article with the word "condition*" (note the wildcard!) in the title.

richy96 01-20-2011 08:42 AM

Spot on

Thanks


All times are GMT. The time now is 09:44 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.01330 seconds
  • Memory Usage 1,704KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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