The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Run PHP from database
Good afternoon,
What do I need to do to get some php code that is stored in the database to not just display as text, but to execute? I have a field (samplecode) in one of my tables that needs to run similar to the plugin code but it is stored in a different table. In the php in the file, I have a database query which is pulling all the relevant data $toolkit = $db->query_first(xxx); Should there be in the plugin system something where I do something like: ob_start(); $toolkit.samplecode; $html .= ob_get_contents(); ob_clean(); and then call the plugin from within the template with {vb:raw samplecode} --------------- Added [DATE]1395152452[/DATE] at [TIME]1395152452[/TIME] --------------- Found it. I was close, no need to mess with the plugin system at all, I was just missing a little bit Code:
ob_start(); eval ($toolkit['samplecode']); $samplecode = ob_get_contents(); ob_clean(); $templater->register('samplecode', $samplecode); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|