From b35debf8d504ac258b521e8b2ff99596aa59026e Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Tue, 21 Aug 2007 10:25:57 +0000 Subject: [PATCH] Allow variying template 'okey' --- include/functions_config.inc.php | 10 ++++++++-- include/functions_smarty.inc.php | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/functions_config.inc.php b/include/functions_config.inc.php index 3b55656..a133583 100644 --- a/include/functions_config.inc.php +++ b/include/functions_config.inc.php @@ -1969,10 +1969,15 @@ function serendipity_setFormToken($type = 'form') { * @param array Referenced variable coming from the config.inc.php file, where the config values will be stored in * @return array Final return array with default values */ -function &serendipity_loadThemeOptions(&$template_config) { +function &serendipity_loadThemeOptions(&$template_config, $okey = '') { global $serendipity; + + if (empty($okey)) { + $okey = $serendipity['template']; + } + $_template_vars =& serendipity_db_query("SELECT name, value FROM {$serendipity['dbPrefix']}options - WHERE okey = 't_" . serendipity_db_escape_string($serendipity['template']) . "'", false, 'assoc', false, 'name', 'value'); + WHERE okey = 't_" . serendipity_db_escape_string($okey) . "'", false, 'assoc', false, 'name', 'value'); if (!is_array($_template_vars)) { $template_vars = array(); } else { @@ -1988,6 +1993,7 @@ function &serendipity_loadThemeOptions(&$template_config) { return $template_vars; } + /** * Check if a member of a group has permissions to execute a plugin * diff --git a/include/functions_smarty.inc.php b/include/functions_smarty.inc.php index e0d4152..4d86fcf 100644 --- a/include/functions_smarty.inc.php +++ b/include/functions_smarty.inc.php @@ -903,7 +903,7 @@ function serendipity_smarty_init($vars = array()) { $template_vars =& $template_loaded_config; $serendipity['smarty']->assign_by_ref('template_option', $template_vars); } elseif (is_array($template_config)) { - $template_vars =& serendipity_loadThemeOptions($template_config); + $template_vars =& serendipity_loadThemeOptions($template_config, $serendipity['smarty_vars']['template_option']); $serendipity['smarty']->assign_by_ref('template_option', $template_vars); } } -- 2.39.5