![]() |
News flash: conditionals rock
I've been porting vBMS to vB3 and am working on the navbar. Previously it took me a ton of regular expressions and multiple templates, but check it out:
Code:
<if condition="$iscurrentscript"><b><else /><a href="$filename?$session[sessionurl]"></if> Only problem is that it doesn't let you use custom functions. You can only use built-in ones like empty(), isset(), etc. :( |
wait a min... didnt we talk about a hack like this once O_O?
I could make something like this pretty easy if you wanted it..or do you have it already? Adding functions wouldnt be that hard, just list the ones you think would be useful. |
I know a hack like this exists for vB2, but vB3's are already painless. :)
Also, IIRC the validation is only done when you make the template from the admin CP. Directly in the database, it won't be validating anything ;) |
in template.php there is a list of all allowed functions in template conditionals.
as for vb.org's vb3 i was already forced to add some functions to the list. it's just as a security issue, if you'd allow DB changing functions the admin securitysystem would be useless... |
Well I'm assuming that phpinclude is disabled in such a case as well...
|
soon you wont even need to learn PHP to make fuull web applications. @_@
|
Mmmm conditionals. :D
|
Conditionals are great. In fact, what took multiple custom templates now all resides in the templates "memberinfo" or in "modify" using simple REQUEST variables. :)
|
All times are GMT. The time now is 01:06 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|