The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
passing arguements to function
I have a simple function in my includes/functions.php file. it requires 2 arguements (userid, forumid).
I am trying to make a template conditional that uses this function where do the userid and forumid get passed to this function? any help with this would be great because i am super noob to templates thanks eric |
#2
|
||||
|
||||
Without a few exceptions (like can_moderate() or in_array()) you can't use functions in Templates!
|
#3
|
||||
|
||||
thanks
I realize you are quite limited in what you can do in the template conditionals. But how do the arguements get passed to say, the following function, found in /inludes/functions.php? PHP Code:
|
#4
|
||||
|
||||
PHP Code:
|
#5
|
|||
|
|||
Just to make things a bit clear. You are now talking about a php-script, not about a template.
|
#6
|
||||
|
||||
Thanks but I am still lost. Let me be more specific.
I have this function (which I didn't write) which is in my inludes/function.php. what it is supposed to do is check if the user has started a thread in forum number 10. PHP Code:
Can someone help me with this? Thanks! Eric |
#7
|
||||
|
||||
1) The function does what it is supposed to do
2) You can't use this function in Template conditionals |
#8
|
||||
|
||||
I realize i cant use it in a template conditional. But can i use the result of this function in a template conditional?
|
#9
|
||||
|
||||
Yes.
Calll it in a PHP file like PHP Code:
HTML Code:
<if condition="$hasposted"> stuff here </if> |
#10
|
||||
|
||||
i think we are getting closer.
I put this in my functions.php file: PHP Code:
HTML Code:
<if condition="$hasposted"> <tr> <td class="vbmenu_option" align="left">Not Posted</td> </tr> <else /> <tr> <td class="vbmenu_option" align="left">Posted</td> </tr> </if> |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|