Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv26368/includes Modified Files: mx_functions.php mx_functions_core.php mx_functions_style.php mx_functions_tools.php page_header.php page_tail.php Log Message: rewrite for php4 and php6 issues Index: page_tail.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/page_tail.php,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** page_tail.php 11 Jul 2008 22:00:17 -0000 1.40 --- page_tail.php 30 Sep 2008 07:04:38 -0000 1.41 *************** *** 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.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** mx_functions_core.php 24 Sep 2008 14:26:07 -0000 1.105 --- mx_functions_core.php 30 Sep 2008 07:04:37 -0000 1.106 *************** *** 2061,2065 **** $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( --- 2061,2065 ---- $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( Index: mx_functions_tools.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_tools.php,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** mx_functions_tools.php 27 Sep 2008 18:55:26 -0000 1.43 --- mx_functions_tools.php 30 Sep 2008 07:04:37 -0000 1.44 *************** *** 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, "\\"); } *************** *** 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') ) { ! mx_cache::load_file('functions_post', 'phpbb2'); } if( !function_exists('add_search_words') ) { ! mx_cache::load_file('functions_search', 'phpbb2'); } --- 1625,1634 ---- if( !function_exists('prepare_message') ) { ! $mx_backend->load_file('functions_post', 'phpbb2'); } if( !function_exists('add_search_words') ) { ! $mx_backend->load_file('functions_search', 'phpbb2'); } *************** *** 3144,3148 **** $username = addslashes(unprepare_message(trim($user_name))); ! $username = phpBB2::phpbb_clean_username( $username ); // --- 3144,3148 ---- $username = addslashes(unprepare_message(trim($user_name))); ! $username = $phpBB2->phpbb_clean_username( $username ); // *************** *** 3825,3829 **** 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'] ); // --- 3825,3829 ---- 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'] ); // *************** *** 3966,3970 **** $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) --- 3966,3970 ---- $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,4057 **** $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'] ) : ''; // --- 4050,4057 ---- $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'] ) : ''; // *************** *** 4104,4108 **** $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 --- 4104,4108 ---- $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 *************** *** 4209,4213 **** $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) --- 4209,4213 ---- $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) Index: page_header.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/page_header.php,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** page_header.php 7 Sep 2008 20:57:33 -0000 1.61 --- page_header.php 30 Sep 2008 07:04:38 -0000 1.62 *************** *** 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'], Index: mx_functions_style.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_style.php,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** mx_functions_style.php 6 Sep 2008 17:46:40 -0000 1.93 --- mx_functions_style.php 30 Sep 2008 07:04:37 -0000 1.94 *************** *** 573,577 **** global $userdata, $board_config, $portal_config, $theme, $images; global $template, $lang, $phpEx, $phpbb_root_path, $mx_root_path, $db; ! global $nav_links; // --- 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; // *************** *** 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['session_logged_in'] ) --- 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['session_logged_in'] ) *************** *** 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); Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** mx_functions.php 27 Sep 2008 18:55:23 -0000 1.93 --- mx_functions.php 30 Sep 2008 07:04:36 -0000 1.94 *************** *** 36,40 **** { global $db, $layouttemplate, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $nav_links, $gen_simple_header, $images, $mx_root_path, $module_root_path; ! global $userdata, $user_ip, $session_length, $mx_backend; global $mx_starttime, $mx_page, $mx_block, $mx_user, $mx_request_vars, $mx_cache, $tplEx; --- 36,40 ---- { global $db, $layouttemplate, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $nav_links, $gen_simple_header, $images, $mx_root_path, $module_root_path; ! global $userdata, $user_ip, $session_length, $mx_backend, $phpBB2; global $mx_starttime, $mx_page, $mx_block, $mx_user, $mx_request_vars, $mx_cache, $tplEx; *************** *** 761,765 **** if (!is_numeric($user) || $force_str) { ! $user = phpBB2::phpbb_clean_username($user); } else --- 761,765 ---- if (!is_numeric($user) || $force_str) { ! $user = $phpBB2->phpbb_clean_username($user); } else *************** *** 801,805 **** while ( $file = readdir($dir) ) { ! if (preg_match('#^lang_#i', $file) && !is_file(@phpBB2::phpbb_realpath($mx_root_path . $dirname . '/' . $file)) && !is_link(@phpBB2::phpbb_realpath($mx_root_path . $dirname . '/' . $file))) { $filename = trim(str_replace("lang_", "", $file)); --- 801,805 ---- while ( $file = readdir($dir) ) { ! if (preg_match('#^lang_#i', $file) && !is_file(@$phpBB2->phpbb_realpath($mx_root_path . $dirname . '/' . $file)) && !is_link(@$phpBB2->phpbb_realpath($mx_root_path . $dirname . '/' . $file))) { $filename = trim(str_replace("lang_", "", $file)); |