X-Git-Url: http://git.vanrenterghem.biz/www.vanrenterghem.biz.git/blobdiff_plain/4b1ce0d83844cfd7c55e75a60ccb239882cd62e3..83ab5456767602f2a9860a7db7247f002ec96945:/phpBB2/admin/xs_style_config.php diff --git a/phpBB2/admin/xs_style_config.php b/phpBB2/admin/xs_style_config.php deleted file mode 100644 index ad1215f..0000000 --- a/phpBB2/admin/xs_style_config.php +++ /dev/null @@ -1,189 +0,0 @@ -xs_version) || $template->xs_version !== 8) -{ - message_die(GENERAL_ERROR, isset($lang['xs_error_not_installed']) ? $lang['xs_error_not_installed'] : 'eXtreme Styles mod is not installed. You forgot to upload includes/template.php'); -} - -define('IN_XS', true); -include_once('xs_include.' . $phpEx); - -$tpl = isset($HTTP_POST_VARS['tpl']) ? $HTTP_POST_VARS['tpl'] : (isset($HTTP_GET_VARS['tpl']) ? $HTTP_GET_VARS['tpl'] : ''); -$filename = $phpbb_root_path . 'templates/' . $tpl . '/xs_config.cfg'; - -if(empty($tpl)) -{ - xs_error($lang['xs_invalid_style_name']); -} -if(!@file_exists($filename)) -{ - // remove from config - $config_name = 'xs_style_' . $tpl; - $sql = "DELETE FROM " . CONFIG_TABLE . " WHERE config_name='" . addslashes($config_name) . "'"; - $db->sql_query($sql); - // recache config table for cat_hierarchy 2.1.0 - if(isset($GLOBALS['config']) && is_object($GLOBALS['config'])) - { - global $config; - $config->read(true); - } - $template->assign_block_vars('left_refresh', array( - 'ACTION' => append_sid('index.' . $phpEx . '?pane=left') - )); - xs_error($lang['xs_invalid_style_name']); -} - -// get configuration -$style_config = array(); -include($filename); -$data = $template->get_config($tpl, false); -for($i=0; $i $value1) - { - $list[] = $var1; - } - $value = implode(',', $list); - } - else - { - $value = isset($HTTP_POST_VARS['cfg_' . $var]) ? stripslashes($HTTP_POST_VARS['cfg_' . $var]) : 0; - } - $data[$var] = $value; - } - // update config - $str = $template->_serialize($data); - $config_name = 'xs_style_' . $tpl; - if(isset($board_config[$config_name])) - { - $sql = "UPDATE " . CONFIG_TABLE . " SET config_value='" . addslashes($str) . "' WHERE config_name='" . addslashes($config_name) . "'"; - } - else - { - $sql = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('" . addslashes($config_name) . "', '" . addslashes($str) . "')"; - } - $db->sql_query($sql); - $board_config[$config_name] = $str; - // recache config table for cat_hierarchy 2.1.0 - if(isset($config) && is_object($config)) - { - $config->read(true); - } -} - - -// show form -$last_cat = ''; -for($i=0; $iassign_block_vars('item', array( - 'VAR' => 'cfg_' . $var, - 'VALUE' => htmlspecialchars($data[$var]), - 'DEF' => $item['default'], - 'TYPE' => $item['type'], - 'TEXT' => htmlspecialchars($item['text']), - 'EXPLAIN' => isset($item['explain']) ? $item['explain'] : '', - )); - if($item['type'] === 'select') - { - foreach($item['selection'] as $var1 => $value1) - { - $template->assign_block_vars('item.select', array( - 'VALUE' => htmlspecialchars($var1), - 'TEXT' => htmlspecialchars($value1), - 'SELECTED' => $data[$var] === $var1 ? 1 : 0, - )); - } - } - if($item['type'] === 'list') - { - $values = explode(',', $data[$var]); - foreach($item['selection'] as $var => $value) - { - $selected = false; - for($j=0; $jassign_block_vars('item.list', array( - 'VALUE' => htmlspecialchars($var), - 'TEXT' => htmlspecialchars($value), - 'SELECTED' => $selected, - )); - $num++; - } - } - if(!empty($item['cat']) && $item['cat'] !== $last_cat) - { - $template->assign_block_vars('item.cat', array( - 'TEXT' => htmlspecialchars($item['cat']) - )); - $last_cat = $item['cat']; - } -} - -$template->assign_vars(array( - 'TPL' => htmlspecialchars($tpl), - 'U_FORM' => 'xs_style_config.'.$phpEx.'?sid='.$userdata['session_id'], - )); - -$template->assign_block_vars('nav_left',array('ITEM' => '» ' . $lang['xs_style_configuration'] . ': ' . $tpl . '')); - -$template->set_filenames(array('body' => XS_TPL_PATH . 'style_config.tpl')); -$template->pparse('body'); -xs_exit(); - -?> \ No newline at end of file