![]() |
Adding Template Conditionals to vB.
Trying to add the following to functions.php
PHP Code:
http://upload.nemesisforums.net/./us...b_error_01.png Are there other files I need to edit to add template conditionals? And a second question. is the 'if' in the code above correct? This: PHP Code:
|
Normally you can not use any other then the default conditionals in template.
|
Quote:
Is there way I can add what i'm trying to do to say is_browser? it's basically an os specific conditional, so i can use some plugin that require certain operating systems. |
You have to add the function to an array defined somewhere in adminfunctions_template.php
Give me 1 min and I will edit this post with the exact name and place :) In adminfunctions_template.php find: PHP Code:
PHP Code:
Kall wrote the thread, but I was the one to put him on the right track to find this code :p |
Quote:
thanks! :) Alright, that allows me to use the template conditional, now All i need to do is figure out why it's not working. :p well kinda working, but it's not showing for any os listed in the code. :D |
Quote:
That's what makes this place great, the fact that people are prepared to help others get their heads around the code. |
kall, i know hat ya mean, it's great. :)
Looking for a little help now. :p Here is the revised code. PHP Code:
Because i use the conditional HTML Code:
<if condition="is_os('windows')"> Now I know I'm in windows. and I know is_browser('ie') works. did i miss something in the code?? I used exosting vB code as a model (specifically is_browser) do i need to add the user agent strings to the code as they have in is_browser? |
Hmm maybe i am missing something, but i can't see where the incoming string 'windows' ($os) is being tested against the detected os. The function should return a TRUE or FALSE.
Just try your function first with a test script, without templates, just call it from a plain php testfile. Much easier to debaug. |
Quote:
I'm still very much a noobie when it comes to this stuff. |
PHP Code:
|
All times are GMT. The time now is 10:51 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|