Update of /cvsroot/mxbb/core/includes/shared/phpbb3/includes In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv30073/includes/shared/phpbb3/includes Modified Files: functions.php functions_admin.php functions_hook.php functions_module.php functions_posting.php message_parser.php Log Message: new Mx_BBcode merged in one backend file Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb3/includes/functions.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** functions.php 30 Sep 2008 07:04:43 -0000 1.22 --- functions.php 4 Oct 2008 07:04:25 -0000 1.23 *************** *** 121,125 **** foreach ($_var as $k => $v) { ! $phpBB3->set_var($k, $k, $key_type); if ($type == 'array' && is_array($v)) { --- 121,125 ---- foreach ($_var as $k => $v) { ! phpBB3::set_var($k, $k, $key_type); if ($type == 'array' && is_array($v)) { *************** *** 130,135 **** $_v = null; } ! $phpBB3->set_var($_k, $_k, $sub_key_type); ! $phpBB3->set_var($var[$k][$_k], $_v, $sub_type, $multibyte); } } --- 130,135 ---- $_v = null; } ! phpBB3::set_var($_k, $_k, $sub_key_type); ! phpBB3::set_var($var[$k][$_k], $_v, $sub_type, $multibyte); } } *************** *** 140,144 **** $v = null; } ! $phpBB3->set_var($var[$k], $v, $type, $multibyte); } } --- 140,144 ---- $v = null; } ! phpBB3::set_var($var[$k], $v, $type, $multibyte); } } *************** *** 146,150 **** else { ! $phpBB3->set_var($var, $var, $type, $multibyte); } --- 146,150 ---- else { ! phpBB3::set_var($var, $var, $type, $multibyte); } *************** *** 186,190 **** function gen_rand_string($num_chars = 8) { ! $rand_str = $phpBB3->unique_id(); $rand_str = str_replace('0', 'Z', strtoupper(base_convert($rand_str, 16, 35))); --- 186,190 ---- function gen_rand_string($num_chars = 8) { ! $rand_str = phpBB3::unique_id(); $rand_str = str_replace('0', 'Z', strtoupper(base_convert($rand_str, 16, 35))); *************** *** 207,212 **** if ($dss_seeded !== true && ($board_config['rand_seed_last_update'] < time() - rand(1,10))) { ! $phpBB3->set_config('rand_seed', $board_config['rand_seed'], true); ! $phpBB3->set_config('rand_seed_last_update', time(), true); $dss_seeded = true; } --- 207,212 ---- if ($dss_seeded !== true && ($board_config['rand_seed_last_update'] < time() - rand(1,10))) { ! phpBB3::set_config('rand_seed', $board_config['rand_seed'], true); ! phpBB3::set_config('rand_seed_last_update', time(), true); $dss_seeded = true; } *************** *** 303,307 **** $itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; ! $random_state = $phpBB3->unique_id(); $random = ''; $count = 6; --- 303,307 ---- $itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; ! $random_state = phpBB3::unique_id(); $random = ''; $count = 6; *************** *** 325,329 **** } ! $hash = $phpBB3->_hash_crypt_private($password, $phpBB3->_hash_gensalt_private($random, $itoa64), $itoa64); if (strlen($hash) == 34) --- 325,329 ---- } ! $hash = phpBB3::_hash_crypt_private($password, phpBB3::_hash_gensalt_private($random, $itoa64), $itoa64); if (strlen($hash) == 34) *************** *** 343,347 **** if (strlen($hash) == 34) { ! return ($this->_hash_crypt_private($password, $hash, $itoa64) === $hash) ? true : false; } --- 343,347 ---- if (strlen($hash) == 34) { ! return (phpBB3::_hash_crypt_private($password, $hash, $itoa64) === $hash) ? true : false; } *************** *** 361,365 **** $output = '$H$'; $output .= $itoa64[min($iteration_count_log2 + ((PHP_VERSION >= 5) ? 5 : 3), 30)]; ! $output .= $phpBB3->_hash_encode64($input, 6, $itoa64); return $output; --- 361,365 ---- $output = '$H$'; $output .= $itoa64[min($iteration_count_log2 + ((PHP_VERSION >= 5) ? 5 : 3), 30)]; ! $output .= phpBB3::_hash_encode64($input, 6, $itoa64); return $output; *************** *** 466,470 **** $output = substr($setting, 0, 12); ! $output .= $phpBB3->_hash_encode64($hash, 16, $itoa64); return $output; --- 466,470 ---- $output = substr($setting, 0, 12); ! $output .= phpBB3::_hash_encode64($hash, 16, $itoa64); return $output; *************** *** 669,674 **** if ( isset( $_POST['creation_time'] ) && isset( $_POST['form_token'] ) ) { ! $creation_time = abs( $phpBB3->request_var( 'creation_time', 0 ) ); ! $token = $phpBB3->request_var( 'form_token', '' ); $diff = ( time() - $creation_time ); --- 669,674 ---- if ( isset( $_POST['creation_time'] ) && isset( $_POST['form_token'] ) ) { ! $creation_time = abs( phpBB3::request_var( 'creation_time', 0 ) ); ! $token = phpBB3::request_var( 'form_token', '' ); $diff = ( time() - $creation_time ); *************** *** 748,752 **** if ( $desc ) { ! $phpBB3->generate_text_for_storage( $sql_ary['group_desc'], $sql_ary['group_desc_uid'], $sql_ary['group_desc_bitfield'], $sql_ary['group_desc_options'], $allow_desc_bbcode, $allow_desc_urls, $allow_desc_smilies ); } --- 748,752 ---- if ( $desc ) { ! phpBB3::generate_text_for_storage( $sql_ary['group_desc'], $sql_ary['group_desc_uid'], $sql_ary['group_desc_bitfield'], $sql_ary['group_desc_options'], $allow_desc_bbcode, $allow_desc_urls, $allow_desc_smilies ); } *************** *** 1210,1214 **** if ($truncate) { ! $zone_trunc = $phpBB3->truncate_string($zone, 50, false, '...'); } else --- 1210,1214 ---- if ($truncate) { ! $zone_trunc = phpBB3::truncate_string($zone, 50, false, '...'); } else *************** *** 2177,2180 **** --- 2177,2181 ---- { global $db, $mx_cache, $board_config, $mx_user, $phpbb_root_path; + global $phpBB2, $mx_root_path; if (empty($user->lang)) *************** *** 2197,2201 **** { // Malformed url, redirect to current page... ! $url = $phpBB3->generate_board_url() . '/' . $mx_user->page['page']; } else if (!empty($url_parts['scheme']) && !empty($url_parts['host'])) --- 2198,2202 ---- { // Malformed url, redirect to current page... ! $url = phpBB3::generate_board_url() . '/' . $mx_user->page['page']; } else if (!empty($url_parts['scheme']) && !empty($url_parts['host'])) *************** *** 2206,2210 **** { // Absolute uri, prepend direct url... ! $url = $phpBB3->generate_board_url(true) . $url; } else --- 2207,2211 ---- { // Absolute uri, prepend direct url... ! $url = phpBB3::generate_board_url(true) . $url; } else *************** *** 2226,2234 **** if ($user->page['page_dir']) { ! $url = $phpBB3->generate_board_url() . '/' . $user->page['page_dir'] . '/' . $url; } else { ! $url = $phpBB3->generate_board_url() . '/' . $url; } } --- 2227,2235 ---- if ($user->page['page_dir']) { ! $url = phpBB3::generate_board_url() . '/' . $user->page['page_dir'] . '/' . $url; } else { ! $url = phpBB3::generate_board_url() . '/' . $url; } } *************** *** 2266,2270 **** $url = $dir . '/' . $url; ! $url = $phpBB3->generate_board_url() . '/' . $url; } } --- 2267,2271 ---- $url = $dir . '/' . $url; ! $url = phpBB3::generate_board_url() . '/' . $url; } } *************** *** 2408,2412 **** global $template; ! $url = $phpBB3->redirect($url, true); // For XHTML compatibility we change back & to & --- 2409,2413 ---- global $template; ! $url = phpBB3::redirect($url, true); // For XHTML compatibility we change back & to & *************** *** 2450,2456 **** if ($check && $confirm) { ! $user_id = $phpBB3->request_var('user_id', 0); ! $session_id = $phpBB3->request_var('sess', ''); ! $confirm_key = $phpBB3->request_var('confirm_key', ''); if ($user_id != $user->data['user_id'] || $session_id != $user->session_id || !$confirm_key || !$user->data['user_last_confirm_key'] || $confirm_key != $user->data['user_last_confirm_key']) --- 2451,2457 ---- if ($check && $confirm) { ! $user_id = phpBB3::request_var('user_id', 0); ! $session_id = phpBB3::request_var('sess', ''); ! $confirm_key = phpBB3::request_var('confirm_key', ''); if ($user_id != $user->data['user_id'] || $session_id != $user->session_id || !$confirm_key || !$user->data['user_last_confirm_key'] || $confirm_key != $user->data['user_last_confirm_key']) *************** *** 2478,2482 **** // generate activation key ! $confirm_key = $phpBB3->gen_rand_string(10); if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) --- 2479,2483 ---- // generate activation key ! $confirm_key = phpBB3::gen_rand_string(10); if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) *************** *** 2502,2506 **** // re-add sid / transform & to & for user->page (user->page is always using &) $use_page = ($u_action) ? $phpbb_root_path . $u_action : $phpbb_root_path . str_replace('&', '&', $user->page['page']); ! $u_action = $phpBB3->reapply_sid($use_page); $u_action .= ((strpos($u_action, '?') === false) ? '?' : '&') . 'confirm_key=' . $confirm_key; --- 2503,2507 ---- // re-add sid / transform & to & for user->page (user->page is always using &) $use_page = ($u_action) ? $phpbb_root_path . $u_action : $phpbb_root_path . str_replace('&', '&', $user->page['page']); ! $u_action = phpBB3::reapply_sid($use_page); $u_action .= ((strpos($u_action, '?') === false) ? '?' : '&') . 'confirm_key=' . $confirm_key; *************** *** 2557,2562 **** if (isset($_POST['login'])) { ! $username = $phpBB3->request_var('username', '', true); ! $password = $phpBB3->request_var('password', '', true); $autologin = (!empty($_POST['autologin'])) ? true : false; $viewonline = (!empty($_POST['viewonline'])) ? 0 : 1; --- 2558,2563 ---- if (isset($_POST['login'])) { ! $username = phpBB3::request_var('username', '', true); ! $password = phpBB3::request_var('password', '', true); $autologin = (!empty($_POST['autologin'])) ? true : false; $viewonline = (!empty($_POST['viewonline'])) ? 0 : 1; *************** *** 2603,2607 **** if ($result['status'] == LOGIN_SUCCESS) { ! $redirect = $phpBB3->request_var('redirect', "{$phpbb_root_path}index.$phpEx"); $message = ($l_success) ? $l_success : $user->lang['LOGIN_REDIRECT']; $l_redirect = ($admin) ? $user->lang['PROCEED_TO_ACP'] : (($redirect === "{$phpbb_root_path}index.$phpEx" || $redirect === "index.$phpEx") ? $user->lang['RETURN_INDEX'] : $user->lang['RETURN_PAGE']); --- 2604,2608 ---- if ($result['status'] == LOGIN_SUCCESS) { ! $redirect = phpBB3::request_var('redirect', "{$phpbb_root_path}index.$phpEx"); $message = ($l_success) ? $l_success : $user->lang['LOGIN_REDIRECT']; $l_redirect = ($admin) ? $user->lang['PROCEED_TO_ACP'] : (($redirect === "{$phpbb_root_path}index.$phpEx" || $redirect === "index.$phpEx") ? $user->lang['RETURN_INDEX'] : $user->lang['RETURN_PAGE']); *************** *** 2739,2743 **** global $db, $board_config, $user, $template, $phpEx; ! $password = $phpBB3->request_var('password', '', true); $sql = 'SELECT forum_id --- 2740,2744 ---- global $db, $board_config, $user, $template, $phpEx; ! $password = phpBB3::request_var('password', '', true); $sql = 'SELECT forum_id *************** *** 2977,2981 **** $message = str_replace($match, $replace, $message); ! $match = $phpBB3->get_preg_expression('bbcode_htm'); $replace = array('\1', '\1', '\2', '\1', '', ''); --- 2978,2982 ---- $message = str_replace($match, $replace, $message); ! $match = phpBB3::get_preg_expression('bbcode_htm'); $replace = array('\1', '\1', '\2', '\1', '', ''); *************** *** 2995,2999 **** $text = preg_replace("#\[\/?[a-z0-9\*\+\-]+(?:=.*?)?(?::[a-z])?(\:?$uid)\]#", ' ', $text); ! $match = $phpBB3->get_preg_expression('bbcode_htm'); $replace = array('\1', '\1', '\2', '\1', '', ''); --- 2996,3000 ---- $text = preg_replace("#\[\/?[a-z0-9\*\+\-]+(?:=.*?)?(?::[a-z])?(\:?$uid)\]#", ' ', $text); ! $match = phpBB3::get_preg_expression('bbcode_htm'); $replace = array('\1', '\1', '\2', '\1', '', ''); *************** *** 3015,3019 **** } ! $text = $phpBB3->censor_text($text); // Parse bbcode if bbcode uid stored and bbcode enabled --- 3016,3020 ---- } ! $text = phpBB3::censor_text($text); // Parse bbcode if bbcode uid stored and bbcode enabled *************** *** 3040,3044 **** $text = str_replace("\n", '<br />', $text); ! $text = $phpBB3->smiley_text($text, !($flags & OPTION_FLAG_SMILIES)); return $text; --- 3041,3045 ---- $text = str_replace("\n", '<br />', $text); ! $text = phpBB3::smiley_text($text, !($flags & OPTION_FLAG_SMILIES)); return $text; *************** *** 3093,3097 **** global $phpbb_root_path, $phpEx; ! $phpBB3->decode_message($text, $uid); return array( --- 3094,3098 ---- global $phpbb_root_path, $phpEx; ! phpBB3::decode_message($text, $uid); return array( *************** *** 3223,3227 **** if ($server_url === false) { ! $server_url = $phpBB3->generate_board_url(); } --- 3224,3228 ---- if ($server_url === false) { ! $server_url = phpBB3::generate_board_url(); } *************** *** 3240,3256 **** // relative urls for this board ! $magic_url_match[] = '#(^|[\n\t (>])(' . preg_quote($server_url, '#') . ')/(' . $phpBB3->get_preg_expression('relative_url_inline') . ')#ie'; $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_LOCAL, '\$1', '\$2', '\$3', '$local_class')"; // matches a xxxx://aaaaa.bbb.cccc. ... ! $magic_url_match[] = '#(^|[\n\t (>])(' . $phpBB3->get_preg_expression('url_inline') . ')#ie'; $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_FULL, '\$1', '\$2', '', '$class')"; // matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing ! $magic_url_match[] = '#(^|[\n\t (>])(' . $phpBB3->get_preg_expression('www_url_inline') . ')#ie'; $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_WWW, '\$1', '\$2', '', '$class')"; // matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode. ! $magic_url_match[] = '/(^|[\n\t (>])(' . $phpBB3->get_preg_expression('email') . ')/ie'; $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_EMAIL, '\$1', '\$2', '', '')"; } --- 3241,3257 ---- // relative urls for this board ! $magic_url_match[] = '#(^|[\n\t (>])(' . preg_quote($server_url, '#') . ')/(' . phpBB3::get_preg_expression('relative_url_inline') . ')#ie'; $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_LOCAL, '\$1', '\$2', '\$3', '$local_class')"; // matches a xxxx://aaaaa.bbb.cccc. ... ! $magic_url_match[] = '#(^|[\n\t (>])(' . phpBB3::get_preg_expression('url_inline') . ')#ie'; $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_FULL, '\$1', '\$2', '', '$class')"; // matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing ! $magic_url_match[] = '#(^|[\n\t (>])(' . phpBB3::get_preg_expression('www_url_inline') . ')#ie'; $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_WWW, '\$1', '\$2', '', '$class')"; // matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode. ! $magic_url_match[] = '/(^|[\n\t (>])(' . phpBB3::get_preg_expression('email') . ')/ie'; $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_EMAIL, '\$1', '\$2', '', '')"; } *************** *** 3423,3427 **** $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); ! $comment = str_replace("\n", '<br />', $phpBB3->censor_text($attachment['attach_comment'])); $block_array += array( --- 3424,3428 ---- $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); ! $comment = str_replace("\n", '<br />', phpBB3::censor_text($attachment['attach_comment'])); $block_array += array( *************** *** 3532,3536 **** $block_array += array( ! 'U_FORUM' => $phpBB3->generate_board_url(), 'ATTACH_ID' => $attachment['attach_id'], 'S_WM_FILE' => true, --- 3533,3537 ---- $block_array += array( ! 'U_FORUM' => phpBB3::generate_board_url(), 'ATTACH_ID' => $attachment['attach_id'], 'S_WM_FILE' => true, *************** *** 3549,3553 **** 'S_RM_FILE' => ($display_cat == ATTACHMENT_CATEGORY_RM) ? true : false, 'S_QUICKTIME_FILE' => ($display_cat == ATTACHMENT_CATEGORY_QUICKTIME) ? true : false, ! 'U_FORUM' => $phpBB3->generate_board_url(), 'ATTACH_ID' => $attachment['attach_id'], ); --- 3550,3554 ---- 'S_RM_FILE' => ($display_cat == ATTACHMENT_CATEGORY_RM) ? true : false, 'S_QUICKTIME_FILE' => ($display_cat == ATTACHMENT_CATEGORY_QUICKTIME) ? true : false, ! 'U_FORUM' => phpBB3::generate_board_url(), 'ATTACH_ID' => $attachment['attach_id'], ); *************** *** 3815,3819 **** function get_backtrace() { ! global $phpbb_root_path; $output = '<div style="font-family: monospace;">'; --- 3816,3820 ---- function get_backtrace() { ! global $phpbb_root_path, $phpBB2; $output = '<div style="font-family: monospace;">'; *************** *** 4357,4361 **** if (!empty($_REQUEST['f'])) { ! $f = $phpBB3->request_var('f', 0); $reading_sql = ' AND s.session_page ' . $db->sql_like_expression("{$db->any_char}_f_={$f}x{$db->any_char}"); --- 4358,4362 ---- if (!empty($_REQUEST['f'])) { ! $f = phpBB3::request_var('f', 0); $reading_sql = ' AND s.session_page ' . $db->sql_like_expression("{$db->any_char}_f_={$f}x{$db->any_char}"); *************** *** 4476,4481 **** if ($total_online_users > $board_config['record_online_users']) { ! $phpBB3->set_config('record_online_users', $total_online_users, true); ! $phpBB3->set_config('record_online_date', time(), true); } --- 4477,4482 ---- if ($total_online_users > $board_config['record_online_users']) { ! phpBB3::set_config('record_online_users', $total_online_users, true); ! phpBB3::set_config('record_online_date', time(), true); } *************** *** 4751,4755 **** $template->display('body'); ! $phpBB3->garbage_collection(); exit; --- 4752,4756 ---- $template->display('body'); ! phpBB3::garbage_collection(); exit; |