vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=221040

Template <if> tag
by zethon
16 Aug 2009 22:16

I have a personal project going on and I'm trying to develop a template system similar to the one vBulletin uses.

One thing has me stumped. I want to use the <if> tag in my templates, but they never get parsed. I looked in the vb code for some help, but I can't see anything that much different from vb is doing and what I'm doing to cause this.

What is it in the vb that 'allows' the parsing to the <if> tag?

The code I'm using to import that template and print it looks like:


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


Dismounted 17 Aug 2009 07:21

Template conditionals are transformed into ternary operations (in the current version of vBulletin). The "template" is then evaluated.

The following:

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

Is transformed into:

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


zethon 17 Aug 2009 09:36

Quote:

Originally Posted by Dismounted (Post 1868953)
Template conditionals are transformed into ternary operations (in the current version of vBulletin). The "template" is then evaluated.

The following:

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

Is transformed into:

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

Where is this transformation happening?

Dismounted 17 Aug 2009 12:30

The template is transformed into raw PHP and stored in the database, therefore, it is actually done when you save the template.


All times are GMT. The time now is 03:30.

Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.