|
From: Jon O. <jon...@us...> - 2007-09-09 16:48:27
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8466/includes Modified Files: mx_constants.php mx_functions_blockcp.php mx_functions_ch.php mx_functions_core.php mx_functions_phpbb.php mx_functions_style.php mx_functions_tools.php page_header.php Added Files: template.php Log Message: Ok, massive update for 2.9.x. Index: mx_functions_ch.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_ch.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mx_functions_ch.php 30 Jan 2007 16:26:07 -0000 1.8 --- mx_functions_ch.php 9 Sep 2007 16:48:16 -0000 1.9 *************** *** 34,38 **** define('RUN_CH_INSTALL', true); } ! $board_config = &$config->data; // let's run the upgrade script --- 34,38 ---- define('RUN_CH_INSTALL', true); } ! $board_config = $config->data; // let's run the upgrade script Index: mx_functions_blockcp.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_blockcp.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** mx_functions_blockcp.php 7 May 2007 19:25:11 -0000 1.18 --- mx_functions_blockcp.php 9 Sep 2007 16:48:16 -0000 1.19 *************** *** 248,254 **** 'BLOCK_DESC' => ( $block_desc != '' ) ? ' - ' . $block_desc : '', ! 'U_BLOCK_SETTINGS' => append_sid(PORTAL_URL . "admin/admin_mx_blockcp.$phpEx?block_id=$block_id"), ! 'U_BLOCK_DELETE' => append_sid(PORTAL_URL . "admin/admin_mx_block.$phpEx?mode=delete_block&block_id=$block_id"), ! 'U_BLOCK_PERMISSIONS' => append_sid(PORTAL_URL . "admin/admin_mx_block_auth.$phpEx?cat_id=$block_id"), 'E_BLOCK_TITLE' => $block_title, --- 248,254 ---- 'BLOCK_DESC' => ( $block_desc != '' ) ? ' - ' . $block_desc : '', ! 'U_BLOCK_SETTINGS' => mx_append_sid(PORTAL_URL . "admin/admin_mx_blockcp.$phpEx?block_id=$block_id"), ! 'U_BLOCK_DELETE' => mx_append_sid(PORTAL_URL . "admin/admin_mx_block.$phpEx?mode=delete_block&block_id=$block_id"), ! 'U_BLOCK_PERMISSIONS' => mx_append_sid(PORTAL_URL . "admin/admin_mx_block_auth.$phpEx?cat_id=$block_id"), 'E_BLOCK_TITLE' => $block_title, *************** *** 354,358 **** $message_delete = $lang['Delete_block'] . ' - ' . $block_title . '<br /><br />' . $lang['Delete_block_explain'] ! . '<br /><br />' . sprintf($lang['Click_block_delete_yes'], '<a href="' . append_sid($s_action_file . $deletemode) . '">', '</a>') . '<br /><br />'; --- 354,358 ---- $message_delete = $lang['Delete_block'] . ' - ' . $block_title . '<br /><br />' . $lang['Delete_block_explain'] ! . '<br /><br />' . sprintf($lang['Click_block_delete_yes'], '<a href="' . mx_append_sid($s_action_file . $deletemode) . '">', '</a>') . '<br /><br />'; *************** *** 465,472 **** // Get the list of phpBB usergroups // ! $sql = "SELECT group_id, group_name ! FROM " . GROUPS_TABLE . " ! WHERE group_single_user <> " . TRUE . " ! ORDER BY group_name ASC"; if( !($result = $db->sql_query($sql)) ) { --- 465,485 ---- // Get the list of phpBB usergroups // ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! case 'phpbb2': ! $sql = "SELECT group_id, group_name ! FROM " . GROUPS_TABLE . " ! WHERE group_single_user <> " . TRUE . " ! ORDER BY group_name ASC"; ! break; ! case 'phpbb3': ! $sql = "SELECT group_id, group_name ! FROM " . GROUPS_TABLE . " ! WHERE group_name NOT IN ('BOTS', 'GUESTS') ! ORDER BY group_name ASC"; ! break; ! } ! if( !($result = $db->sql_query($sql)) ) { Index: mx_functions_core.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_core.php,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** mx_functions_core.php 6 Aug 2007 21:11:42 -0000 1.52 --- mx_functions_core.php 9 Sep 2007 16:48:16 -0000 1.53 *************** *** 132,135 **** --- 132,187 ---- /** + * Obtain cfg file data + * + * @param unknown_type $theme + * @return unknown + */ + function obtain_cfg_items($theme) + { + global $board_config, $phpbb_root_path; + + $parsed_items = array( + 'theme' => array(), + 'template' => array(), + 'imageset' => array() + ); + + foreach ($parsed_items as $key => $parsed_array) + { + $parsed_array = $this->get('_cfg_' . $key . '_' . $theme[$key . '_path']); + + if ($parsed_array === false) + { + $parsed_array = array(); + } + + $reparse = false; + $filename = $phpbb_root_path . 'styles/' . $theme[$key . '_path'] . '/' . $key . '/' . $key . '.cfg'; + + if (!file_exists($filename)) + { + continue; + } + + if (!isset($parsed_array['filetime']) || (($board_config['load_tplcompile'] && @filemtime($filename) > $parsed_array['filetime']))) + { + $reparse = true; + } + + // Re-parse cfg file + if ($reparse) + { + $parsed_array = mx_parse_cfg_file($filename); + $parsed_array['filetime'] = @filemtime($filename); + + $this->put('_cfg_' . $key . '_' . $theme[$key . '_path'], $parsed_array); + } + $parsed_items[$key] = $parsed_array; + } + + return $parsed_items; + } + + /** * Read. * *************** *** 601,604 **** --- 653,657 ---- if ($type = 'all') { + //if (preg_match('/^(tpl2_|tpl_|sql_|_block_|_page_|data_(?!global))/', $entry)) // Cannot remove tpl cache files currently in use ;) if (preg_match('/^(sql_|_block_|_page_|data_(?!global))/', $entry)) { *************** *** 1069,1072 **** --- 1122,1193 ---- } } + + /** + * Obtain currently listed icons + * + * @return unknown + */ + function obtain_icons() + { + if (($icons = $this->get('_icons')) === false) + { + global $db; + + // Topic icons + $sql = 'SELECT * + FROM ' . ICONS_TABLE . ' + ORDER BY icons_order'; + $result = $db->sql_query($sql); + + $icons = array(); + while ($row = $db->sql_fetchrow($result)) + { + $icons[$row['icons_id']]['img'] = $row['icons_url']; + $icons[$row['icons_id']]['width'] = (int) $row['icons_width']; + $icons[$row['icons_id']]['height'] = (int) $row['icons_height']; + $icons[$row['icons_id']]['display'] = (bool) $row['display_on_posting']; + } + $db->sql_freeresult($result); + + $this->put('_icons', $icons); + } + + return $icons; + } + + /** + * Obtain list of naughty words and build preg style replacement arrays for use by the + * calling script + * + * * @return unknown + */ + function obtain_word_list() + { + global $board_config, $mx_user, $db; + + if (!$mx_user->optionget('viewcensors') && $board_config['allow_nocensors']) + { + return array(); + } + + if (($censors = $this->get('_word_censors')) === false) + { + $sql = 'SELECT word, replacement + FROM ' . WORDS_TABLE; + $result = $db->sql_query($sql); + + $censors = array(); + while ($row = $db->sql_fetchrow($result)) + { + $censors['match'][] = '#(?<!\w)(' . str_replace('\*', '\w*?', preg_quote($row['word'], '#')) . ')(?!\w)#i'; + $censors['replace'][] = $row['replacement']; + } + $db->sql_freeresult($result); + + $this->put('_word_censors', $censors); + } + + return $censors; + } } *************** *** 1412,1416 **** $editor_name_tmp = mx_get_userdata($this->editor_id); $editor_name = $editor_name_tmp['username']; ! $edit_time = create_date( $board_config['default_dateformat'], $this->block_time, $board_config['board_timezone'] ); $layouttemplate->assign_block_vars('layout_column.blocks.block_stats', array( --- 1533,1537 ---- $editor_name_tmp = mx_get_userdata($this->editor_id); $editor_name = $editor_name_tmp['username']; ! $edit_time = phpBB2::create_date( $board_config['default_dateformat'], $this->block_time, $board_config['board_timezone'] ); $layouttemplate->assign_block_vars('layout_column.blocks.block_stats', array( *************** *** 1492,1496 **** // $block_desc = !empty( $this->block_desc ) ? ' (' . $this->block_desc . ')' : ''; ! $edit_url = append_sid( $mx_root_path . $edit_file . "?sid=" . $userdata['session_id'] ); $edit_img = '<input type="image" src="' . $block_edit_img . '" alt="' . $block_edit_alt . ' :: ' . $this->block_title . $block_desc . '" title="' . $block_edit_alt . ' :: ' . $this->block_title . $block_desc . '">'; --- 1613,1617 ---- // $block_desc = !empty( $this->block_desc ) ? ' (' . $this->block_desc . ')' : ''; ! $edit_url = mx_append_sid( $mx_root_path . $edit_file . "?sid=" . $userdata['session_id'] ); $edit_img = '<input type="image" src="' . $block_edit_img . '" alt="' . $block_edit_alt . ' :: ' . $this->block_title . $block_desc . '" title="' . $block_edit_alt . ' :: ' . $this->block_title . $block_desc . '">'; *************** *** 1509,1519 **** ); ! if ($overall_header) ! { ! $layouttemplate->assign_block_vars('editcp', $temp_array); ! } ! else { ! $layouttemplate->assign_block_vars('layout_column.blocks.edit', $temp_array); } } --- 1630,1643 ---- ); ! if (isset($layouttemplate)) { ! if ($overall_header) ! { ! $layouttemplate->assign_block_vars('editcp', $temp_array); ! } ! else ! { ! $layouttemplate->assign_block_vars('layout_column.blocks.edit', $temp_array); ! } } } *************** *** 1941,1945 **** function load_block_parameters( $block_id = false ) { ! global $mx_root_path, $template, $blockcptemplate, $board_config, $theme, $userdata; $return = false; --- 2065,2069 ---- function load_block_parameters( $block_id = false ) { ! global $mx_root_path, $module_root_path, $template, $blockcptemplate, $board_config, $theme, $userdata; $return = false; *************** *** 1957,1961 **** ob_start(); $this->is_panel = false; ! $template = new mx_Template($mx_root_path . $this->module_root_path . 'templates/subSilver', $board_config); switch ( $parameter_data['parameter_type'] ) --- 2081,2085 ---- ob_start(); $this->is_panel = false; ! $template = new mx_Template($mx_root_path . $this->module_root_path . 'templates/' . $theme['template_name']); switch ( $parameter_data['parameter_type'] ) *************** *** 2532,2535 **** --- 2656,2660 ---- var $auth_view = false; + var $auth_mod = false; var $auth_ip = false; var $phpbb_stats = '-1'; *************** *** 2711,2714 **** --- 2836,2840 ---- $this->_auth_ary = $this->auth(); $this->auth_view = $this->_auth_ary['auth_view']; + $this->auth_mod = $this->_auth_ary['auth_mod']; $this->auth_ip = $mx_ip->auth($this->info['ip_filter']); *************** *** 2736,2739 **** --- 2862,2937 ---- /** + * Initiate and load page data + * @access private + */ + function sync_configs() + { + global $portal_config, $board_config; + + foreach ($portal_config as $key => $value) + { + $do = true; + switch ($key) + { + // + // Keep phpBB2/phpBB3 cookies, but overwrite internal + // + case 'cookie_domain': + case 'cookie_name': + case 'cookie_path': + case 'cookie_secure': + case 'session_length': + if (PORTAL_BACKEND != 'internal') + { + $do = false; + } + break; + + case 'portal_id': + case 'portal_status': + case 'disabled_message': + case 'default_style': + case 'override_user_style': + case 'default_lang': + case 'script_path': + case 'mx_use_cache': + case 'mod_rewrite': + case 'default_admin_style': + case 'overall_header': + case 'overall_footer': + case 'main_layout': + case 'navigation_block': + case 'top_phpbb_links': + //case 'smilies_path': + case 'portal_version': + case 'portal_recached': + case 'portal_backend': + case 'portal_startdate': + case 'rand_seed': + case 'record_online_users': + case 'record_online_date': + $do = false; + break; + case 'portal_name': + $key = 'sitename'; + break; + + case 'portal_desc': + $key = 'site_desc'; + break; + + case 'portal_desc': + $key = 'site_desc'; + break; + } + + if ($do) + { + $board_config[$key] = $value; + } + } + } + + /** * Enter description here... * *************** *** 2869,2873 **** $template->assign_block_vars( 'navlinks', array( 'PAGE_NAME' => $parent_name, ! 'U_VIEW_PAGE' => append_sid( $this->this_mxurl( 'page=' . $parent_page_id ) ) ) ); } --- 3067,3071 ---- $template->assign_block_vars( 'navlinks', array( 'PAGE_NAME' => $parent_name, ! 'U_VIEW_PAGE' => mx_append_sid( $this->this_mxurl( 'page=' . $parent_page_id ) ) ) ); } *************** *** 2876,2880 **** $template->assign_block_vars( 'navlinks', array( 'PAGE_NAME' => $this->page_rowset[$page_id]['page_name'], ! 'U_VIEW_PAGE' => append_sid( $this->this_mxurl( 'page=' . $this->page_rowset[$page_id]['page_id'] ) ) ) ); --- 3074,3078 ---- $template->assign_block_vars( 'navlinks', array( 'PAGE_NAME' => $this->page_rowset[$page_id]['page_name'], ! 'U_VIEW_PAGE' => mx_append_sid( $this->this_mxurl( 'page=' . $this->page_rowset[$page_id]['page_id'] ) ) ) ); *************** *** 3013,3016 **** --- 3211,3240 ---- /** + * Load file. + * + * Load additional functions/classes. + * + * @access public + * @param string $text + * @param boolean $read_file + */ + function load_file($file = '', $backend = '', $ext = '') + { + global $mx_root_path, $phpbb_root_path, $phpEx; + + $backend = !empty($backend) ? 'shared/' . $backend . '/includes/' : ''; + $ext = !empty($ext) ? $ext : $phpEx; + + if (file_exists($mx_root_path . 'includes/'.$backend.$file.'.'.$ext)) + { + @include_once($mx_root_path . 'includes/'.$backend.$file.'.'.$ext); + } + else + { + @include_once($phpbb_root_path . 'includes/'.$file.'.'.$ext); + } + } + + /** * editcp_exists. * Index: mx_constants.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_constants.php,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** mx_constants.php 30 Jan 2007 16:26:07 -0000 1.24 --- mx_constants.php 9 Sep 2007 16:48:16 -0000 1.25 *************** *** 15,22 **** } ! // ! // Include phpBB constants ! // ! include_once($phpbb_root_path . 'includes/constants.' . $phpEx); /** --- 15,68 ---- } ! // User Levels <- this values are for compatiblility with mxBB 2.8.x and phpBB2 ! // Revove them when mxBB is fixed ! !defined('DELETED') ? define('DELETED', -1) : false; ! !defined('USER') ? define('USER', 0) : false; ! !defined('ADMIN') ? define('ADMIN', 1) : false; ! !defined('MOD') ? define('MOD', 2) : false; ! // User Levels <- this values are for compatiblility with mxBB 2.8.x and phpBB2 ! ! // URL PARAMETERS ! !defined('POST_TOPIC_URL') ? define('POST_TOPIC_URL', 't') : false; ! !defined('POST_CAT_URL') ? define('POST_CAT_URL', 'c') : false; ! !defined('POST_FORUM_URL') ? define('POST_FORUM_URL', 'f') : false; ! !defined('POST_USERS_URL') ? define('POST_USERS_URL', 'u') : false; ! !defined('POST_POST_URL') ? define('POST_POST_URL', 'p') : false; ! !defined('POST_GROUPS_URL') ? define('POST_GROUPS_URL', 'g') : false; ! ! // Page numbers for session handling ! !defined('PAGE_INDEX') ? define('PAGE_INDEX', 0) : false; ! !defined('PAGE_LOGIN') ? define('PAGE_LOGIN', -1) : false; ! !defined('PAGE_SEARCH') ? define('PAGE_SEARCH', -2) : false; ! !defined('PAGE_REGISTER') ? define('PAGE_REGISTER', -3) : false; ! !defined('PAGE_PROFILE') ? define('PAGE_PROFILE', -4) : false; ! !defined('PAGE_VIEWONLINE') ? define('PAGE_VIEWONLINE', -6) : false; ! !defined('PAGE_VIEWMEMBERS') ? define('PAGE_VIEWMEMBERS', -7) : false; ! !defined('PAGE_FAQ') ? define('PAGE_FAQ', -8) : false; ! !defined('PAGE_POSTING') ? define('PAGE_POSTING', -9) : false; ! !defined('PAGE_PRIVMSGS') ? define('PAGE_PRIVMSGS', -10) : false; ! !defined('PAGE_GROUPCP') ? define('PAGE_GROUPCP', -11) : false; ! !defined('PAGE_TOPIC_OFFSET') ? define('PAGE_TOPIC_OFFSET', 5000) : false; ! ! // Auth settings (blockCP) ! !defined('AUTH_LIST_ALL') ? define('AUTH_LIST_ALL', 0) : false; ! !defined('AUTH_ALL') ? define('AUTH_ALL', 0) : false; ! !defined('AUTH_REG') ? define('AUTH_REG', 1) : false; ! !defined('AUTH_ACL') ? define('AUTH_ACL', 2) : false; ! !defined('AUTH_MOD') ? define('AUTH_MOD', 3) : false; ! !defined('AUTH_ADMIN') ? define('AUTH_ADMIN', 5) : false; ! !defined('AUTH_ANONYMOUS') ? define('AUTH_ANONYMOUS', 9) : false; ! ! !defined('AUTH_VIEW') ? define('AUTH_VIEW', 1) : false; ! !defined('AUTH_READ') ? define('AUTH_READ', 2) : false; ! !defined('AUTH_POST') ? define('AUTH_POST', 3) : false; ! !defined('AUTH_REPLY') ? define('AUTH_REPLY', 4) : false; ! !defined('AUTH_EDIT') ? define('AUTH_EDIT', 5) : false; ! !defined('AUTH_DELETE') ? define('AUTH_DELETE', 6) : false; ! !defined('AUTH_ANNOUNCE') ? define('AUTH_ANNOUNCE', 7) : false; ! !defined('AUTH_STICKY') ? define('AUTH_STICKY', 8) : false; ! !defined('AUTH_POLLCREATE') ? define('AUTH_POLLCREATE', 9) : false; ! !defined('AUTH_VOTE') ? define('AUTH_VOTE', 10) : false; ! !defined('AUTH_ATTACH') ? define('AUTH_ATTACH', 11) : false; /** *************** *** 26,35 **** define('MX_PORTAL_PAGES_OFFSET', 1000); - /** - * Other common constants and definitions. - * @access private - */ - define('AUTH_ANONYMOUS', 9); - /**#@+ * mxBB Core table names --- 72,75 ---- *************** *** 57,60 **** --- 97,102 ---- define('PAGE_TEMPLATES' , $mx_table_prefix . 'page_templates'); + define('MX_THEMES_TABLE', $mx_table_prefix.'themes'); + define('MX_MATCH_TABLE' , $mx_table_prefix . 'wordmatch'); define('MX_WORD_TABLE' , $mx_table_prefix . 'wordlist'); Index: mx_functions_phpbb.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_phpbb.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** mx_functions_phpbb.php 19 Jun 2007 20:42:00 -0000 1.32 --- mx_functions_phpbb.php 9 Sep 2007 16:48:17 -0000 1.33 *************** *** 15,18 **** --- 15,140 ---- } + // + // First off, include common vanilla phpBB functions, from our shared dir + // Note: These functions will later be accessible wrapped as phpBBX::orig_functionname() + // + include_once($mx_root_path . 'includes/shared/phpbb2/includes/functions.' . $phpEx); + include_once($mx_root_path . 'includes/shared/phpbb3/includes/functions.' . $phpEx); + [...1332 lines suppressed...] ! $template->set_filenames(array( ! 'jumpbox' => 'jumpbox.tpl') ! ); ! ! $template->assign_vars(array( ! 'L_GO' => $lang['Go'], ! 'L_JUMP_TO' => $lang['Jump_to'], ! 'L_SELECT_FORUM' => $lang['Select_forum'], ! ! 'S_JUMPBOX_SELECT' => $boxstring, ! 'S_JUMPBOX_ACTION' => mx_append_sid($action), ! 'S_FORUM_COUNT' => $j) ! ); ! $template->assign_var_from_handle('JUMPBOX', 'jumpbox'); ! ! return; ! } ! ! ?> \ No newline at end of file Index: mx_functions_tools.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_tools.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** mx_functions_tools.php 6 Aug 2007 20:07:05 -0000 1.15 --- mx_functions_tools.php 9 Sep 2007 16:48:17 -0000 1.16 *************** *** 18,22 **** // This 'include' is needed for the mx_text class // ! @include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); /** --- 18,25 ---- // This 'include' is needed for the mx_text class // ! if( !function_exists('bbencode_second_pass') ) ! { [...1397 lines suppressed...] + break; + + case 'insert': + $return_data = $this->insert_phpbb_post( $title, $comments_text, $this->forum_id, $user_id, $username, $user_attach_sig, $this->topic_id, '', $title_first, $comments_text_first, $comment_bbcode_uid ); + break; + + case 'update': + $return_data = $this->insert_phpbb_post( $title, $comments_text, $this->forum_id, $user_id, $username, $user_attach_sig, $this->topic_id, $cid, $title_first, $comments_text_first, $comment_bbcode_uid ); + break; + + default: + mx_message_die(GENERAL_ERROR, 'bad post mode'); + } + + return $return_data; + } + } + /** * Class: debug. --- NEW FILE: template.php --- <?php /** * * @package mxBB Portal Module - mx_xs * @version $Id: template.php,v 1.18 2007/09/09 16:48:17 jonohlsson Exp $ * @copyright (c) 2002-2007 [CyberAlien, OryNider] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * @link http://www.mxbb.net * */ /** * * Template class. By Nathan Codding of the phpBB group. * The interface was originally inspired by PHPLib templates, * and the template file formats are quite similar. * * eXtreme Styles mod/module by CyberAlien. [...2418 lines suppressed...] $list = explode('|', $str); for($i=0; $i<count($list); $i++) { $row = explode('=', $list[$i], 2); if(count($row) == 2) { $array[$row[0]] = $row[1]; } } return $array; } } function xs_switch($tpl, $name) { return (isset($tpl->_tpldata[$name.'.']) && count($tpl->_tpldata[$name.'.']) > 0); } ?> Index: page_header.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/page_header.php,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** page_header.php 22 Jul 2007 20:59:56 -0000 1.45 --- page_header.php 9 Sep 2007 16:48:17 -0000 1.46 *************** *** 85,90 **** // Parse and show the overall header. // $layouttemplate->set_filenames(array( ! 'overall_header' => empty($mx_page->page_ov_header) || !file_exists($mx_root_path . TEMPLATE_ROOT_PATH . $mx_page->page_ov_header) ? ( empty($gen_simple_header) ? 'overall_header.tpl' : 'simple_header.tpl' ) : $mx_page->page_ov_header )); --- 85,91 ---- // Parse and show the overall header. // + $page_ov_header2 = substr_count($mx_page->page_ov_header, 'html') ? str_replace(".html", ".tpl", $mx_page->page_ov_header) : str_replace(".tpl", ".html", $mx_page->page_ov_header); $layouttemplate->set_filenames(array( ! 'overall_header' => empty($mx_page->page_ov_header) || ( !file_exists($mx_root_path . TEMPLATE_ROOT_PATH . $mx_page->page_ov_header) && !file_exists($mx_root_path . TEMPLATE_ROOT_PATH . $page_ov_header2) ) ? ( empty($gen_simple_header) ? 'overall_header.' . $tplEx : 'simple_header.' . $tplEx ) : $mx_page->page_ov_header )); *************** *** 92,167 **** // Generate logged in/logged out status // ! if ( $userdata['session_logged_in'] ) ! { ! $u_login_logout = 'login.'.$phpEx.'?logout=true&sid=' . $userdata['session_id']; ! $l_login_logout = $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]'; ! } ! else { ! $u_login_logout = 'login.'.$phpEx; ! $l_login_logout = $lang['Login']; ! } ! $s_last_visit = ( $userdata['session_logged_in'] ) ? create_date($board_config['default_dateformat'], $userdata['user_lastvisit'], $board_config['board_timezone']) : ''; ! // ! // Obtain number of new private messages ! // if user is logged in ! // ! if ( ($userdata['session_logged_in']) && (empty($gen_simple_header)) ) ! { ! if ( $userdata['user_new_privmsg'] ) ! { ! $l_message_new = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['New_pm'] : $lang['New_pms']; ! $l_privmsgs_text = sprintf($l_message_new, $userdata['user_new_privmsg']); ! if ( $userdata['user_last_privmsg'] > $userdata['user_lastvisit'] ) { ! $sql = "UPDATE " . USERS_TABLE . " ! SET user_last_privmsg = " . $userdata['user_lastvisit'] . " ! WHERE user_id = " . $userdata['user_id']; ! if ( !$db->sql_query($sql) ) { ! mx_message_die(GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, $sql); } ! $s_privmsg_new = 1; ! $icon_pm = $images['pm_new_msg']; } else { - $s_privmsg_new = 0; $icon_pm = $images['pm_no_new_msg']; } - $mx_priv_msg = $lang['Private_Messages'] . ' (' . $userdata['user_new_privmsg'] . ')'; - } - else - { - $l_privmsgs_text = $lang['No_new_pm']; ! $s_privmsg_new = 0; ! $icon_pm = $images['pm_no_new_msg']; ! $mx_priv_msg = $lang['Private_Messages']; ! } ! if ( $userdata['user_unread_privmsg'] ) ! { ! $l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms']; ! $l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg']); ! } ! else ! { ! $l_privmsgs_text_unread = $lang['No_unread_pm']; ! } ! } ! else ! { ! $icon_pm = $images['pm_no_new_msg']; ! $l_privmsgs_text = $lang['Login_check_pm']; ! $l_privmsgs_text_unread = ''; ! $s_privmsg_new = 0; ! $mx_priv_msg = $lang['Private_Messages']; } // // Generate HTML required for Mozilla Navigation bar --- 93,256 ---- // Generate logged in/logged out status // ! switch (PORTAL_BACKEND) { ! case 'internal': ! case 'phpbb2': ! if ( $userdata['session_logged_in'] ) ! { ! $is_logged = true; ! $u_login_logout = 'login.'.$phpEx.'?logout=true&sid=' . $userdata['session_id']; ! $l_login_logout = $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]'; ! } ! else ! { ! $is_logged = false; ! $u_login_logout = 'login.'.$phpEx; ! $l_login_logout = $lang['Login']; ! } ! $s_last_visit = ( $userdata['session_logged_in'] ) ? phpBB2::create_date($board_config['default_dateformat'], $userdata['user_lastvisit'], $board_config['board_timezone']) : ''; ! // ! // Obtain number of new private messages ! // if user is logged in ! // ! if ( ($userdata['session_logged_in']) && (empty($gen_simple_header)) ) { ! if ( $userdata['user_new_privmsg'] ) { ! $l_message_new = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['New_pm'] : $lang['New_pms']; ! $l_privmsgs_text = sprintf($l_message_new, $userdata['user_new_privmsg']); ! ! if ( $userdata['user_last_privmsg'] > $userdata['user_lastvisit'] ) ! { ! $sql = "UPDATE " . USERS_TABLE . " ! SET user_last_privmsg = " . $userdata['user_lastvisit'] . " ! WHERE user_id = " . $userdata['user_id']; ! if ( !$db->sql_query($sql) ) ! { ! mx_message_die(GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, $sql); ! } ! ! $s_privmsg_new = 1; ! $icon_pm = $images['pm_new_msg']; ! } ! else ! { ! $s_privmsg_new = 0; ! $icon_pm = $images['pm_no_new_msg']; ! } ! $mx_priv_msg = $lang['Private_Messages'] . ' (' . $userdata['user_new_privmsg'] . ')'; } + else + { + $l_privmsgs_text = $lang['No_new_pm']; ! $s_privmsg_new = 0; ! $icon_pm = $images['pm_no_new_msg']; ! $mx_priv_msg = $lang['Private_Messages']; ! } ! ! if ( $userdata['user_unread_privmsg'] ) ! { ! $l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms']; ! $l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg']); ! } ! else ! { ! $l_privmsgs_text_unread = $lang['No_unread_pm']; ! } } else { $icon_pm = $images['pm_no_new_msg']; + $l_privmsgs_text = $lang['Login_check_pm']; + $l_privmsgs_text_unread = ''; + $s_privmsg_new = 0; + $mx_priv_msg = $lang['Private_Messages']; } ! break; ! case 'phpbb3': ! ! if ( $mx_user->data['user_id'] != 1 ) ! { ! $is_logged = true; ! $u_login_logout = 'login.'.$phpEx.'?logout=true&sid=' . $mx_user->data['session_id']; ! $l_login_logout = $lang['Logout'] . ' [ ' . $mx_user->data['username'] . ' ]'; ! } ! else ! { ! $is_logged = false; ! $u_login_logout = 'login.'.$phpEx; ! $l_login_logout = $lang['Login']; ! } ! $s_last_visit = ( $mx_user->data['session_logged_in'] ) ? phpBB2::create_date($board_config['default_dateformat'], $mx_user->data['user_lastvisit'], $board_config['board_timezone']) : ''; ! ! // ! // Obtain number of new private messages ! // if user is logged in ! // ! if ( ($mx_user->data['session_logged_in']) && (empty($gen_simple_header)) ) ! { ! if ( $mx_user->data['user_new_privmsg'] ) ! { ! $l_message_new = ( $mx_user->data['user_new_privmsg'] == 1 ) ? $lang['New_pm'] : $lang['New_pms']; ! $l_privmsgs_text = sprintf($l_message_new, $mx_user->data['user_new_privmsg']); ! ! if ( $mx_user->data['user_last_privmsg'] > $mx_user->data['user_lastvisit'] ) ! { ! $sql = "UPDATE " . USERS_TABLE . " ! SET user_last_privmsg = " . $mx_user->data['user_lastvisit'] . " ! WHERE user_id = " . $mx_user->data['user_id']; ! if ( !$db->sql_query($sql) ) ! { ! mx_message_die(GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, $sql); ! } ! ! $s_privmsg_new = 1; ! $icon_pm = $images['pm_new_msg']; ! } ! else ! { ! $s_privmsg_new = 0; ! $icon_pm = $images['pm_no_new_msg']; ! } ! $mx_priv_msg = $lang['Private_Messages'] . ' (' . $mx_user->data['user_new_privmsg'] . ')'; ! } ! else ! { ! $l_privmsgs_text = $lang['No_new_pm']; ! ! $s_privmsg_new = 0; ! $icon_pm = $images['pm_no_new_msg']; ! $mx_priv_msg = $lang['Private_Messages']; ! } ! ! if ( $mx_user->data['user_unread_privmsg'] ) ! { ! $l_message_unread = ( $mx_user->data['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms']; ! $l_privmsgs_text_unread = sprintf($l_message_unread, $mx_user->data['user_unread_privmsg']); ! } ! else ! { ! $l_privmsgs_text_unread = $lang['No_unread_pm']; ! } ! } ! else ! { ! $icon_pm = $images['pm_no_new_msg']; ! $l_privmsgs_text = $lang['Login_check_pm']; ! $l_privmsgs_text_unread = ''; ! $s_privmsg_new = 0; ! $mx_priv_msg = $lang['Private_Messages']; ! } ! ! break; } + // // Generate HTML required for Mozilla Navigation bar *************** *** 178,182 **** if ( !empty($nav_array['url']) ) { ! $nav_links_html .= sprintf($nav_link_proto, $nav_item, append_sid($nav_array['url']), $nav_array['title']); } else --- 267,271 ---- if ( !empty($nav_array['url']) ) { ! $nav_links_html .= sprintf($nav_link_proto, $nav_item, mx_append_sid($nav_array['url']), $nav_array['title']); } else *************** *** 251,254 **** --- 340,373 ---- } + // Definitions of main navigation links + switch (PORTAL_BACKEND) + { + case 'internal': + case 'phpbb2': + $u_register = 'profile.'.$phpEx.'?mode=register' ; + $u_profile = 'profile.'.$phpEx.'?mode=editprofile'; + $u_privatemsgs = 'privmsg.'.$phpEx.'?folder=inbox'; + $u_privatemsgs_popup = 'privmsg.'.$phpEx.'?mode=newpm'; + $u_search = 'search.'.$phpEx; + $u_memberlist = 'memberlist.'.$phpEx; + $u_modcp = 'modcp.'.$phpEx; + $u_faq = 'faq.'.$phpEx; + $u_viewonline = 'viewonline.'.$phpEx; + $u_group_cp = 'groupcp.'.$phpEx; + break; + case 'phpbb3': + $u_register = 'ucp.'.$phpEx.'?mode=register'; + $u_profile = 'ucp.'.$phpEx; + $u_privatemsgs = 'ucp.'.$phpEx.'?i=pm&folder=inbox'; + $u_privatemsgs_popup ='ucp.'.$phpEx.'?i=pm&mode=popup'; + $u_search = 'search.'.$phpEx; + $u_memberlist = 'memberlist.'.$phpEx; + $u_modcp = 'mcp.'.$phpEx; + $u_faq = 'faq.'.$phpEx; + $u_viewonline = 'viewonline.'.$phpEx; + $u_group_cp = 'ucp.'.$phpEx.'?i=167'; + break; + } + $layouttemplate->assign_vars(array( 'SITENAME' => $board_config['sitename'], *************** *** 256,262 **** 'PAGE_TITLE' => $mx_page->page_title, 'LAST_VISIT_DATE' => sprintf($lang['You_last_visit'], $s_last_visit), ! 'CURRENT_TIME' => sprintf($lang['Current_time'], create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])), ! 'RECORD_USERS' => sprintf($lang['Record_online_users'], $board_config['record_online_users'], create_date($board_config['default_dateformat'], $board_config['record_online_date'], $board_config['board_timezone'])), 'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text, 'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread, --- 375,381 ---- 'PAGE_TITLE' => $mx_page->page_title, 'LAST_VISIT_DATE' => sprintf($lang['You_last_visit'], $s_last_visit), ! 'CURRENT_TIME' => sprintf($lang['Current_time'], phpBB2::create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])), ! 'RECORD_USERS' => sprintf($lang['Record_online_users'], $board_config['record_online_users'], phpBB2::create_date($board_config['default_dateformat'], $board_config['record_online_date'], $board_config['board_timezone'])), 'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text, 'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread, *************** *** 287,305 **** 'L_BACK_TO_TOP' => $lang['Back_to_top'], ! 'U_SEARCH_UNANSWERED' => append_sid(PHPBB_URL . 'search.'.$phpEx.'?search_id=unanswered'), ! 'U_SEARCH_SELF' => append_sid(PHPBB_URL .'search.'.$phpEx.'?search_id=egosearch'), ! 'U_SEARCH_NEW' => append_sid(PHPBB_URL .'search.'.$phpEx.'?search_id=newposts'), ! 'U_REGISTER' => append_sid(PHPBB_URL .'profile.'.$phpEx.'?mode=register'), ! 'U_PROFILE' => append_sid(PHPBB_URL .'profile.'.$phpEx.'?mode=editprofile'), ! 'U_PRIVATEMSGS' => append_sid(PHPBB_URL .'privmsg.'.$phpEx.'?folder=inbox'), ! 'U_PRIVATEMSGS_POPUP' => append_sid(PHPBB_URL .'privmsg.'.$phpEx.'?mode=newpm'), ! 'U_SEARCH' => append_sid(PHPBB_URL .'search.'.$phpEx), ! 'U_MEMBERLIST' => append_sid(PHPBB_URL .'memberlist.'.$phpEx), ! 'U_MODCP' => append_sid(PHPBB_URL .'modcp.'.$phpEx), ! 'U_FAQ' => append_sid(PHPBB_URL .'faq.'.$phpEx), ! 'U_VIEWONLINE' => append_sid(PHPBB_URL .'viewonline.'.$phpEx), ! 'U_LOGIN_LOGOUT' => append_sid(PORTAL_URL . $u_login_logout), ! 'U_GROUP_CP' => append_sid(PHPBB_URL . 'groupcp.'.$phpEx), 'NAV_IMAGES_HOME' => $images['mx_nav_home'], --- 406,426 ---- 'L_BACK_TO_TOP' => $lang['Back_to_top'], ! 'U_SEARCH_UNANSWERED' => mx_append_sid(PHPBB_URL . 'search.'.$phpEx.'?search_id=unanswered'), ! 'U_SEARCH_SELF' => mx_append_sid(PHPBB_URL .'search.'.$phpEx.'?search_id=egosearch'), ! 'U_SEARCH_NEW' => mx_append_sid(PHPBB_URL .'search.'.$phpEx.'?search_id=newposts'), ! 'U_REGISTER' => mx_append_sid(PHPBB_URL . $u_register), ! 'U_PROFILE' => mx_append_sid(PHPBB_URL . $u_profile), ! 'U_PRIVATEMSGS' => mx_append_sid(PHPBB_URL . $u_privatemsgs), ! 'U_PRIVATEMSGS_POPUP' => mx_append_sid(PHPBB_URL . $u_privatemsgs_popup), ! 'U_SEARCH' => mx_append_sid(PHPBB_URL . $u_search), ! 'U_MEMBERLIST' =>mx_append_sid(PHPBB_URL . $u_memberlist), ! 'U_MODCP' => mx_append_sid(PHPBB_URL . $u_modcp), ! 'U_FAQ' => mx_append_sid(PHPBB_URL . $u_faq), ! 'U_VIEWONLINE' => mx_append_sid(PHPBB_URL . $u_viewonline), ! 'U_LOGIN_LOGOUT' => mx_append_sid(PORTAL_URL . $u_login_logout), ! 'U_GROUP_CP' => mx_append_sid(PHPBB_URL . $u_group_cp), ! ! 'LOGO' => $images['mx_logo'], 'NAV_IMAGES_HOME' => $images['mx_nav_home'], *************** *** 319,323 **** 'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'], 'S_TIMEZONE' => sprintf($lang['All_times'], $l_timezone), ! 'S_LOGIN_ACTION' => append_sid(PORTAL_URL . 'login.'.$phpEx), // --- 440,444 ---- 'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'], 'S_TIMEZONE' => sprintf($lang['All_times'], $l_timezone), ! 'S_LOGIN_ACTION' => mx_append_sid(PORTAL_URL . 'login.'.$phpEx), // *************** *** 371,379 **** 'L_FORUM' => $lang['MX_forum'], ! 'U_INDEX_FORUM' => append_sid(PORTAL_URL . 'index.' . $phpEx . '?page=2'), ! 'U_INDEX' => append_sid(PORTAL_URL . 'index.' . $phpEx), ! 'U_SEARCH_SITE' => append_sid(PORTAL_URL . 'index.' . $phpEx . '?page=' . $search_page_id_site . '&mode=results&search_terms=all'), ! 'U_SEARCH_KB' => append_sid(PORTAL_URL . 'index.' . $phpEx . '?page=' . $search_page_id_kb . '&mode=search&search_terms=all'), ! 'U_SEARCH_PAFILEDB' => append_sid(PORTAL_URL . 'index.' . $phpEx . '?page=' . $search_page_id_pafiledb . '&action=search&search_terms=all'), 'PAGE_ICON' => $page_icon_img, --- 492,500 ---- 'L_FORUM' => $lang['MX_forum'], ! 'U_INDEX_FORUM' => mx_append_sid(PORTAL_URL . 'index.' . $phpEx . '?page=2'), ! 'U_INDEX' => mx_append_sid(PORTAL_URL . 'index.' . $phpEx), ! 'U_SEARCH_SITE' => mx_append_sid(PORTAL_URL . 'index.' . $phpEx . '?page=' . $search_page_id_site . '&mode=results&search_terms=all'), ! 'U_SEARCH_KB' => mx_append_sid(PORTAL_URL . 'index.' . $phpEx . '?page=' . $search_page_id_kb . '&mode=search&search_terms=all'), ! 'U_SEARCH_PAFILEDB' => mx_append_sid(PORTAL_URL . 'index.' . $phpEx . '?page=' . $search_page_id_pafiledb . '&action=search&search_terms=all'), 'PAGE_ICON' => $page_icon_img, *************** *** 461,502 **** // Navigation Menu in overall_header // ! if (!is_object($mx_block)) { ! $mx_block = new mx_block(); ! } ! $block_id = $mx_page->page_navigation_block; ! if(!empty($block_id) ) ! { ! define('MX_OVERALL_NAVIGATION', true); ! $mx_block->init( $block_id ); ! // ! // Define $module_root_path, to be used within blocks ! // ! $module_root_path = $mx_root_path . $mx_block->module_root_path; ! $template = new mx_Template($mx_root_path . 'templates/'. $theme['template_name']); ! // ! // Include block file and cache output ! // ! ob_start(); ! include($module_root_path . $mx_block->block_file); ! $overall_navigation_menu = ob_get_contents(); ! ob_end_clean(); ! // ! // Output Block contents ! // ! $layouttemplate->assign_vars(array( ! 'OVERALL_NAVIGATION' => $overall_navigation_menu) ! ); ! if ( ( ( $mx_block->auth_view && $mx_block->auth_edit && $mx_block->show_block ) || $mx_block->auth_mod ) ) ! { ! $mx_block->output_cp_button(true); } } --- 582,626 ---- // Navigation Menu in overall_header // ! if ($mx_page->auth_view || $mx_page->auth_mod) { ! if (!is_object($mx_block)) ! { ! $mx_block = new mx_block(); ! } ! $block_id = $mx_page->page_navigation_block; ! if(!empty($block_id) ) ! { ! define('MX_OVERALL_NAVIGATION', true); ! $mx_block->init( $block_id ); ! // ! // Define $module_root_path, to be used within blocks ! // ! $module_root_path = $mx_root_path . $mx_block->module_root_path; ! $template = new mx_Template($mx_root_path . 'templates/'. $theme['template_name']); ! // ! // Include block file and cache output ! // ! ob_start(); ! include($module_root_path . $mx_block->block_file); ! $overall_navigation_menu = ob_get_contents(); ! ob_end_clean(); ! // ! // Output Block contents ! // ! $layouttemplate->assign_vars(array( ! 'OVERALL_NAVIGATION' => $overall_navigation_menu) ! ); ! if ( ( ( $mx_block->auth_view && $mx_block->auth_edit && $mx_block->show_block ) || $mx_block->auth_mod ) ) ! { ! $mx_block->output_cp_button(true); ! } } } Index: mx_functions_style.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_style.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** mx_functions_style.php 6 Aug 2007 22:40:07 -0000 1.17 --- mx_functions_style.php 9 Sep 2007 16:48:17 -0000 1.18 *************** *** 16,27 **** // ! // Including phpBB version of the Template class // ! include_once($phpbb_root_path . 'includes/template.' . $phpEx); // ! // Including phpBB session functions // ! include_once($phpbb_root_path . 'includes/sessions.' . $phpEx); [...1166 lines suppressed...] } *************** *** 681,684 **** --- 1139,1143 ---- $current_template_path = $module_root_path . $this->current_template_path; $cloned_template_path = $module_root_path . $this->cloned_current_template_path; + $default_template_path = $module_root_path . $this->default_current_template_path; $template_name = $this->template_name; *************** *** 894,896 **** } // class mx_user ! ?> --- 1353,1355 ---- } // class mx_user ! ?> \ No newline at end of file |