|
From: Jon O. <jon...@us...> - 2007-06-04 21:14:14
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14991/includes Modified Files: mx_functions_admincp.php mx_functions_core.php mx_functions_phpbb.php mx_functions_style.php Log Message: Added custom styles for pages Added style selection for the adminCP Index: mx_functions_core.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_core.php,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** mx_functions_core.php 16 May 2007 19:18:23 -0000 1.43 --- mx_functions_core.php 4 Jun 2007 21:14:02 -0000 1.44 *************** *** 366,369 **** --- 366,371 ---- pag.page_name, pag.page_icon, + pag.default_style, + pag.override_user_style, pag.page_header, pag.page_footer, *************** *** 410,413 **** --- 412,417 ---- "page_name" => $row['page_name'], "page_icon" => $row['page_icon'], + "default_style" => $row['default_style'], + "override_user_style" => $row['override_user_style'], "page_header" => $row['page_header'], "page_footer" => $row['page_footer'], *************** *** 2483,2486 **** --- 2487,2492 ---- var $page_title = ''; var $page_icon = ''; + var $default_style = '-1'; + var $override_user_style = '-1'; var $page_ov_header = ''; var $page_ov_footer = ''; *************** *** 2535,2538 **** --- 2541,2547 ---- $this->page_icon = $this->info['page_icon']; + $this->default_style = $this->info['default_style'] == -1 ? ($portal_config['default_style']) : ( $this->info['default_style'] ); + $this->override_user_style = $this->info['override_user_style'] == -1 ? ($portal_config['override_user_style'] == 1 ? true : false ) : ( $this->info['override_user_style'] == 1 ? true : false ); + $this->page_ov_header = !empty($this->info['page_header']) && file_exists($mx_root_path . TEMPLATE_ROOT_PATH . $this->info['page_header']) ? $this->info['page_header'] : $portal_config['overall_header']; $this->page_ov_footer = !empty($this->info['page_footer']) && file_exists($mx_root_path . TEMPLATE_ROOT_PATH . $this->info['page_footer']) ? $this->info['page_footer'] : $portal_config['overall_footer']; Index: mx_functions_style.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_style.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** mx_functions_style.php 7 May 2007 19:25:12 -0000 1.11 --- mx_functions_style.php 4 Jun 2007 21:14:02 -0000 1.12 *************** *** 260,266 **** function _init_userprefs() { ! global $userdata, $board_config, $theme, $images; global $template, $lang, $phpEx, $phpbb_root_path, $mx_root_path, $db; global $nav_links; if ( $userdata['user_id'] != ANONYMOUS ) --- 260,267 ---- function _init_userprefs() { ! global $userdata, $board_config, $portal_config, $theme, $images; global $template, $lang, $phpEx, $phpbb_root_path, $mx_root_path, $db; global $nav_links; + global $mx_page; if ( $userdata['user_id'] != ANONYMOUS ) *************** *** 268,272 **** if ( !empty($userdata['user_lang'])) { - //$board_config['default_lang'] = $userdata['user_lang']; // See simpler lang select code below $default_lang = phpbb_ltrim(basename(phpbb_rtrim($userdata['user_lang'])), "'"); } --- 269,272 ---- *************** *** 354,389 **** } - /* Note: This is a simpler "working" version. phpBB 2.0.21 introduced above code instead. - // - // Is the lang installed? - // - if ( !file_exists($mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx) || !file_exists($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx)) - { - $board_config['default_lang'] = 'english'; - } - // ! // Include phpBB and mxBB lang keys // ! include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx); ! include($mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx); - // - // Include Admin lang keys - // if ( defined('IN_ADMIN') ) { ! if( !file_exists($mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx) || !file_exists($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx) ) ! { ! $board_config['default_lang'] = 'english'; ! } ! ! include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx); ! include($mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx); } - */ // ! // Set up demo style // if ( isset($_GET['demo_theme']) || isset($_COOKIE['demo_theme'])) --- 354,382 ---- } // ! // Build Portal style // ! $portal_config['default_admin_style'] = $portal_config['default_admin_style'] == -1 ? $board_config['default_style'] : $portal_config['default_admin_style']; ! $portal_config['default_style'] = $portal_config['default_style'] == -1 ? $board_config['default_style'] : $portal_config['default_style']; ! $portal_config['override_user_style'] = $portal_config['override_user_style'] == -1 ? $board_config['override_user_style'] : $portal_config['override_user_style']; if ( defined('IN_ADMIN') ) { ! $init_style = $portal_config['default_admin_style']; // Use subSilver (if installed) ! $init_override = 1; ! } ! else if (isset($mx_page)) ! { ! $init_style = $mx_page->default_style; ! $init_override = $mx_page->override_user_style; ! } ! else ! { ! $init_style = $portal_config['default_style']; ! $init_override = $portal_config['override_user_style']; } // ! // Setup demo style // if ( isset($_GET['demo_theme']) || isset($_COOKIE['demo_theme'])) *************** *** 398,404 **** // ! // Set up style // ! if ( !$board_config['override_user_style'] ) { if ( $userdata['user_id'] != ANONYMOUS && $userdata['user_style'] > 0 ) --- 391,397 ---- // ! // Setup style // ! if ( !$portal_config['override_user_style'] ) { if ( $userdata['user_id'] != ANONYMOUS && $userdata['user_style'] > 0 ) *************** *** 412,416 **** } ! $style = isset($_POST['default_style']) ? intval($_POST['default_style']) : $board_config['default_style']; $theme = $this->_setup_style($style); --- 405,409 ---- } ! $style = isset($_POST['default_style']) ? intval($_POST['default_style']) : $init_style; $theme = $this->_setup_style($style); Index: mx_functions_phpbb.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_phpbb.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** mx_functions_phpbb.php 30 May 2007 21:31:03 -0000 1.30 --- mx_functions_phpbb.php 4 Jun 2007 21:14:02 -0000 1.31 *************** *** 768,774 **** * @return string (html) */ ! function mx_style_select($default_style, $select_name = "style", $dirname = "templates") { ! global $db; $sql = "SELECT themes_id, style_name --- 768,774 ---- * @return string (html) */ ! function mx_style_select($default_style, $select_name = "style", $dirname = "templates", $show_instruction = false) { ! global $db, $lang; $sql = "SELECT themes_id, style_name *************** *** 781,787 **** $style_select = '<select name="' . $select_name . '">'; while ( $row = $db->sql_fetchrow($result) ) { ! $selected = ( $row['themes_id'] == $default_style ) ? ' selected="selected"' : ''; $style_select .= '<option value="' . $row['themes_id'] . '"' . $selected . '>' . $row['style_name'] . '</option>'; --- 781,792 ---- $style_select = '<select name="' . $select_name . '">'; + if ($show_instruction) + { + $selected1 = ( $default_style == -1 ) ? ' selected="selected"' : ''; + $style_select .= '<option value="-1"' . $selected1 . '>' . $lang['Select_page_style'] . '</option>'; + } while ( $row = $db->sql_fetchrow($result) ) { ! $selected = ( $row['themes_id'] == $default_style && !$selected1) ? ' selected="selected"' : ''; $style_select .= '<option value="' . $row['themes_id'] . '"' . $selected . '>' . $row['style_name'] . '</option>'; Index: mx_functions_admincp.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_admincp.php,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** mx_functions_admincp.php 13 May 2007 20:33:04 -0000 1.35 --- mx_functions_admincp.php 4 Jun 2007 21:14:01 -0000 1.36 *************** *** 334,337 **** --- 334,339 ---- $page_desc = $mx_request_vars->post('page_desc', MX_TYPE_NO_TAGS | MX_TYPE_SQL_QUOTED, ''); $page_icon = $mx_request_vars->post('menuicons', MX_TYPE_NO_TAGS | MX_TYPE_SQL_QUOTED, ''); + $default_style = $mx_request_vars->post('mx_default_style', MX_TYPE_INT, '-1'); + $override_user_style = $mx_request_vars->post('mx_override_user_style', MX_TYPE_INT, '-1'); $page_header = $mx_request_vars->post('page_header', MX_TYPE_NO_TAGS | MX_TYPE_SQL_QUOTED, ''); $page_footer = $mx_request_vars->post('page_footer', MX_TYPE_NO_TAGS | MX_TYPE_SQL_QUOTED, ''); *************** *** 368,372 **** } ! $sql = "INSERT INTO " . PAGE_TABLE . " ( page_id, page_name, page_desc, page_icon, auth_view, page_header, page_footer, page_main_layout, navigation_block, ip_filter, phpbb_stats ) VALUES ( '" . $page_id_new . "', '" . $page_name . "', --- 370,374 ---- } ! $sql = "INSERT INTO " . PAGE_TABLE . " ( page_id, page_name, page_desc, page_icon, auth_view, default_style, override_user_style, page_header, page_footer, page_main_layout, navigation_block, ip_filter, phpbb_stats ) VALUES ( '" . $page_id_new . "', '" . $page_name . "', *************** *** 374,377 **** --- 376,381 ---- '" . $page_icon . "', '" . $auth_view . "', + '" . $default_style . "', + '" . $override_user_style . "', '" . $page_header . "', '" . $page_footer . "', *************** *** 922,925 **** --- 926,931 ---- $page_desc = $mx_request_vars->post('page_desc', MX_TYPE_NO_TAGS | MX_TYPE_SQL_QUOTED, ''); $page_icon = $mx_request_vars->post('menuicons', MX_TYPE_NO_TAGS | MX_TYPE_SQL_QUOTED, ''); + $default_style = $mx_request_vars->post('mx_default_style', MX_TYPE_INT, '-1'); + $override_user_style = $mx_request_vars->post('mx_override_user_style', MX_TYPE_INT, '-1'); $page_header = $mx_request_vars->post('page_header', MX_TYPE_NO_TAGS | MX_TYPE_SQL_QUOTED, ''); $page_footer = $mx_request_vars->post('page_footer', MX_TYPE_NO_TAGS | MX_TYPE_SQL_QUOTED, ''); *************** *** 945,948 **** --- 951,956 ---- page_desc = '$page_desc', page_icon = '$page_icon', + default_style = '$default_style', + override_user_style = '$override_user_style', page_header = '$page_header', page_footer = '$page_footer', |