|
From: Jon O. <jon...@us...> - 2008-02-19 21:39:51
|
Update of /cvsroot/mxbb/mx_phpbb/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19708/includes Modified Files: forum_hack.php Log Message: Reviewed, according to team discussion. Index: forum_hack.php =================================================================== RCS file: /cvsroot/mxbb/mx_phpbb/includes/forum_hack.php,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** forum_hack.php 19 Feb 2008 00:28:45 -0000 1.40 --- forum_hack.php 19 Feb 2008 21:39:46 -0000 1.41 *************** *** 14,17 **** --- 14,20 ---- } + // + // Subcalls + // if ($_GET['mode'] == 'topicreview' || $_GET['mode'] == 'smilies' || $_GET['mode'] == 'newpm') { *************** *** 21,36 **** define( 'MX_FORUM_DEBUG', 1 ); include_once($mx_root_path . 'includes/shared/phpbb2/includes/functions.' . $phpEx); if(!function_exists(style_select)) { ! include_once($mx_root_path . 'includes/shared/phpbb2/includes/functions_selects.' . $phpEx); } if(!function_exists(generate_smilies)) { ! include_once($mx_root_path . 'includes/shared/phpbb2/includes/functions_post.' . $phpEx); } //Check for mx_smartor fap version // We need to check the DB too, since we can have the files there but not installed !! --- 24,69 ---- define( 'MX_FORUM_DEBUG', 1 ); + // + // Include mxp functions + // include_once($mx_root_path . 'includes/shared/phpbb2/includes/functions.' . $phpEx); + // + // Include phpbb functions (in 2.9.x, since they are not already loaded) + // + if(!function_exists(auth_check_user)) + { + // Do we really need this one? + include_once($phpbb_root_path . 'includes/auth.' . $phpEx); + } + if(!function_exists(get_db_stat)) + { + include_once($phpbb_root_path . 'includes/functions.' . $phpEx); + } + if(!function_exists(style_select)) { ! include_once($phpbb_root_path . 'includes/functions_selects.' . $phpEx); } if(!function_exists(generate_smilies)) { ! include_once($phpbb_root_path . 'includes/functions_post.' . $phpEx); } + /* + // Cannot be loaded here, since its functions load other includes + if(!function_exists(clean_words)) + { + include_once($phpbb_root_path . 'includes/functions_search.' . $phpEx); + } + */ + + if(!function_exists(smilies_pass)) + { + include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); + } + + /* //Check for mx_smartor fap version // We need to check the DB too, since we can have the files there but not installed !! *************** *** 44,60 **** $db->sql_freeresult($result); } ! if(!function_exists(smilies_pass)) ! { ! include_once($mx_root_path . 'includes/shared/phpbb2/includes/bbcode.' . $phpEx); ! } ! ! if(!function_exists(auth_check_user)) ! { ! // Do we really need this one? ! include_once($phpbb_root_path . 'includes/auth.' . $phpEx); ! } ! //Check for cash mod if (file_exists($phpbb_root_path . 'includes/functions_cash.'.$phpEx)) { --- 77,86 ---- $db->sql_freeresult($result); } + */ ! // //Check for cash mod + // + /* if (file_exists($phpbb_root_path . 'includes/functions_cash.'.$phpEx)) { *************** *** 70,73 **** --- 96,100 ---- } } + */ // -------------------------------------------------------------------------------- *************** *** 388,392 **** 'login' => $this->phpbb_config['login'], 'memberlist' => $this->phpbb_config['memberlist'], - //'modcp' => $this->phpbb_config['index'], 'modcp' => $this->phpbb_config['index'], //'standalone' ??? 'posting' => $this->phpbb_config['index'], --- 415,418 ---- *************** *** 395,401 **** 'search' => $this->phpbb_config['search'], 'viewonline' => $this->phpbb_config['viewonline'], 'cash' => $this->phpbb_config['other'], 'bin' => $this->phpbb_config['other'], ! 'other' => $this->phpbb_config['other'], ); --- 421,430 ---- 'search' => $this->phpbb_config['search'], 'viewonline' => $this->phpbb_config['viewonline'], + 'other' => $this->phpbb_config['other'], + + // Cash 'cash' => $this->phpbb_config['other'], 'bin' => $this->phpbb_config['other'], ! ); *************** *** 409,413 **** // Something is weird, do not redirect phpbb pages :( // ! $this->forum_pages = array( 'faq' => 0, 'groupcp' => 0, 'index' => 0, --- 438,443 ---- // Something is weird, do not redirect phpbb pages :( // ! $this->forum_pages = array( ! 'faq' => 0, 'groupcp' => 0, 'index' => 0, *************** *** 422,425 **** --- 452,457 ---- 'viewonline' => 0, 'viewtopic' => 0, + + // Cash 'cash' => 0, 'bin' => 0 *************** *** 711,714 **** --- 743,747 ---- // // Show online block + // At some point we need to remove the online block. We already have a mxp online block, and should have the option to remove this phpbb block. // $this->show_online(); *************** *** 840,853 **** // Replaces same function in function.php // ! //$this->make_jumpbox_ref($this->phpbb_url . $action, $match_forum_id); phpBB2::make_jumpbox($this->phpbb_url . $action, $match_forum_id); } function make_jumpbox_ref($action, $match_forum_id, &$forums_list) { global $template, $userdata, $lang, $db, $nav_links, $phpEx, $SID; - // $is_auth = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata); - $sql = "SELECT c.cat_id, c.cat_title, c.cat_order FROM " . CATEGORIES_TABLE . " c, " . FORUMS_TABLE . " f --- 873,888 ---- // Replaces same function in function.php // ! //make_jumpbox( $this->phpbb_url . $action, $match_forum_id ); ! phpBB2::make_jumpbox($this->phpbb_url . $action, $match_forum_id); } + // + // Redeclared, for Simple Subforums MOD + // function make_jumpbox_ref($action, $match_forum_id, &$forums_list) { global $template, $userdata, $lang, $db, $nav_links, $phpEx, $SID; $sql = "SELECT c.cat_id, c.cat_title, c.cat_order FROM " . CATEGORIES_TABLE . " c, " . FORUMS_TABLE . " f *************** *** 975,979 **** 'S_JUMPBOX_SELECT' => $boxstring, ! 'S_JUMPBOX_ACTION' => append_sid($action)) ); $template->assign_var_from_handle('JUMPBOX', 'jumpbox'); --- 1010,1014 ---- 'S_JUMPBOX_SELECT' => $boxstring, ! 'S_JUMPBOX_ACTION' => mx_append_sid($action)) ); $template->assign_var_from_handle('JUMPBOX', 'jumpbox'); *************** *** 982,986 **** } - // -------------------------------------------------------------------------------- // Replaces same function in function.php --- 1017,1020 ---- *************** *** 1026,1029 **** --- 1060,1066 ---- } + // + // [Remove?] + // function username_search($search_match) { *************** *** 1064,1067 **** --- 1101,1105 ---- $page_title = $lang['Search']; + //include($mx_root_path . 'includes/page_header.'.$phpEx); *************** *** 1354,1357 **** --- 1392,1398 ---- } + // + // [Remove?] + // function show_online() { *************** *** 1568,1571 **** --- 1609,1615 ---- } + // + // Main method + // function read_file( $phpbb_file, $sub_call = false ) { *************** *** 1575,1579 **** --- 1619,1625 ---- global $server_url; // used globally by usercp_register.php + // //Check for cash mod + // if (defined('IN_CASHMOD')) { *************** *** 1599,1602 **** --- 1645,1653 ---- break; } + /* + // + // [Remove?] + // This code is already present below for subcalls of includes. + // $cashcode=file_get_contents($phpbb_root_path . 'includes/functions_cash.'.$phpEx); *************** *** 1642,1645 **** --- 1693,1697 ---- $template = new mx_Template( $phpbb_root_path . 'templates/'. $theme['template_name'] ); eval($cashcode); + */ } *************** *** 1685,1689 **** // Replace common phpBB functions with mxBB alternatives // - //$code = str_replace('append_sid(', 'mx_append_sid(', $code); $code = str_replace('append_sid(', '$mx_forum->append_sid(', $code); //$code = str_replace('@phpbb_realpath(', '$mx_forum->phpbb_realpath(', $code); --- 1737,1740 ---- *************** *** 1692,1696 **** //$code = str_replace('is_link(', '$mx_forum->is_link(', $code); $code = str_replace('redirect(', '$mx_forum->redirect(', $code); - //$code = str_replace('redirect(', 'mx_redirect(', $code); $code = str_replace('make_jumpbox(', '$mx_forum->make_jumpbox(', $code); $code = str_replace('make_jumpbox_ref(', '$mx_forum->make_jumpbox_ref(', $code); --- 1743,1746 ---- *************** *** 1705,1710 **** // Remove some includes already included by mxBB // $code = preg_replace ("/include(.*)functions_select/", "//", $code); ! $code = preg_replace ("/include(.*)functions_search/", "//", $code); $code = preg_replace ("/include(.*)functions_post/", "//", $code); $code = preg_replace ("/include(.*)bbcode/", "//", $code); --- 1755,1761 ---- // Remove some includes already included by mxBB // + $code = preg_replace ("/include(.*)functions/", "//", $code); $code = preg_replace ("/include(.*)functions_select/", "//", $code); ! //$code = preg_replace ("/include(.*)functions_search/", "//", $code); $code = preg_replace ("/include(.*)functions_post/", "//", $code); $code = preg_replace ("/include(.*)bbcode/", "//", $code); *************** *** 1731,1747 **** // Hack for XS/Simple SubForum $code = str_replace('$images = unserialize($item[\'FORUM_FOLDERS\'])', '$mx_forum->images = unserialize($item[\'FORUM_FOLDERS\'])', $code); - break; case 'viewforum': $code = str_replace('<a href=\"modcp', '<a href=\"'.$phpbb_root_path.'modcp', $code); - $code = str_replace('obtain_word_list(', 'phpBB2::obtain_word_list(', $code); - break; case 'viewtopic': - // // For narrow columns - // //$code = str_replace('$message = str_replace("\n"', '$message = $mx_forum->mxbb_magic( $message );' . "\n" . '$message = str_replace("\n"', $code); - $code = str_replace('<a href=\"modcp', '<a href=\"'.$phpbb_root_path.'modcp', $code); $code = str_replace('<a href=\"viewtopic', '<a href=\"'.$phpbb_root_path.'viewtopic', $code); --- 1782,1794 ---- // Hack for XS/Simple SubForum $code = str_replace('$images = unserialize($item[\'FORUM_FOLDERS\'])', '$mx_forum->images = unserialize($item[\'FORUM_FOLDERS\'])', $code); break; + case 'viewforum': $code = str_replace('<a href=\"modcp', '<a href=\"'.$phpbb_root_path.'modcp', $code); break; + case 'viewtopic': // For narrow columns //$code = str_replace('$message = str_replace("\n"', '$message = $mx_forum->mxbb_magic( $message );' . "\n" . '$message = str_replace("\n"', $code); $code = str_replace('<a href=\"modcp', '<a href=\"'.$phpbb_root_path.'modcp', $code); $code = str_replace('<a href=\"viewtopic', '<a href=\"'.$phpbb_root_path.'viewtopic', $code); *************** *** 1749,1762 **** $code = str_replace('$temp_url = "posting.', '$temp_url = "' . $phpbb_root_path . 'posting.', $code); $code = str_replace('$temp_url = "bin.', '$temp_url = "' . $phpbb_root_path . 'bin.', $code); - $code = str_replace('obtain_word_list(', 'phpBB2::obtain_word_list(', $code); - // // Avatars and ranks - // $code = str_replace('<img src="\' . $board_config[\'avatar_path\']', '<img src="\' . $phpbb_root_path . $board_config[\'avatar_path\']', $code); $code = str_replace('<img src="\' . $board_config[\'avatar_gallery_path\']', '<img src="\' . $phpbb_root_path . $board_config[\'avatar_gallery_path\']', $code); $code = str_replace('<img src="\' . $ranksrow[$j][\'rank_image\']', '<img src="\' . $phpbb_root_path . $ranksrow[$j][\'rank_image\']', $code); - break; case 'faq': $code = str_replace('\'U_FAQ_LINK\' => \'#' . $faq_block[$i][$j]['id'], '\'U_FAQ_LINK\' => \''.$phpbb_root_path.'faq.php#' . $faq_block[$i][$j]['id'], $code); --- 1796,1806 ---- $code = str_replace('$temp_url = "posting.', '$temp_url = "' . $phpbb_root_path . 'posting.', $code); $code = str_replace('$temp_url = "bin.', '$temp_url = "' . $phpbb_root_path . 'bin.', $code); // Avatars and ranks $code = str_replace('<img src="\' . $board_config[\'avatar_path\']', '<img src="\' . $phpbb_root_path . $board_config[\'avatar_path\']', $code); $code = str_replace('<img src="\' . $board_config[\'avatar_gallery_path\']', '<img src="\' . $phpbb_root_path . $board_config[\'avatar_gallery_path\']', $code); $code = str_replace('<img src="\' . $ranksrow[$j][\'rank_image\']', '<img src="\' . $phpbb_root_path . $ranksrow[$j][\'rank_image\']', $code); break; + case 'faq': $code = str_replace('\'U_FAQ_LINK\' => \'#' . $faq_block[$i][$j]['id'], '\'U_FAQ_LINK\' => \''.$phpbb_root_path.'faq.php#' . $faq_block[$i][$j]['id'], $code); *************** *** 1765,1802 **** case 'profile': - // // Sub Calls Fix - // $code = str_replace('exit;', 'return;', $code); break; case 'search': ! $code = str_replace('username_search(', '$mx_forum->username_search(', $code); ! $code = str_replace('obtain_word_list(', 'phpBB2::obtain_word_list(', $code); break; case 'modcp': $code = str_replace('$u_view_topic = "modcp.$phpEx', '$u_view_topic = $phpbb_root_path."modcp.$phpEx', $code); - $code = str_replace('obtain_word_list(', 'phpBB2::obtain_word_list(', $code); break; case 'posting': - $code = str_replace('obtain_word_list(', 'phpBB2::obtain_word_list(', $code); break; case 'privmsg': - $code = str_replace('obtain_word_list(', 'phpBB2::obtain_word_list(', $code); - break; - /* - case 'groupcp': - $code = str_replace('phpbb_clean_username(', 'phpBB2::phpbb_clean_username(', $code); - break; - */ case 'includes/usercp_register': - // // Avatars and ranks - // $code = str_replace('\'./\' . $board_config[\'avatar_gallery_path\']', '$board_config[\'avatar_gallery_path\']', $code); $code = str_replace('\'./\' . $board_config[\'avatar_path\']', '$board_config[\'avatar_path\']', $code); --- 1809,1832 ---- case 'profile': // Sub Calls Fix $code = str_replace('exit;', 'return;', $code); break; case 'search': ! //$code = str_replace('username_search(', '$mx_forum->username_search(', $code); break; case 'modcp': $code = str_replace('$u_view_topic = "modcp.$phpEx', '$u_view_topic = $phpbb_root_path."modcp.$phpEx', $code); break; case 'posting': break; case 'privmsg': break; case 'includes/usercp_register': // Avatars and ranks $code = str_replace('\'./\' . $board_config[\'avatar_gallery_path\']', '$board_config[\'avatar_gallery_path\']', $code); $code = str_replace('\'./\' . $board_config[\'avatar_path\']', '$board_config[\'avatar_path\']', $code); *************** *** 1807,1813 **** case 'includes/usercp_avatar': - // // Avatars and ranks - // $code = str_replace( '\'./\' . $board_config[\'avatar_gallery_path\']', '$board_config[\'avatar_gallery_path\']', $code ); $code = str_replace( '\'./\' . $board_config[\'avatar_path\']', '$board_config[\'avatar_path\']', $code ); --- 1837,1841 ---- *************** *** 1822,1828 **** case 'includes/usercp_viewprofile': - // // Avatars and ranks - // $code = str_replace('\'./\' . $board_config[\'avatar_gallery_path\']', '$board_config[\'avatar_gallery_path\']', $code); $code = str_replace('\'./\' . $board_config[\'avatar_path\']', '$board_config[\'avatar_path\']', $code); --- 1850,1854 ---- *************** *** 1833,1842 **** case 'includes/topic_review': ! $code = str_replace('obtain_word_list(', 'phpBB2::obtain_word_list(', $code); break; ! case 'cash': $code = str_replace('exit;', 'return;', $code); break; --- 1859,1872 ---- case 'includes/topic_review': + break; ! case 'includes/functions_search': break; ! case 'includes/functions_cash': ! // Tweaks to this file should go here!!! Please, do not break the module logic. ! break; + case 'cash': $code = str_replace('exit;', 'return;', $code); break; *************** *** 1844,1860 **** // ! //this funtions are now in funtion container ! // ! $code = str_replace('get_db_stat(', 'phpBB2::get_db_stat(', $code); ! $code = str_replace('create_date(', 'phpBB2::create_date(', $code); ! $code = str_replace('phpbb_clean_username(', 'phpBB2::phpbb_clean_username(', $code); ! $code = str_replace('phpbb_realpath(', 'phpBB2::phpbb_realpath(', $code); ! $code = str_replace('get_userdata(', 'mx_get_userdata(', $code); ! $code = str_replace('dss_rand(', 'mx_dss_rand(', $code); ! ! // ! // Now do a recursive study of sub includes/requires ;) // - //$code = preg_replace('#^(.?).*(include)(.*?)(includes\/usercp_)(.*?)(\.).*(\r\n?|\n)#m', "\n " . '$mx_forum->read_file( \'includes/usercp_\\5\', true );' . "\n", $code); $code = preg_replace('#^(.?).*(include)(.*?)(includes\/)(.*?)(\.).*(\r\n?|\n)#m', "\n " . '$mx_forum->read_file( \'includes/\\5\', true );' . "\n", $code); $code = preg_replace('#^(.?).*(require)(.*?)(includes\/)(.*?)(\.).*(\r\n?|\n)#m', "\n " . '$mx_forum->read_file( \'includes/\\5\', true );' . "\n", $code); --- 1874,1879 ---- // ! // Now do a recursive study of includes/requires ;) // $code = preg_replace('#^(.?).*(include)(.*?)(includes\/)(.*?)(\.).*(\r\n?|\n)#m', "\n " . '$mx_forum->read_file( \'includes/\\5\', true );' . "\n", $code); $code = preg_replace('#^(.?).*(require)(.*?)(includes\/)(.*?)(\.).*(\r\n?|\n)#m', "\n " . '$mx_forum->read_file( \'includes/\\5\', true );' . "\n", $code); *************** *** 1864,1867 **** --- 1883,1887 ---- if ($sub_call) { + // Debug subcalls //die(str_replace("\n", '<br>', htmlspecialchars($code))); eval($code); *************** *** 1869,1873 **** else { ! //die(str_replace("\n", '<br>', htmlspecialchars($code))); eval($code); --- 1889,1893 ---- else { ! // Debug main phpBB code //die(str_replace("\n", '<br>', htmlspecialchars($code))); eval($code); |