The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Trying to add the following to functions.php
PHP Code:
![]() 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:
|
#2
|
|||
|
|||
![]()
Normally you can not use any other then the default conditionals in template.
|
#3
|
||||
|
||||
![]() 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. |
#4
|
||||
|
||||
![]()
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 ![]() |
#5
|
||||
|
||||
![]() 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. ![]() ![]() |
#6
|
||||
|
||||
![]() Quote:
![]() That's what makes this place great, the fact that people are prepared to help others get their heads around the code. |
#7
|
||||
|
||||
![]()
kall, i know hat ya mean, it's great.
![]() Looking for a little help now. ![]() Here is the revised code. PHP Code:
Because i use the conditional HTML Code:
<if condition="is_os('windows')"> code here </if> 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? |
#8
|
|||
|
|||
![]()
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. |
#9
|
||||
|
||||
![]() Quote:
![]() I'm still very much a noobie when it comes to this stuff. |
#10
|
|||
|
|||
![]() PHP Code:
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|