The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
Hello everyone, I am trying to wrap a SQL query with a function to later pass as a variables into one of my templates. Whenever I run this simple query (for example to get the number of the contest) not wrapped as a function, it returns the value fine (which is 1). The following works perfect:
PHP Code:
PHP Code:
PHP Code:
![]() Thanks for your time everyone. |
|
#2
|
|||
|
|||
|
I think maybe global.php doesn't work right when included inside a function. You could do this:
PHP Code:
)
|
|
#3
|
|||
|
|||
|
Quote:
Thanks for your help ![]() --------------- Added [DATE]1312478868[/DATE] at [TIME]1312478868[/TIME] --------------- OK well almost works . It works but it displays the value at the top left corner of every page of that script... Any ideas why this would be happening? This the plugin I am using: PHP Code:
|
|
#4
|
||||
|
||||
|
Because you use echo. You can't use echo to output things in vB properly. You need to register the variable for template use.
|
|
#5
|
|||
|
|||
|
Quote:
I know I can use return instead of echo but how do you register a function as a variable for use in a template? It took me a while to get the functions to work properly but now I can't use them in the template. I am using this plugin:PHP Code:
PHP Code:
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|