Code: Select all
{if $template_option.file =='true'}
{include file="myfile.php"}
{/if}
Code: Select all
{if $template_option.file =='true'}
{include file="myfile.php"}
{/if}
Code: Select all
if($template_loaded_config['file']) { do something }
Code: Select all
if($template_loaded_config['file'] == 'true') { do something }
Code: Select all
$template_global_config = array('navigation' => true);
$template_loaded_config = serendipity_loadThemeOptions($template_config, $serendipity['smarty_vars']['template_option'], true);
serendipity_loadGlobalThemeOptions($template_config, $template_loaded_config, $template_global_config);
Code: Select all
array(
'var' => 'sitenav_footer',
'name' => SITENAV_FOOTER,
'type' => 'boolean',
'default' => 'true'
),
Code: Select all
if($template_loaded_config['include_file'] == 'true') {
include ("config.file1.php");
} else {
include ("config.file2.php");
}
Code: Select all
$var = $template_loaded_config['text']
Yes, load your php files at the end of your config.inc.php - after the $template_loaded_config var! ... and within a function you might need to hand it over:Don Chambers wrote:Is there a way to make $template_loaded_config available within a function of an included file?
Code: Select all
function xy($tlc) { $text = $tlc['text']; }
$foo = xy($template_loaded_config);
Code: Select all
function serendipity_plugin_api_pre_event_hook($event, &$bag, &$eventData, &$addData) {
//blah blah blah
// what I want to do is this, where $template_loaded_config['my_text'] is just a simple string:
$eventData[$entryIdx]['extended'] = $template_loaded_config['my_text'];
}
Code: Select all
function serendipity_plugin_api_pre_event_hook($event, &$bag, &$eventData, &$addData) {
global $template_loaded_config;
// blah blah
$eventData[$entryIdx]['extended'] = $template_loaded_config['my_text'];
Code: Select all
serendipity_plugin_api::hook_event('backend_display', $template_loaded_config);