It doesn't make a difference.
This Works
PHP Code:
require_once(DIR . '/includes/adminfunctions_template.php');
$tt = $db->query_first("SELECT * FROM ah_media WHERE mediaid = '1' ");
$done = compile_template($getfield['fieldXX']);
eval('$show = "' . $done . '" ;');
echo $show;
I tested it out and added
die(); in the column and it parses it as text
I'm not that good when it comes to writing tutorials but can you understand it OK?
================================================== ==============
This tutorial will show you how to return data from a column you've created and parse template conditionals.
PHP Code:
<?php
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'my_script');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();
// get special data templates from the datastore
$specialtemplates = array();
// pre-cache templates used by all actions
$globaltemplates = array();
// pre-cache templates used by specific actions
$actiontemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once('./global.php');
//You must include this in order to parse HTML based conditionals
require_once(DIR . '/includes/adminfunctions_template.php');
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
//First we need to query the table.
$sql = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "my_table WHERE column = 'X' ");
//Now we need to convert the HTML based conditionals to PHP based
eval('$done = "' . compile_template($sql['my_field']) . '" ;');
//Print the results to the screen
echo $done;
?>
I have tested the security and it returns dangerous code as plain text. This means that no one can do mischievous actions towards your forums.
================================================== ==============