|
From: Jon O. <jon...@us...> - 2008-02-18 18:37:19
|
Update of /cvsroot/mxbb/mx_phpbb/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv32400/includes Modified Files: forum_hack.php Log Message: Updated to handle both core branches... Index: forum_hack.php =================================================================== RCS file: /cvsroot/mxbb/mx_phpbb/includes/forum_hack.php,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** forum_hack.php 18 Feb 2008 03:39:13 -0000 1.36 --- forum_hack.php 18 Feb 2008 18:37:13 -0000 1.37 *************** *** 22,59 **** include_once($mx_root_path . 'includes/shared/phpbb2/includes/functions.' . $phpEx); - include_once($mx_root_path . 'includes/shared/phpbb2/includes/functions_selects.' . $phpEx); - include_once($mx_root_path . 'includes/shared/phpbb2/includes/functions_post.' . $phpEx); ! //Check for mx_smartor fap version ! if (file_exists($mx_root_path . 'modules/mx_smartor/album_mod/album_bbconstants.' . $phpEx)) ! { ! include_once($mx_root_path . 'modules/mx_smartor/album_mod/album_bbconstants.' . $phpEx); } ! include_once($mx_root_path . 'includes/shared/phpbb2/includes/bbcode.' . $phpEx); ! ! include_once($phpbb_root_path . 'includes/auth.' . $phpEx); ! if(!function_exists('create_date')) { ! function create_date($format, $gmepoch, $tz) { ! return phpBB2::create_date($format, $gmepoch, $tz); } } ! if(!function_exists('get_db_stat')) { ! function get_db_stat($mode) ! { ! return phpBB2::get_db_stat($mode); ! } } //Check for cash mod ! if (file_exists($phpbb_root_path . 'includes/functions_cash.'.$phpEx)) { define('IN_CASHMOD', true); ! if ( !file_exists(phpBB2::phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_cash.'.$phpEx)) ) { --- 22,63 ---- include_once($mx_root_path . 'includes/shared/phpbb2/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); ! } ! //Check for mx_smartor fap version ! // We need to check the DB too, since we can have the files there but not installed !! ! if (file_exists($mx_root_path . 'modules/mx_smartor/album_mod/album_bbconstants.' . $phpEx)) { ! $sql = "SELECT COUNT(*) AS total FROM" . MODULE_TABLE . " WHERE module_path = 'modules/mx_smartor/'"; ! if( ($result = $db->sql_query($sql)) ) { ! include_once($mx_root_path . 'modules/mx_smartor/album_mod/album_bbconstants.' . $phpEx); } + $db->sql_freeresult($result); } ! if(!function_exists(smilies_pass)) { ! include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); ! } ! ! if(!function_exists(auth_check_user)) ! { ! include_once($phpbb_root_path . 'includes/auth.' . $phpEx); } //Check for cash mod ! if (file_exists($phpbb_root_path . 'includes/functions_cash.'.$phpEx)) { define('IN_CASHMOD', true); ! if ( !file_exists(phpBB2::phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_cash.'.$phpEx)) ) { *************** *** 63,67 **** { include_once($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_cash.' . $phpEx); ! } } --- 67,71 ---- { include_once($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_cash.' . $phpEx); ! } } *************** *** 826,830 **** mx_message_die(GENERAL_ERROR, "Couldn't obtain category list.", "", __LINE__, __FILE__, $sql); } ! $category_rows = array(); while ( $row = $db->sql_fetchrow($result) ) --- 830,834 ---- mx_message_die(GENERAL_ERROR, "Couldn't obtain category list.", "", __LINE__, __FILE__, $sql); } ! $category_rows = array(); while ( $row = $db->sql_fetchrow($result) ) *************** *** 902,910 **** 'title' => $forum_rows[$k]['forum_name'] ); ! } } // End Simple Subforums MOD ! } } --- 906,914 ---- 'title' => $forum_rows[$k]['forum_name'] ); ! } } // End Simple Subforums MOD ! } } *************** *** 948,952 **** return; } ! // -------------------------------------------------------------------------------- --- 952,956 ---- return; } ! // -------------------------------------------------------------------------------- *************** *** 992,996 **** $template->assign_vars( array( 'U_MORE_SMILIES' => $this->append_sid( "posting.$phpEx?mode=smilies" ) ) ); } ! function username_search($search_match) { --- 996,1000 ---- $template->assign_vars( array( 'U_MORE_SMILIES' => $this->append_sid( "posting.$phpEx?mode=smilies" ) ) ); } ! function username_search($search_match) { *************** *** 1543,1547 **** //Check for cash mod ! if (defined('IN_CASHMOD')) { global $cash, $cm_groups; // allways used globally by cash mod --- 1547,1551 ---- //Check for cash mod ! if (defined('IN_CASHMOD')) { global $cash, $cm_groups; // allways used globally by cash mod *************** *** 1573,1577 **** $cashcode = str_replace('<?php','',$cashcode); $cashcode = str_replace('?>','',$cashcode); ! // // Commment out the main includes --- 1577,1581 ---- $cashcode = str_replace('<?php','',$cashcode); $cashcode = str_replace('?>','',$cashcode); ! // // Commment out the main includes *************** *** 1586,1590 **** $cashcode = preg_replace ("/include(.*)functions_post/", "//", $cashcode); ! // // NOTE: This regex will only work if "global" is stated on a new line... // --- 1590,1594 ---- $cashcode = preg_replace ("/include(.*)functions_post/", "//", $cashcode); ! // // NOTE: This regex will only work if "global" is stated on a new line... // *************** *** 1602,1613 **** $cashcode = preg_replace ("/phpbb_root_path = (.*)\;/", "phpbb_root_path = '" . $phpbb_root_path . "';", $cashcode); ! // // Add the phpbb_root_path to the append_sid function - if not already there // // ! $template = new mx_Template( $phpbb_root_path . 'templates/'. $theme['template_name'] ); eval($cashcode); ! } $code = file_get_contents($phpbb_root_path . $phpbb_file . ".$phpEx"); --- 1606,1617 ---- $cashcode = preg_replace ("/phpbb_root_path = (.*)\;/", "phpbb_root_path = '" . $phpbb_root_path . "';", $cashcode); ! // // Add the phpbb_root_path to the append_sid function - if not already there // // ! $template = new mx_Template( $phpbb_root_path . 'templates/'. $theme['template_name'] ); eval($cashcode); ! } $code = file_get_contents($phpbb_root_path . $phpbb_file . ".$phpEx"); *************** *** 1715,1719 **** $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 --- 1719,1723 ---- $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 *************** *** 1736,1746 **** 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; /* --- 1740,1750 ---- 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; /* *************** *** 1768,1772 **** $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 ); ! $code = str_replace( '$board_config[\'avatar_gallery_path\']', '\'' . $phpbb_root_path . '\' . $board_config[\'avatar_gallery_path\']', $code ); $code = str_replace( '$board_config[\'avatar_path\']', '\'' . $phpbb_root_path . '\' . $board_config[\'avatar_path\']', $code ); --- 1772,1776 ---- $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 ); ! $code = str_replace( '$board_config[\'avatar_gallery_path\']', '\'' . $phpbb_root_path . '\' . $board_config[\'avatar_gallery_path\']', $code ); $code = str_replace( '$board_config[\'avatar_path\']', '\'' . $phpbb_root_path . '\' . $board_config[\'avatar_path\']', $code ); *************** *** 1776,1797 **** $code = str_replace( '$move_file($avatar_filename, \'' . $phpbb_root_path .'\' . $board_config[\'avatar_path\'] . "/$new_filename");','$move_file($avatar_filename, \'' . $phpbb_root_path .'\' . $board_config[\'avatar_path\'] . "/$new_filename"); @unlink( $avatar_filename);', $code); break; - - 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); ! $code = str_replace('$board_config[\'avatar_gallery_path\']', '\''.$phpbb_root_path.'\' . $board_config[\'avatar_gallery_path\']', $code); ! $code = str_replace('$board_config[\'avatar_path\']', '\''.$phpbb_root_path.'\' . $board_config[\'avatar_path\']', $code); break; ! case 'cash': ! $code = str_replace('exit;', 'return;', $code); break; } ! //this funtions are now in funtion container $code = str_replace('get_db_stat(', 'phpBB2::get_db_stat(', $code); --- 1780,1801 ---- $code = str_replace( '$move_file($avatar_filename, \'' . $phpbb_root_path .'\' . $board_config[\'avatar_path\'] . "/$new_filename");','$move_file($avatar_filename, \'' . $phpbb_root_path .'\' . $board_config[\'avatar_path\'] . "/$new_filename"); @unlink( $avatar_filename);', $code); break; ! 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); ! ! $code = str_replace('$board_config[\'avatar_gallery_path\']', '\''.$phpbb_root_path.'\' . $board_config[\'avatar_gallery_path\']', $code); ! $code = str_replace('$board_config[\'avatar_path\']', '\''.$phpbb_root_path.'\' . $board_config[\'avatar_path\']', $code); break; ! case 'cash': ! $code = str_replace('exit;', 'return;', $code); break; } ! //this funtions are now in funtion container $code = str_replace('get_db_stat(', 'phpBB2::get_db_stat(', $code); *************** *** 1801,1805 **** $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 ;) --- 1805,1809 ---- $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 ;) *************** *** 1859,1871 **** if ($mx_forum->phpbb_config['enable_module']) { ! if ( isset( $HTTP_POST_FILES ) && !empty( $HTTP_POST_FILES ) ) ! { ! $up_files_keys = array_keys( $HTTP_POST_FILES ); ! foreach( $up_files_keys as $up_file ) ! { ! @rename( $HTTP_POST_FILES[$up_file]['tmp_name'], $HTTP_POST_FILES[$up_file]['tmp_name'] . '.mxbb' ); ! $HTTP_POST_FILES[$up_file]['tmp_name'] .= '.mxbb'; ! $_FILES[$up_file]['tmp_name'] .= '.mxbb'; ! } } $http_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://'; --- 1863,1875 ---- if ($mx_forum->phpbb_config['enable_module']) { ! if ( isset( $HTTP_POST_FILES ) && !empty( $HTTP_POST_FILES ) ) ! { ! $up_files_keys = array_keys( $HTTP_POST_FILES ); ! foreach( $up_files_keys as $up_file ) ! { ! @rename( $HTTP_POST_FILES[$up_file]['tmp_name'], $HTTP_POST_FILES[$up_file]['tmp_name'] . '.mxbb' ); ! $HTTP_POST_FILES[$up_file]['tmp_name'] .= '.mxbb'; ! $_FILES[$up_file]['tmp_name'] .= '.mxbb'; ! } } $http_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://'; |