|
From: Jon O. <jon...@us...> - 2008-10-31 19:02:25
|
Update of /cvsroot/mxbb/core/includes In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6817/includes Modified Files: mx_constants.php mx_functions.php mx_functions_admincp.php mx_functions_core.php mx_functions_style.php mx_functions_tools.php page_header.php page_tail.php Log Message: http://www.mx-publisher.com/phpBB2/viewtopic.php?p=65197#65197 Massive update. Index: page_tail.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/page_tail.php,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** page_tail.php 4 Oct 2008 07:04:25 -0000 1.42 --- page_tail.php 31 Oct 2008 19:02:21 -0000 1.43 *************** *** 48,52 **** $editor_name_tmp = mx_get_userdata($mx_page->last_updated_by); $editor_name = $editor_name_tmp['username']; ! $edit_time = $phpBB2->create_date( $board_config['default_dateformat'], $mx_page->last_updated, $board_config['board_timezone'] ); $template->assign_block_vars('page_last_updated', array( --- 48,52 ---- $editor_name_tmp = mx_get_userdata($mx_page->last_updated_by); $editor_name = $editor_name_tmp['username']; ! $edit_time = phpBB2::create_date( $board_config['default_dateformat'], $mx_page->last_updated, $board_config['board_timezone'] ); $template->assign_block_vars('page_last_updated', array( Index: mx_functions_core.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_core.php,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** mx_functions_core.php 5 Oct 2008 01:16:26 -0000 1.108 --- mx_functions_core.php 31 Oct 2008 19:02:21 -0000 1.109 *************** *** 451,455 **** $sql = "SELECT col.page_id, pag.page_name, ! pag.page_desc, pag.page_parent, pag.parents_data, --- 451,455 ---- $sql = "SELECT col.page_id, pag.page_name, ! pag.page_desc, pag.page_parent, pag.parents_data, *************** *** 503,507 **** "page_id" => $row['page_id'], "page_name" => $row['page_name'], ! "page_desc" => $row['page_desc'], "page_parent" => $row['page_parent'], "parent_data" => $row['parents_data'], --- 503,507 ---- "page_id" => $row['page_id'], "page_name" => $row['page_name'], ! "page_desc" => $row['page_desc'], "page_parent" => $row['page_parent'], "parent_data" => $row['parents_data'], *************** *** 1241,1550 **** return $censors; } - - /** - * Obtain ranks - */ - function obtain_ranks() - { - if (($ranks = $this->get('_ranks')) === false) - { - global $db; - - $sql = 'SELECT * - FROM ' . RANKS_TABLE . ' - ORDER BY rank_min DESC'; - $result = $db->sql_query($sql); - - $ranks = array(); - while ($row = $db->sql_fetchrow($result)) - { - if ($row['rank_special']) - { - $ranks['special'][$row['rank_id']] = array( - 'rank_title' => $row['rank_title'], - 'rank_image' => $row['rank_image'] - ); - } - else - { - $ranks['normal'][] = array( - 'rank_title' => $row['rank_title'], - 'rank_min' => $row['rank_min'], - 'rank_image' => $row['rank_image'] - ); - } - } - $db->sql_freeresult($result); - - $this->put('_ranks', $ranks); - } - - return $ranks; - } - - /** - * Obtain allowed extensions - * - * @param mixed $forum_id If false then check for private messaging, if int then check for forum id. If true, then only return extension informations. - * - * @return array allowed extensions array. - */ - function obtain_attach_extensions($forum_id) - { - if (($extensions = $this->get('_extensions')) === false) - { - global $db; - - $extensions = array( - '_allowed_post' => array(), - '_allowed_pm' => array(), - ); - - // The rule is to only allow those extensions defined. ;) - $sql = 'SELECT e.extension, g.* - FROM ' . EXTENSIONS_TABLE . ' e, ' . EXTENSION_GROUPS_TABLE . ' g - WHERE e.group_id = g.group_id - AND (g.allow_group = 1 OR g.allow_in_pm = 1)'; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - $extension = strtolower(trim($row['extension'])); - - $extensions[$extension] = array( - 'display_cat' => (int) $row['cat_id'], - 'download_mode' => (int) $row['download_mode'], - 'upload_icon' => trim($row['upload_icon']), - 'max_filesize' => (int) $row['max_filesize'], - 'allow_group' => $row['allow_group'], - 'allow_in_pm' => $row['allow_in_pm'], - ); - - $allowed_forums = ($row['allowed_forums']) ? unserialize(trim($row['allowed_forums'])) : array(); - - // Store allowed extensions forum wise - if ($row['allow_group']) - { - $extensions['_allowed_post'][$extension] = (!sizeof($allowed_forums)) ? 0 : $allowed_forums; - } - - if ($row['allow_in_pm']) - { - $extensions['_allowed_pm'][$extension] = 0; - } - } - $db->sql_freeresult($result); - - $this->put('_extensions', $extensions); - } - - // Forum post - if ($forum_id === false) - { - // We are checking for private messages, therefore we only need to get the pm extensions... - $return = array('_allowed_' => array()); - - foreach ($extensions['_allowed_pm'] as $extension => $check) - { - $return['_allowed_'][$extension] = 0; - $return[$extension] = $extensions[$extension]; - } - - $extensions = $return; - } - else if ($forum_id === true) - { - return $extensions; - } - else - { - $forum_id = (int) $forum_id; - $return = array('_allowed_' => array()); - - foreach ($extensions['_allowed_post'] as $extension => $check) - { - // Check for allowed forums - if (is_array($check)) - { - $allowed = (!in_array($forum_id, $check)) ? false : true; - } - else - { - $allowed = true; - } - - if ($allowed) - { - $return['_allowed_'][$extension] = 0; - $return[$extension] = $extensions[$extension]; - } - } - - $extensions = $return; - } - - if (!isset($extensions['_allowed_'])) - { - $extensions['_allowed_'] = array(); - } - - return $extensions; - } - - /** - * Obtain active bots - */ - function obtain_bots() - { - if (($bots = $this->get('_bots')) === false) - { - global $db; - - switch ($db->sql_layer) - { - case 'mssql': - case 'mssql_odbc': - $sql = 'SELECT user_id, bot_agent, bot_ip - FROM ' . BOTS_TABLE . ' - WHERE bot_active = 1 - ORDER BY LEN(bot_agent) DESC'; - break; - - case 'firebird': - $sql = 'SELECT user_id, bot_agent, bot_ip - FROM ' . BOTS_TABLE . ' - WHERE bot_active = 1 - ORDER BY CHAR_LENGTH(bot_agent) DESC'; - break; - - // LENGTH supported by MySQL, IBM DB2 and Oracle for sure... - default: - $sql = 'SELECT user_id, bot_agent, bot_ip - FROM ' . BOTS_TABLE . ' - WHERE bot_active = 1 - ORDER BY LENGTH(bot_agent) DESC'; - break; - } - $result = $db->sql_query($sql); - - $bots = array(); - while ($row = $db->sql_fetchrow($result)) - { - $bots[] = $row; - } - $db->sql_freeresult($result); - - $this->put('_bots', $bots); - } - - return $bots; - } - - /** - * Obtain cfg file data - */ - function obtain_cfg_items($theme) - { - global $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']) || (($config['load_tplcompile'] && @filemtime($filename) > $parsed_array['filetime']))) - { - $reparse = true; - } - - // Re-parse cfg file - if ($reparse) - { - $parsed_array = 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; - } - - /** - * Obtain disallowed usernames - */ - function obtain_disallowed_usernames() - { - if (($usernames = $this->get('_disallowed_usernames')) === false) - { - global $db; - - $sql = 'SELECT disallow_username - FROM ' . DISALLOW_TABLE; - $result = $db->sql_query($sql); - - $usernames = array(); - while ($row = $db->sql_fetchrow($result)) - { - $usernames[] = str_replace('%', '.*?', preg_quote(utf8_clean_string($row['disallow_username']), '#')); - } - $db->sql_freeresult($result); - - $this->put('_disallowed_usernames', $usernames); - } - - return $usernames; - } - - /** - * Obtain hooks... - */ - function obtain_hooks() - { - global $phpbb_root_path, $phpEx; - - if (($hook_files = $this->get('_hooks')) === false) - { - $hook_files = array(); - - // Now search for hooks... - $dh = @opendir($phpbb_root_path . 'includes/hooks/'); - - if ($dh) - { - while (($file = readdir($dh)) !== false) - { - if (strpos($file, 'hook_') === 0 && substr($file, -(strlen($phpEx) + 1)) === '.' . $phpEx) - { - $hook_files[] = substr($file, 0, -(strlen($phpEx) + 1)); - } - } - closedir($dh); - } - - $this->put('_hooks', $hook_files); - } - - return $hook_files; - } } --- 1241,1244 ---- *************** *** 2053,2057 **** function output_stats() { ! global $layouttemplate, $board_config, $lang, $userdata, $phpBB2; if ( $this->show_stats && !empty($this->block_time) && !empty($this->editor_id) ) --- 1747,1751 ---- function output_stats() { ! global $layouttemplate, $board_config, $lang, $userdata; if ( $this->show_stats && !empty($this->block_time) && !empty($this->editor_id) ) *************** *** 2060,2064 **** $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( --- 1754,1758 ---- $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( *************** *** 3983,3987 **** function _read($var, $type = MX_TYPE_ANY, $dflt = '', $not_null = false) { - //global $_POST, $_GET; //is not required? if( ($type & (MX_TYPE_POST_VARS|MX_TYPE_GET_VARS)) == 0 ) { --- 3677,3680 ---- *************** *** 4133,4137 **** function is_post($var) { - //global $_POST; // Note: _x and _y are used by (at least IE) to return the mouse position at onclick of INPUT TYPE="img" elements. return (isset($_POST[$var]) || ( isset($_POST[$var.'_x']) && isset($_POST[$var.'_y']))) ? 1 : 0; --- 3826,3829 ---- *************** *** 4149,4153 **** function is_get($var) { - //global $_GET; return isset($_GET[$var]) ? 1 : 0 ; } --- 3841,3844 ---- *************** *** 4178,4182 **** function is_empty_post($var) { - //global $_POST; return (empty($_POST[$var]) && ( empty($_POST[$var.'_x']) || empty($_POST[$var.'_y']))) ? 1 : 0 ; } --- 3869,3872 ---- *************** *** 4193,4197 **** function is_empty_get($var) { - //global $_GET; return empty($_GET[$var]) ? 1 : 0 ; } --- 3883,3886 ---- Index: mx_constants.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_constants.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** mx_constants.php 24 Sep 2008 17:01:11 -0000 1.30 --- mx_constants.php 31 Oct 2008 19:02:20 -0000 1.31 *************** *** 104,113 **** /**#@-*/ - // Error codes removed in phpBB3 does we need them here - @define('GENERAL_MESSAGE', 200); - @define('GENERAL_ERROR', 202); - @define('CRITICAL_MESSAGE', 203); - @define('CRITICAL_ERROR', 204); - /** * Sick and tired of these variables getting lost... --- 104,107 ---- Index: mx_functions_tools.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_tools.php,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** mx_functions_tools.php 31 Oct 2008 11:41:08 -0000 1.48 --- mx_functions_tools.php 31 Oct 2008 19:02:21 -0000 1.49 *************** *** 67,71 **** function init($html_on = false, $bbcode_on = true, $smilies_on = false, $links_on = true, $images_on = true) { ! global $theme, $mx_cache, $phpBB2; // --- 67,71 ---- function init($html_on = false, $bbcode_on = true, $smilies_on = false, $links_on = true, $images_on = true) { ! global $theme, $mx_cache; // *************** *** 104,108 **** $this->highlight = urlencode($_GET['highlight']); ! $this->highlight_match = $phpBB2->phpbb_rtrim($this->highlight_match, "\\"); } --- 104,108 ---- $this->highlight = urlencode($_GET['highlight']); ! $this->highlight_match = phpBB2::phpbb_rtrim($this->highlight_match, "\\"); } *************** *** 327,331 **** function encode_username($username) { ! global $board_config, $userdata, $lang, $phpEx, $phpbb_root_path,$phpBB2; // --- 327,331 ---- function encode_username($username) { ! global $board_config, $userdata, $lang, $phpEx, $phpbb_root_path; // *************** *** 334,338 **** if (!empty($username)) { ! $username = $phpBB2->phpbb_clean_username($username); if (!$userdata['session_logged_in'] || ($userdata['session_logged_in'] && $username != $userdata['username'])) --- 334,338 ---- if (!empty($username)) { ! $username = phpBB2::phpbb_clean_username($username); if (!$userdata['session_logged_in'] || ($userdata['session_logged_in'] && $username != $userdata['username'])) *************** *** 1625,1634 **** if( !function_exists('prepare_message') ) { ! include_once($mx_root_path . 'includes/shared/phpbb2/includes/functions_post.' . $phpEx); } if( !function_exists('add_search_words') ) { ! include_once($mx_root_path . 'includes/shared/phpbb2/includes/functions_search.' . $phpEx); } --- 1625,1636 ---- if( !function_exists('prepare_message') ) { ! //include_once($mx_root_path . 'includes/shared/phpbb2/includes/functions_post.' . $phpEx); ! mx_cache::load_file('functions_post', 'phpbb2'); } if( !function_exists('add_search_words') ) { ! //include_once($mx_root_path . 'includes/shared/phpbb2/includes/functions_search.' . $phpEx); ! mx_cache::load_file('functions_search', 'phpbb2'); } *************** *** 2040,2044 **** // Include and initiate mailer // ! include($mx_root_path . 'includes/mx_functions_emailer.'.$phpEx); $emailer = new mx_emailer($board_config['smtp_delivery']); --- 2042,2046 ---- // Include and initiate mailer // ! include_once($mx_root_path . 'includes/mx_functions_emailer.'.$phpEx); $emailer = new mx_emailer($board_config['smtp_delivery']); *************** *** 3142,3148 **** $subject = substr($subject, 0, 60); $subject = mx_censor_text($subject); ! $username = addslashes(unprepare_message(trim($user_name))); ! $username = $phpBB2->phpbb_clean_username( $username ); // --- 3144,3150 ---- $subject = substr($subject, 0, 60); $subject = mx_censor_text($subject); ! $username = addslashes(unprepare_message(trim($user_name))); ! $username = phpBB2::phpbb_clean_username( $username ); // *************** *** 3249,3253 **** case 'internal': break; ! case 'phpbb2': $sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $user_id . ", '$username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $user_attach_sig)"; --- 3251,3255 ---- case 'internal': break; ! case 'phpbb2': $sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $user_id . ", '$username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $user_attach_sig)"; *************** *** 3278,3291 **** 'post_edit_locked' => !empty($post_edit_locked) ? $post_edit_locked : 0 ); ! ! $sql = "INSERT INTO " . POSTS_TABLE . $db->sql_build_array('INSERT', $sql_data); break; ! } ! } else { $edited_sql = !$is_last_post ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : ""; ! $sql = "UPDATE " . POSTS_TABLE . " SET post_username = '$username', enable_bbcode = $bbcode_on, enable_smilies = $smilies_on, enable_sig = $user_attach_sig" . $edited_sql . " --- 3280,3293 ---- 'post_edit_locked' => !empty($post_edit_locked) ? $post_edit_locked : 0 ); ! ! $sql = "INSERT INTO " . POSTS_TABLE . $db->sql_build_array('INSERT', $sql_data); break; ! } ! } else { $edited_sql = !$is_last_post ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : ""; ! $sql = "UPDATE " . POSTS_TABLE . " SET post_username = '$username', enable_bbcode = $bbcode_on, enable_smilies = $smilies_on, enable_sig = $user_attach_sig" . $edited_sql . " *************** *** 3307,3311 **** case 'internal': break; ! case 'phpbb2': if ( $mode == 'newtopic' || $mode == 'reply' ) --- 3309,3313 ---- case 'internal': break; ! case 'phpbb2': if ( $mode == 'newtopic' || $mode == 'reply' ) *************** *** 3317,3326 **** $sql = "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '$message', bbcode_uid = '$bbcode_uid', post_subject = '$subject' WHERE post_id = $post_id"; } ! if ( !$db->sql_query( $sql ) ) { $error_die_function( GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql ); } ! break; --- 3319,3328 ---- $sql = "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '$message', bbcode_uid = '$bbcode_uid', post_subject = '$subject' WHERE post_id = $post_id"; } ! if ( !$db->sql_query( $sql ) ) { $error_die_function( GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql ); } ! break; *************** *** 3379,3391 **** case 'internal': break; ! case 'phpbb2': $phpBB2->add_search_words('single', $post_id, stripslashes($message), stripslashes($subject)); ! break; case 'phpbb3': //To do break; ! } // --- 3381,3393 ---- case 'internal': break; ! case 'phpbb2': $phpBB2->add_search_words('single', $post_id, stripslashes($message), stripslashes($subject)); ! break; case 'phpbb3': //To do break; ! } // *************** *** 3837,3841 **** function display_internal_comments() { ! global $template, $lang, $board_config, $phpEx, $db, $userdata, $images, $mx_user, $phpBB2; global $mx_root_path, $module_root_path, $phpbb_root_path, $is_block, $phpEx, $mx_request_vars, $portal_config; --- 3839,3843 ---- function display_internal_comments() { ! global $template, $lang, $board_config, $phpEx, $db, $userdata, $images, $mx_user; global $mx_root_path, $module_root_path, $phpbb_root_path, $is_block, $phpEx, $mx_request_vars, $portal_config; *************** *** 3889,3893 **** while ( $this->comments_row = $db->sql_fetchrow( $result ) ) { ! $time = $phpBB2->create_date( $board_config['default_dateformat'], $this->comments_row['comments_time'], $board_config['board_timezone'] ); // --- 3891,3895 ---- while ( $this->comments_row = $db->sql_fetchrow( $result ) ) { ! $time = phpBB2::create_date( $board_config['default_dateformat'], $this->comments_row['comments_time'], $board_config['board_timezone'] ); // *************** *** 4030,4034 **** $num_of_replies = intval( $this->total_comments ); ! //$pagination = $phpBB2->generate_pagination( $this->u_pagination($page_num), $num_of_replies, $this->pagination_num, $this->start ) . ' '; $pagination = mx_generate_pagination( $this->u_pagination($page_num), $num_of_replies, $this->pagination_num, $this->start, true, true, true, false ) . ' '; if ($num_of_replies > 0) --- 4032,4036 ---- $num_of_replies = intval( $this->total_comments ); ! //$pagination = phpBB2::generate_pagination( $this->u_pagination($page_num), $num_of_replies, $this->pagination_num, $this->start ) . ' '; $pagination = mx_generate_pagination( $this->u_pagination($page_num), $num_of_replies, $this->pagination_num, $this->start, true, true, true, false ) . ' '; if ($num_of_replies > 0) *************** *** 4050,4054 **** function display_phpbb_comments( ) { ! global $template, $lang, $board_config, $phpEx, $db, $userdata, $images, $mx_user, $phpBB2; global $mx_root_path, $module_root_path, $phpbb_root_path, $is_block, $phpEx, $mx_request_vars, $portal_config; --- 4052,4056 ---- function display_phpbb_comments( ) { ! global $template, $lang, $board_config, $phpEx, $db, $userdata, $images, $mx_user; global $mx_root_path, $module_root_path, $phpbb_root_path, $is_block, $phpEx, $mx_request_vars, $portal_config; *************** *** 4114,4121 **** $poster_id = $this->comments_row['user_id']; $poster = ( $poster_id == ANONYMOUS ) ? $lang['Guest'] : $this->comments_row['username']; ! $time = $phpBB2->create_date( $board_config['default_dateformat'], $this->comments_row['post_time'], $board_config['board_timezone'] ); $poster_posts = ( $this->comments_row['user_id'] != ANONYMOUS ) ? $lang['Posts'] . ': ' . $this->comments_row['user_posts'] : ''; $poster_from = ( $this->comments_row['user_from'] && $this->comments_row['user_id'] != ANONYMOUS ) ? $lang['Location'] . ': ' . $this->comments_row['user_from'] : ''; ! $poster_joined = ( $this->comments_row['user_id'] != ANONYMOUS ) ? $lang['Joined'] . ': ' . $phpBB2->create_date( $lang['DATE_FORMAT'], $this->comments_row['user_regdate'], $board_config['board_timezone'] ) : ''; // --- 4116,4123 ---- $poster_id = $this->comments_row['user_id']; $poster = ( $poster_id == ANONYMOUS ) ? $lang['Guest'] : $this->comments_row['username']; ! $time = phpBB2::create_date( $board_config['default_dateformat'], $this->comments_row['post_time'], $board_config['board_timezone'] ); $poster_posts = ( $this->comments_row['user_id'] != ANONYMOUS ) ? $lang['Posts'] . ': ' . $this->comments_row['user_posts'] : ''; $poster_from = ( $this->comments_row['user_from'] && $this->comments_row['user_id'] != ANONYMOUS ) ? $lang['Location'] . ': ' . $this->comments_row['user_from'] : ''; ! $poster_joined = ( $this->comments_row['user_id'] != ANONYMOUS ) ? $lang['Joined'] . ': ' . phpBB2::create_date( $lang['DATE_FORMAT'], $this->comments_row['user_regdate'], $board_config['board_timezone'] ) : ''; // *************** *** 4168,4172 **** $l_edit_time_total = ( $this->comments_row['post_edit_count'] == 1 ) ? $lang['Edited_time_total'] : $lang['Edited_times_total']; ! $l_edited_by = '<br /><br />' . sprintf( $l_edit_time_total, $poster, $phpBB2->create_date( $board_config['default_dateformat'], $this->comments_row['post_edit_time'], $board_config['board_timezone'] ), $this->comments_row['post_edit_count'] ); } else --- 4170,4174 ---- $l_edit_time_total = ( $this->comments_row['post_edit_count'] == 1 ) ? $lang['Edited_time_total'] : $lang['Edited_times_total']; ! $l_edited_by = '<br /><br />' . sprintf( $l_edit_time_total, $poster, phpBB2::create_date( $board_config['default_dateformat'], $this->comments_row['post_edit_time'], $board_config['board_timezone'] ), $this->comments_row['post_edit_count'] ); } else *************** *** 4273,4277 **** $num_of_replies = intval( $this->total_comments ); ! $pagination = $phpBB2->generate_pagination( $this->u_pagination($page_num), $num_of_replies, $this->pagination_num, $this->start ) . ' '; if ($num_of_replies > 0) --- 4275,4279 ---- $num_of_replies = intval( $this->total_comments ); ! $pagination = phpBB2::generate_pagination( $this->u_pagination($page_num), $num_of_replies, $this->pagination_num, $this->start ) . ' '; if ($num_of_replies > 0) *************** *** 4351,4394 **** $this->total_comments = ( $row = $db->sql_fetchrow($result) ) ? intval($row['number']) : 0; ! // // Go ahead and pull all data for this topic ! // ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! ! case 'phpbb2': ! ! $sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid ! FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt ! WHERE p.topic_id = '" . $this->topic_id . "' ! AND pt.post_id = p.post_id ! AND u.user_id = p.poster_id ! ORDER BY p.post_id DESC"; ! break; ! ! case 'phpbb3': ! ! $sql = "SELECT u.*, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid ! FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TABLE . " pt ! WHERE p.topic_id = '" . $this->topic_id . "' ! AND pt.post_id = p.post_id ! AND u.user_id = p.poster_id ! ORDER BY p.post_id DESC"; ! break; ! } ! ! if ($this->start > -1 && $this->pagination_num > 0) { ! $result = $db->sql_query_limit($sql, $this->start, $this->pagination_num); } - else - { - $result = $db->sql_query_limit($sql, $this->start, $this->pagination_num); - } ! if (!$result) { mx_message_die( GENERAL_ERROR, "Could not obtain post/user information.", '', __LINE__, __FILE__, $sql ); --- 4353,4373 ---- $this->total_comments = ( $row = $db->sql_fetchrow($result) ) ? intval($row['number']) : 0; ! // // Go ahead and pull all data for this topic ! // ! $sql = "SELECT u.*, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid ! FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . ((PORTAL_BACKEND == 'phpbb2') ? POSTS_TEXT_TABLE : POSTS_TABLE) . " pt ! WHERE p.topic_id = '" . $this->topic_id . "' ! AND pt.post_id = p.post_id ! AND u.user_id = p.poster_id ! ORDER BY p.post_id DESC"; ! if ( $this->start > -1 && $this->pagination_num > 0 ) { ! $sql .= " LIMIT $this->start, $this->pagination_num "; } ! if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not obtain post/user information.", '', __LINE__, __FILE__, $sql ); Index: page_header.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/page_header.php,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** page_header.php 4 Oct 2008 07:04:25 -0000 1.63 --- page_header.php 31 Oct 2008 19:02:21 -0000 1.64 *************** *** 191,196 **** 'SITE_DESCRIPTION' => $board_config['site_desc'], 'PAGE_TITLE' => $mx_page->page_title, ! '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'])), 'L_USERNAME' => $lang['Username'], --- 191,196 ---- 'SITE_DESCRIPTION' => $board_config['site_desc'], 'PAGE_TITLE' => $mx_page->page_title, ! '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'])), 'L_USERNAME' => $lang['Username'], *************** *** 304,308 **** 'T_PHPBB_STYLESHEET' => $theme['head_stylesheet'], ! 'T_STYLESHEET_LINK' => (!$mx_user->theme['theme_storedb']) ? "{$phpbb_root_path}styles/" . $mx_user->theme['theme_path'] . '/theme/stylesheet.css' : "{$phpbb_root_path}style.$phpEx?sid=$mx_user->session_id&id=" . $mx_user->theme['style_id'] . '&lang=' . $mx_user->encode_lang($board_config['default_lang']), 'T_MXBB_STYLESHEET' => $theme['head_stylesheet'], 'T_GECKO_STYLESHEET' => 'gecko.css', --- 304,308 ---- 'T_PHPBB_STYLESHEET' => $theme['head_stylesheet'], ! 'T_STYLESHEET_LINK' => (!$mx_user->theme['theme_storedb']) ? "{$phpbb_root_path}styles/" . $mx_user->theme['theme_path'] . '/theme/stylesheet.css' : "{$phpbb_root_path}style.$phpEx?sid=$mx_user->session_id&id=" . $mx_user->theme['style_id'] . '&lang=' . $mx_user->encode_lang($board_config['default_lang']), 'T_MXBB_STYLESHEET' => $theme['head_stylesheet'], 'T_GECKO_STYLESHEET' => 'gecko.css', *************** *** 323,327 **** // Do NOT set basedir when in EDIT mode 'SET_BASE' => !$mx_request_vars->is_request('portalpage'), ! //Enable CSS Files to be loaded direct from phpBB? 'PHPBB' => !(PORTAL_BACKEND === 'internal'), --- 323,327 ---- // Do NOT set basedir when in EDIT mode 'SET_BASE' => !$mx_request_vars->is_request('portalpage'), ! //Enable CSS Files to be loaded direct from phpBB? 'PHPBB' => !(PORTAL_BACKEND === 'internal'), Index: mx_functions_style.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_style.php,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** mx_functions_style.php 25 Oct 2008 22:37:55 -0000 1.103 --- mx_functions_style.php 31 Oct 2008 19:02:21 -0000 1.104 *************** *** 126,130 **** } */ ! if($this->subtemplates) { --- 126,130 ---- } */ ! if($this->subtemplates) { *************** *** 136,140 **** $filename = $this->replace[$filename]; } ! $style_path = $mx_user->template_name; --- 136,140 ---- $filename = $this->replace[$filename]; } ! $style_path = $mx_user->template_name; *************** *** 143,147 **** // $filename2 = substr_count($filename, 'html') ? str_replace(".html", ".tpl", $filename) : str_replace(".tpl", ".html", $filename); ! // // Look at MX-Publisher-Module folder.........................................................................MX-Publisher-module --- 143,147 ---- // $filename2 = substr_count($filename, 'html') ? str_replace(".html", ".tpl", $filename) : str_replace(".tpl", ".html", $filename); ! // // Look at MX-Publisher-Module folder.........................................................................MX-Publisher-module *************** *** 164,168 **** } } ! // --- 164,168 ---- } } ! // *************** *** 232,248 **** $fileSearch[] = $mx_user->default_template_name . '/' . 'template'; // Then check Default template $fileSearch[] = './'; - ! $temppath = $this->doFileSearch($fileSearch, $filename, $filename2, 'styles/', $phpbb_root_path, false); if (!empty($this->module_template_path)) ! { if (!file_exists($root_path . $this->module_template_path . 'gecko.css')) { //Do not include phpBB3 overall header and footer files. $temppath = str_replace('overall_header', 'overall_header_plugin', $temppath); ! $temppath = str_replace('overall_footer', 'overall_footer_plugin', $temppath); ! } ! return $temppath; } --- 232,248 ---- $fileSearch[] = $mx_user->default_template_name . '/' . 'template'; // Then check Default template $fileSearch[] = './'; ! ! $temppath = $this->doFileSearch($fileSearch, $filename, $filename2, 'styles/', $phpbb_root_path, false); if (!empty($this->module_template_path)) ! { if (!file_exists($root_path . $this->module_template_path . 'gecko.css')) { //Do not include phpBB3 overall header and footer files. $temppath = str_replace('overall_header', 'overall_header_plugin', $temppath); ! $temppath = str_replace('overall_footer', 'overall_footer_plugin', $temppath); ! } ! return $temppath; } *************** *** 271,275 **** die("Template->make_filename(): Error - file $filename does not exist. <br />Class-Root: $this->root <br />Module: $module_root_path <br />Current style: $style_path <br />Cloned style: $mx_user->cloned_template_name <br />Default style: $mx_user->default_template_name <br />Custom module default style: $moduleDefault"); } ! /** --- 271,275 ---- die("Template->make_filename(): Error - file $filename does not exist. <br />Class-Root: $this->root <br />Module: $module_root_path <br />Current style: $style_path <br />Cloned style: $mx_user->cloned_template_name <br />Default style: $mx_user->default_template_name <br />Custom module default style: $moduleDefault"); } ! /** *************** *** 286,298 **** $this->module_template_path = ''; foreach ($fileSearch as $key => $path) ! { if (!empty($path) && ($path !== './')) { $this->debug_paths .= '<br>' . $root_path . $root . $path . '/' . $filename; ! if( file_exists($root_path . $root . $path . '/' . $filename) ) ! { $this->module_template_path = $root . $path . '/'; ! return $root_path . $root . $path . '/' . $filename; } --- 286,298 ---- $this->module_template_path = ''; foreach ($fileSearch as $key => $path) ! { if (!empty($path) && ($path !== './')) { $this->debug_paths .= '<br>' . $root_path . $root . $path . '/' . $filename; ! if( file_exists($root_path . $root . $path . '/' . $filename) ) ! { $this->module_template_path = $root . $path . '/'; ! return $root_path . $root . $path . '/' . $filename; } *************** *** 345,349 **** return true; } ! /** * Assigns template filename for handle. --- 345,349 ---- return true; } ! /** * Assigns template filename for handle. *************** *** 377,382 **** } } ! ! //Do not include phpBB3 overall header and footer files using xs_include inside forum integration if ($xs_include && defined('MX_PHPBB3_BLOCK') && $module_root_path) { --- 377,382 ---- } } ! ! //Do not include phpBB3 overall header and footer files using xs_include inside forum integration if ($xs_include && defined('MX_PHPBB3_BLOCK') && $module_root_path) { *************** *** 393,399 **** $fileSearch[] = './'; // Compatibility with primitive modules ! $this->files[$handle] = $this->doFileSearch($fileSearch, $filename3, $filename2, 'templates/', $module_root_path); } ! if (strpos($this->files[$handle],'overall_footer.')) { --- 393,399 ---- $fileSearch[] = './'; // Compatibility with primitive modules ! $this->files[$handle] = $this->doFileSearch($fileSearch, $filename3, $filename2, 'templates/', $module_root_path); } ! if (strpos($this->files[$handle],'overall_footer.')) { *************** *** 407,411 **** $fileSearch[] = './'; // Compatibility with primitive modules ! $this->files[$handle] = $this->doFileSearch($fileSearch, $filename3, $filename2, 'templates/', $module_root_path); } } --- 407,411 ---- $fileSearch[] = './'; // Compatibility with primitive modules ! $this->files[$handle] = $this->doFileSearch($fileSearch, $filename3, $filename2, 'templates/', $module_root_path); } } *************** *** 573,577 **** global $userdata, $board_config, $portal_config, $theme, $images; global $template, $lang, $phpEx, $phpbb_root_path, $mx_root_path, $db; ! global $nav_links, $phpBB2; // --- 573,577 ---- global $userdata, $board_config, $portal_config, $theme, $images; global $template, $lang, $phpEx, $phpbb_root_path, $mx_root_path, $db; ! global $nav_links; // *************** *** 579,584 **** // $board_config['phpbb_lang'] = $board_config['default_lang']; // Handy switch ! $this->lang['default_lang'] = $phpBB2->phpbb_ltrim(basename($phpBB2->phpbb_rtrim($this->decode_lang($board_config['default_lang']))), "'"); ! $this->data['user_lang'] = $phpBB2->phpbb_ltrim(basename($phpBB2->phpbb_rtrim($this->decode_lang($this->data['user_lang']))), "'"); if ( $this->data['user_id'] != ANONYMOUS ) --- 579,584 ---- // $board_config['phpbb_lang'] = $board_config['default_lang']; // Handy switch ! $this->lang['default_lang'] = phpBB2::phpbb_ltrim(basename(phpBB2::phpbb_rtrim($this->decode_lang($board_config['default_lang']))), "'"); ! $this->data['user_lang'] = phpBB2::phpbb_ltrim(basename(phpBB2::phpbb_rtrim($this->decode_lang($this->data['user_lang']))), "'"); if ( $this->data['user_id'] != ANONYMOUS ) *************** *** 603,607 **** // Now, $this->lang['default_lang'] is populated, but do we have a mathing MX-Publisher lang file installed? // ! if ( !file_exists(@$phpBB2->phpbb_realpath($mx_root_path . 'language/lang_' . $this->lang['default_lang'] . '/lang_main.'.$phpEx)) ) { // --- 603,607 ---- // Now, $this->lang['default_lang'] is populated, but do we have a mathing MX-Publisher lang file installed? // ! if ( !file_exists(@phpBB2::phpbb_realpath($mx_root_path . 'language/lang_' . $this->lang['default_lang'] . '/lang_main.'.$phpEx)) ) { // *************** *** 610,614 **** $this->lang['default_lang'] = 'english'; ! if ( !file_exists(@$phpBB2->phpbb_realpath($mx_root_path . 'language/lang_' . $this->lang['default_lang'] . '/lang_main.'.$phpEx)) ) { mx_message_die(CRITICAL_ERROR, 'Could not locate valid language pack: ' . $mx_root_path . 'language/lang_' . $this->lang['default_lang'] . '/lang_main.'.$phpEx); --- 610,614 ---- $this->lang['default_lang'] = 'english'; ! if ( !file_exists(@phpBB2::phpbb_realpath($mx_root_path . 'language/lang_' . $this->lang['default_lang'] . '/lang_main.'.$phpEx)) ) { mx_message_die(CRITICAL_ERROR, 'Could not locate valid language pack: ' . $mx_root_path . 'language/lang_' . $this->lang['default_lang'] . '/lang_main.'.$phpEx); *************** *** 646,650 **** // Load MXP lang keys // ! //Load vanilla phpBB2 lang files if is possible switch (PORTAL_BACKEND) --- 646,650 ---- // Load MXP lang keys // ! //Load vanilla phpBB2 lang files if is possible switch (PORTAL_BACKEND) *************** *** 661,665 **** $shared_lang_path = $phpbb_root_path . 'language/'; break; ! } // AdminCP --- 661,665 ---- $shared_lang_path = $phpbb_root_path . 'language/'; break; ! } // AdminCP *************** *** 687,693 **** } } ! // Core Main Translation after shared phpBB keys so we can overwrite some settings ! require($mx_root_path . "language/lang_" . $this->lang['default_lang'] . "/lang_main.$phpEx"); // --- 687,693 ---- } } ! // Core Main Translation after shared phpBB keys so we can overwrite some settings ! require($mx_root_path . "language/lang_" . $this->lang['default_lang'] . "/lang_main.$phpEx"); // *************** *** 737,741 **** global $template, $lang, $phpEx, $phpbb_root_path, $mx_root_path, $db; global $mx_page, $mx_request_vars; ! // // Build Portal style --- 737,741 ---- global $template, $lang, $phpEx, $phpbb_root_path, $mx_root_path, $db; global $mx_page, $mx_request_vars; ! // // Build Portal style *************** *** 799,817 **** //If user have other style in mxp then the one from phpBB not to have forum page and modules graphics will be messaed up //Anonymouse users should see all block graphic corect ! //Query MXP style_id corepondent to phpBB themes_id ! $sql = "SELECT m.themes_id ! FROM " . MX_THEMES_TABLE . " AS m, " . THEMES_TABLE . " AS t ! WHERE t.themes_id = " . (int) $user_style . " ! AND t.template_name = m.template_name"; ! if ($row = $db->sql_fetchrow($db->sql_query($sql))) ! { ! $style = $row['themes_id']; //User style ! } ! else ! { ! $style = $portal_config['default_style']; ! } ! break; case 'phpbb3': $user_style = $mx_request_vars->post('user_style', MX_TYPE_INT, $this->data['user_style']); --- 799,817 ---- //If user have other style in mxp then the one from phpBB not to have forum page and modules graphics will be messaed up //Anonymouse users should see all block graphic corect ! //Query MXP style_id corepondent to phpBB themes_id ! $sql = "SELECT m.themes_id ! FROM " . MX_THEMES_TABLE . " AS m, " . THEMES_TABLE . " AS t ! WHERE t.themes_id = " . (int) $user_style . " ! AND t.template_name = m.template_name"; ! if ($row = $db->sql_fetchrow($db->sql_query($sql))) ! { ! $style = $row['themes_id']; //User style ! } ! else ! { ! $style = $portal_config['default_style']; ! } ! break; case 'phpbb3': $user_style = $mx_request_vars->post('user_style', MX_TYPE_INT, $this->data['user_style']); *************** *** 819,826 **** //Anonymouse users should see all block graphic corect //Query phpBB style_id corepondent to mxp themes_id ! $sql = "SELECT m.themes_id FROM " . MX_THEMES_TABLE . " AS m, " . STYLES_TABLE . " AS s, " . STYLES_TEMPLATE_TABLE . " AS t WHERE s.style_id = " . (int) $user_style . " ! AND t.template_path = m.template_name AND t.template_id = s.template_id"; --- 819,826 ---- //Anonymouse users should see all block graphic corect //Query phpBB style_id corepondent to mxp themes_id ! $sql = "SELECT m.themes_id FROM " . MX_THEMES_TABLE . " AS m, " . STYLES_TABLE . " AS s, " . STYLES_TEMPLATE_TABLE . " AS t WHERE s.style_id = " . (int) $user_style . " ! AND t.template_path = m.template_name AND t.template_id = s.template_id"; *************** *** 828,839 **** { $style = $row['themes_id']; //User style ! } else { ! $style = $portal_config['default_style']; ! } break; } ! if ( $theme = $this->_setup_style($style) ) { --- 828,839 ---- { $style = $row['themes_id']; //User style ! } else { ! $style = $portal_config['default_style']; ! } break; } ! if ( $theme = $this->_setup_style($style) ) { *************** *** 844,848 **** $style = $mx_request_vars->post('default_style', MX_TYPE_INT, $init_style); $theme = $this->_setup_style($style); ! return; } --- 844,848 ---- $style = $mx_request_vars->post('default_style', MX_TYPE_INT, $init_style); $theme = $this->_setup_style($style); ! return; } *************** *** 858,862 **** { global $db, $board_config, $portal_config, $template, $phpbb_root_path, $mx_root_path, $theme; ! // // Get Style data. --- 858,862 ---- { global $db, $board_config, $portal_config, $template, $phpbb_root_path, $mx_root_path, $theme; ! // // Get Style data. *************** *** 876,887 **** AND mxt.portal_backend = '" . PORTAL_BACKEND . "' AND mxt.themes_id = " . (int) $style; ! break; case 'phpbb3': $sql = "SELECT mxt . *, stt . * , bbt . * ! FROM " . MX_THEMES_TABLE . " AS mxt, " . STYLES_TEMPLATE_TABLE . " AS stt, " . STYLES_TABLE . " AS bbt WHERE mxt.themes_id = " . (int) $style . " ! AND mxt.portal_backend = '" . PORTAL_BACKEND . "' AND stt.template_id = bbt.template_id ! AND bbt.style_name = mxt.template_name"; break; } --- 876,887 ---- AND mxt.portal_backend = '" . PORTAL_BACKEND . "' AND mxt.themes_id = " . (int) $style; ! break; case 'phpbb3': $sql = "SELECT mxt . *, stt . * , bbt . * ! FROM " . MX_THEMES_TABLE . " AS mxt, " . STYLES_TEMPLATE_TABLE . " AS stt, " . STYLES_TABLE . " AS bbt WHERE mxt.themes_id = " . (int) $style . " ! AND mxt.portal_backend = '" . PORTAL_BACKEND . "' AND stt.template_id = bbt.template_id ! AND bbt.style_name = mxt.template_name"; break; } *************** *** 911,933 **** AND mxt.portal_backend = '" . PORTAL_BACKEND . "' AND bbt.themes_id = " . (int) $style; ! break; case 'phpbb3': //Try standard style name $sql = "SELECT mxt . *, stt . * , bbt . * ! FROM " . MX_THEMES_TABLE . " AS mxt, " . STYLES_TEMPLATE_TABLE . " AS stt, " . STYLES_TABLE . " AS bbt WHERE mxt.themes_id = " . (int) $style . " ! AND mxt.portal_backend = '" . PORTAL_BACKEND . "' AND stt.template_id = bbt.template_id AND bbt.style_name = mxt.template_name"; ! //If not standard style name or with spaces try someting else if ( !$db->sql_fetchrow($db->sql_query($sql) ) ) { $sql = "SELECT mxt . *, stt . * , bbt . * ! FROM " . MX_THEMES_TABLE . " AS mxt, " . STYLES_TEMPLATE_TABLE . " AS stt, " . STYLES_TABLE . " AS bbt WHERE mxt.themes_id = " . (int) $style . " ! AND mxt.portal_backend = '" . PORTAL_BACKEND . "' AND stt.template_id = bbt.template_id ! AND stt.template_path = mxt.template_name"; ! } break; } --- 911,933 ---- AND mxt.portal_backend = '" . PORTAL_BACKEND . "' AND bbt.themes_id = " . (int) $style; ! break; case 'phpbb3': //Try standard style name $sql = "SELECT mxt . *, stt . * , bbt . * ! FROM " . MX_THEMES_TABLE . " AS mxt, " . STYLES_TEMPLATE_TABLE . " AS stt, " . STYLES_TABLE . " AS bbt WHERE mxt.themes_id = " . (int) $style . " ! AND mxt.portal_backend = '" . PORTAL_BACKEND . "' AND stt.template_id = bbt.template_id AND bbt.style_name = mxt.template_name"; ! //If not standard style name or with spaces try someting else if ( !$db->sql_fetchrow($db->sql_query($sql) ) ) { $sql = "SELECT mxt . *, stt . * , bbt . * ! FROM " . MX_THEMES_TABLE . " AS mxt, " . STYLES_TEMPLATE_TABLE . " AS stt, " . STYLES_TABLE . " AS bbt WHERE mxt.themes_id = " . (int) $style . " ! AND mxt.portal_backend = '" . PORTAL_BACKEND . "' AND stt.template_id = bbt.template_id ! AND stt.template_path = mxt.template_name"; ! } break; } *************** *** 939,945 **** if ( !($row = $db->sql_fetchrow($result)) ) ! { $style = $portal_config['default_style']; ! switch (PORTAL_BACKEND) { --- 939,945 ---- if ( !($row = $db->sql_fetchrow($result)) ) ! { $style = $portal_config['default_style']; ! switch (PORTAL_BACKEND) { *************** *** 960,977 **** //Try standard style name $sql = "SELECT mxt . *, stt . * , bbt . * ! FROM " . MX_THEMES_TABLE . " AS mxt, " . STYLES_TEMPLATE_TABLE . " AS stt, " . STYLES_TABLE . " AS bbt WHERE mxt.themes_id = " . (int) $style . " ! AND mxt.portal_backend = '" . PORTAL_BACKEND . "' AND stt.template_id = bbt.template_id AND bbt.style_name = mxt.template_name"; ! //If not standard style name or with spaces try someting else if ( !$db->sql_fetchrow($db->sql_query($sql) ) ) { $sql = "SELECT mxt . *, stt . * , bbt . * ! FROM " . MX_THEMES_TABLE . " AS mxt, " . STYLES_TEMPLATE_TABLE . " AS stt, " . STYLES_TABLE . " AS bbt WHERE mxt.themes_id = " . (int) $style . " ! AND mxt.portal_backend = '" . PORTAL_BACKEND . "' AND stt.template_id = bbt.template_id ! AND stt.template_path = mxt.template_name"; } break; --- 960,977 ---- //Try standard style name $sql = "SELECT mxt . *, stt . * , bbt . * ! FROM " . MX_THEMES_TABLE . " AS mxt, " . STYLES_TEMPLATE_TABLE . " AS stt, " . STYLES_TABLE . " AS bbt WHERE mxt.themes_id = " . (int) $style . " ! AND mxt.portal_backend = '" . PORTAL_BACKEND . "' AND stt.template_id = bbt.template_id AND bbt.style_name = mxt.template_name"; ! //If not standard style name or with spaces try someting else if ( !$db->sql_fetchrow($db->sql_query($sql) ) ) { $sql = "SELECT mxt . *, stt . * , bbt . * ! FROM " . MX_THEMES_TABLE . " AS mxt, " . STYLES_TEMPLATE_TABLE . " AS stt, " . STYLES_TABLE . " AS bbt WHERE mxt.themes_id = " . (int) $style . " ! AND mxt.portal_backend = '" . PORTAL_BACKEND . "' AND stt.template_id = bbt.template_id ! AND stt.template_path = mxt.template_name"; } break; *************** *** 1015,1019 **** } } ! } } --- 1015,1019 ---- } } ! } } *************** *** 1112,1118 **** // Load MX-Publisher Template configuration data // ! @include($mx_root_path . $this->current_template_path . '/' . $this->template_name . '.cfg'); - /* Removed since in 3.0.x+ our default template is no style if ( !$mx_template_config ) --- 1112,1118 ---- // Load MX-Publisher Template configuration data // ! @include($mx_root_path . $this->current_template_path . '/' . $this->template_name . '.cfg'); ! /* Removed since in 3.0.x+ our default template is no style if ( !$mx_template_config ) *************** *** 1295,1299 **** { $images[$key] = str_replace('{LANG}', 'lang_' . $img_lang, $value); ! $images[$key] = str_replace(PHPBB_URL . PHPBB_URL, PHPBB_URL, PHPBB_URL . $images[$key]); } } --- 1295,1299 ---- { $images[$key] = str_replace('{LANG}', 'lang_' . $img_lang, $value); ! $images[$key] = str_replace(PHPBB_URL . PHPBB_URL, PHPBB_URL, PHPBB_URL . $images[$key]); } } *************** *** 1310,1314 **** global $images, $board_config, $template, $phpbb_root_path, $mx_root_path, $theme, $current_module_images; global $mx_block, $mx_user; ! //This will keep loaded images $mx3_images = $images; --- 1310,1314 ---- global $images, $board_config, $template, $phpbb_root_path, $mx_root_path, $theme, $current_module_images; global $mx_block, $mx_user; ! //This will keep loaded images $mx3_images = $images; *************** *** 1397,1403 **** $module_key = !empty($module_root_path) ? $module_root_path : 'core'; $this->template_names[$module_key] = $template_name; ! //This will keep loaded images ! $images = &$mx3_images; unset($mx_images); --- 1397,1403 ---- $module_key = !empty($module_root_path) ? $module_root_path : 'core'; $this->template_names[$module_key] = $template_name; ! //This will keep loaded images ! $images = &$mx3_images; unset($mx_images); *************** *** 1555,1564 **** // $this->_init_style(); ! // // Load images // $this->_load_phpbb_images(); ! $this->_load_mxbb_images(); } --- 1555,1564 ---- // $this->_init_style(); ! // // Load images // $this->_load_phpbb_images(); ! $this->_load_mxbb_images(); } Index: mx_functions_admincp.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_admincp.php,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** mx_functions_admincp.php 6 Oct 2008 13:20:03 -0000 1.62 --- mx_functions_admincp.php 31 Oct 2008 19:02:21 -0000 1.63 *************** *** 15,23 **** } - if( !function_exists('sync') ) - { - include_once($mx_root_path . 'includes/shared/phpbb2/includes/functions_admin.' . $phpEx); - } - /**#@+ * AdminCP Class Flags --- 15,18 ---- *************** *** 309,335 **** SELECT " . $next_id . ", parameter_id, parameter_default FROM " . PARAMETER_TABLE . " par " . " WHERE function_id = " . $function_id; ! if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Couldn't insert parameter information", "", __LINE__, __FILE__, $sql); } ! /* ! $sql = "SELECT " . $next_id . ", parameter_id, parameter_default ! FROM " . PARAMETER_TABLE . " par " . " WHERE function_id = " . $function_id; ! if( !($result = $db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, "Couldn't insert row in blocks table", "", __LINE__, __FILE__, $sql); ! } ! $row = $db->sql_fetchrow($result); ! ! $sql = array( ! 'block_id' => (int) $row['block_id'], ! 'parameter_id' => (int) $row['parameter_id'], ! 'parameter_value' => $row['parameter_value'], ! ); ! ! $result = $db->sql_query("INSERT INTO " . BLOCK_SYSTEM_PARAMETER_TABLE . $db->sql_build_array('INSERT', $sql)); ! */ ! // // Update cache --- 304,313 ---- SELECT " . $next_id . ", parameter_id, parameter_default FROM " . PARAMETER_TABLE . " par " . " WHERE function_id = " . $function_id; ! if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Couldn't insert parameter information", "", __LINE__, __FILE__, $sql); } ! // // Update cache *************** *** 388,392 **** $page_id_new = $row['next_id'] + 1; ! $page_order_new = $row['next_order'] + 1; --- 366,370 ---- $page_id_new = $row['next_id'] + 1; ! $page_order_new = $row['next_order'] + 1; *************** *** 395,399 **** die('Couldn\'t find max page_id'); } ! if( empty($page_order_new) ) { --- 373,377 ---- die('Couldn\'t find max page_id'); } ! if( empty($page_order_new) ) { *************** *** 401,406 **** } - $parents_data = ''; //To do - $page_row = array( "page_id" => (int) $page_id_new, --- 379,382 ---- *************** *** 412,422 **** "page_icon" => $page_icon , "page_alt_icon" => $page_alt_icon, - //"menu_icon" => $menu_icon, - //"menu_alt_icon" => $menu_alt_icon, - //"menu_alt_icon_hot" => $menu_alt_icon_hot, - //"menu_active" => (int) $menu_active, "auth_view" => (int) $auth_view, - //"auth_view_group" => $auth_view_group, - //"auth_moderator_group" => $auth_moderator_group, "default_style" => (int) $default_style, "override_user_style" => (int) $override_user_style, --- 388,392 ---- *************** *** 426,434 **** "navigation_block" => (int) $navigation_block, "ip_filter" => $ipfilter , ! "phpbb_stats" => (int) $phpbb_stats, ); ! $sql = "INSERT INTO " . PAGE_TABLE . $db->sql_build_array('INSERT', $page_row); ! if( !($result = $db->sql_query($sql)) ) { --- 396,404 ---- "navigation_block" => (int) $navigation_block, "ip_filter" => $ipfilter , ! "phpbb_stats" => (int) $phpbb_stats, ); ! $sql = "INSERT INTO " . PAGE_TABLE . $db->sql_build_array('INSERT', $page_row); ! if( !($result = $db->sql_query($sql)) ) { *************** *** 1929,1935 **** { ! // ???? $column_id = $mx_request_vars->get('column_id', MX_TYPE_INT); ! sync('block', $mx_request_vars->get('block_id', MX_TYPE_INT)); $show_index = true; --- 1899,1905 ---- { ! // Not implemented $column_id = $mx_request_vars->get('column_id', MX_TYPE_INT); ! //sync('block', $mx_request_vars->get('block_id', MX_TYPE_INT)); $show_index = true; *************** *** 2258,2284 **** if( $count == 0 ) ! { $sql_add = "INSERT INTO " . BLOCK_SYSTEM_PARAMETER_TABLE . "( block_id, parameter_id, parameter_value ) SELECT " . $block_id . ", " . $sys_param_rows[$p]['parameter_id'] . ", parameter_default FROM " . PARAMETER_TABLE . " par " . " WHERE function_id = " . $function_id . " AND parameter_id = " . $sys_param_rows[$p]['parameter_id']; ! /* ! $sql = "SELECT " . $block_id . ", " . $sys_param_rows[$p]['parameter_id'] . ", parameter_default ! FROM " . PARAMETER_TABLE . " par " . " WHERE function_id = " . $function_id . " AND parameter_id = " . $sys_param_rows[$p]['parameter_id']; ! if( !($result = $db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, "Couldn't insert row in blocks table", "", __LINE__, __FILE__, $sql); ! } ! while($row = $db->sql_fetchrow($result)) ! { ! $sql_array = array( ! 'block_id' => (int) $block_id, ! 'parameter_id' => (int) $sys_param_rows[$p]['parameter_id'], ! 'parameter_value' => $row['parameter_value'], ! ); ! } ! $sql_add = "INSERT INTO " . BLOCK_SYSTEM_PARAMETER_TABLE . $db->sql_build_array('INSERT', $sql_array); ! */ ! $result_add = $db->sql_query($sql_add); ! $output_message .= '<br /> + (' . $sys_param_rows[$p]['parameter_name'] . ', ' . $sys_param_rows[$p]['parameter_id'] . ', ' . $block_id . '),'; $output_message .= !$result_add ? '<br /><b><font color=#0000ff>[db...error]</font></b> line: ' . __LINE__ . ' , ' . $sql_add . '<br />' : ''; --- 2228,2238 ---- if( $count == 0 ) ! { $sql_add = "INSERT INTO " . BLOCK_SYSTEM_PARAMETER_TABLE . "( block_id, parameter_id, parameter_value ) SELECT " . $block_id . ", " . $sys_param_rows[$p]['parameter_id'] . ", parameter_default FROM " . PARAMETER_TABLE . " par " . " WHERE function_id = " . $function_id . " AND parameter_id = " . $sys_param_rows[$p]['parameter_id']; ! ! $result_add = $db->sql_query($sql_add); ! $output_message .= '<br /> + (' . $sys_param_rows[$p]['parameter_name'] . ', ' . $sys_param_rows[$p]['parameter_id'] . ', ' . $block_id . '),'; $output_message .= !$result_add ? '<br /><b><font color=#0000ff>[db...error]</font></b> line: ' . __LINE__ . ' , ' . $sql_add . '<br />' : ''; *************** *** 2745,2750 **** // $fcontents = $this->getSafeObjects($fcontents); ! ! $parameter_order = 0; // --- 2699,2704 ---- // $fcontents = $this->getSafeObjects($fcontents); ! ! $parameter_order = 0; // Needed? // *************** *** 2814,2821 **** $fldkey = 'parameter_id'; $key = $module_data[2]; ++$parameter_order; $sql = array( 'function_id' => (int) $module_data[1], ! 'parameter_id' => (int) $module_data[2], 'parameter_name' => stripslashes($module_data[3]), 'parameter_type' => stripslashes($module_data[4]), --- 2768,2779 ---- $fldkey = 'parameter_id'; $key... [truncated message content] |