News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Passing BBCode info into a function

Started by finalhit, October 23, 2005, 05:37:00 PM

Previous topic - Next topic

finalhit

i just switched to SMF so i'm not quite familiar with how it works, but i think i figured out how to make simple BBcodes.

i'm trying to make something like this

[testsql]Test[/testsql]

where i want to search for the value "test" from a certain table in my database. i know how to do all that, so i set up a function somewhere in Subs.php that i'm going to call when needs be

so i set up this on the code list

array(
'tag' => 'testsql',
'type' => 'unparsed_content',
'content' => test_func('$1'),
'disabled_after' => ' ($1)',
),


however, it seems when i use the '$1' SMF uses, the values are pasted much later on, and the string '$1' is what gets passed on into the function, thus the function doesn't work as intended.

is there anyway i can pull out the value and pass it directly into the function?

Oldiesmann

Try using test_func($data) or test_func($1) instead
Michael Eshom
Christian Metal Fans

Advertisement: