|
From: OryNider <ory...@us...> - 2008-02-04 10:57:33
|
Update of /cvsroot/mxbb/core/includes/shared/phpbb3/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27274 Modified Files: functions.php functions_module.php Log Message: changes made by Culpit Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb3/includes/functions.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** functions.php 3 Feb 2008 10:21:25 -0000 1.5 --- functions.php 4 Feb 2008 10:57:25 -0000 1.6 *************** *** 2771,2775 **** * Expects $text to be the value directly from the database (stored value) */ ! /* function generate_text_for_display($text, $uid, $bitfield, $flags) { --- 2771,2775 ---- * Expects $text to be the value directly from the database (stored value) */ ! function generate_text_for_display($text, $uid, $bitfield, $flags) { *************** *** 2789,2793 **** { global $phpbb_root_path, $phpEx; ! include($phpbb_root_path . 'includes/bbcode.' . $phpEx); } --- 2789,2794 ---- { global $phpbb_root_path, $phpEx; ! mx_page::load_file( 'bbcode', 'phpbb3'); ! //include($phpbb_root_path . 'includes/bbcode.' . $phpEx); } *************** *** 2810,2814 **** return $text; } ! */ /** --- 2811,2815 ---- return $text; } ! /** Index: functions_module.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb3/includes/functions_module.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** functions_module.php 3 Feb 2008 10:21:25 -0000 1.5 --- functions_module.php 4 Feb 2008 10:57:25 -0000 1.6 *************** *** 1,15 **** <?php /** ! * ! * @package phpBB3 ! * @version $Id$ ! * @copyright (c) 2005 phpBB Group ! * @license http://opensource.org/licenses/gpl-license.php GNU Public License ! * ! */ /** ! * @ignore ! */ if (!defined('IN_PORTAL')) { --- 1,15 ---- <?php /** ! * ! * @package phpBB3 ! * @version $Id$ ! * @copyright (c) 2005 phpBB Group ! * @license http://opensource.org/licenses/gpl-license.php GNU Public License ! * ! */ /** ! * @ignore ! */ if (!defined('IN_PORTAL')) { *************** *** 29,35 **** /** ! * Class handling all types of 'plugins' (a future term) ! * @package phpBB3 ! */ class p_master { --- 29,35 ---- /** ! * Class handling all types of 'plugins' (a future term) ! * @package phpBB3 ! */ class p_master { *************** *** 46,57 **** /** ! * List modules ! * ! * This creates a list, stored in $this->module_ary of all available ! * modules for the given class (ucp, mcp and acp). Additionally ! * $this->module_y_ary is created with indentation information for ! * displaying the module list appropriately. Only modules for which ! * the user has access rights are included in these lists. ! */ function list_modules($p_class) { --- 46,57 ---- /** ! * List modules ! * ! * This creates a list, stored in $this->module_ary of all available ! * modules for the given class (ucp, mcp and acp). Additionally ! * $this->module_y_ary is created with indentation information for ! * displaying the module list appropriately. Only modules for which ! * the user has access rights are included in these lists. ! */ function list_modules($p_class) { *************** *** 71,75 **** ORDER BY left_id ASC"; $result = $db->sql_query($sql); ! $rows = array(); while ($row = $db->sql_fetchrow($result)) --- 71,75 ---- ORDER BY left_id ASC"; $result = $db->sql_query($sql); ! $rows = array(); while ($row = $db->sql_fetchrow($result)) *************** *** 126,130 **** continue; } ! $right_id = false; } --- 126,130 ---- continue; } ! $right_id = false; } *************** *** 159,163 **** continue; } ! $right_id = false; } --- 159,163 ---- continue; } ! $right_id = false; } *************** *** 206,210 **** $names[$row['module_basename'] . '_' . $row['module_mode']][] = true; ! $module_row = array( 'depth' => $depth, --- 206,210 ---- $names[$row['module_basename'] . '_' . $row['module_mode']][] = true; ! $module_row = array( 'depth' => $depth, *************** *** 221,225 **** 'url_extra' => (function_exists($url_func)) ? $url_func($row['module_mode'], $row) : '', ! 'lang' => ($row['module_basename'] && function_exists($lang_func)) ? $lang_func($row['module_mode'], $row['module_langname']) : ((!empty($mx_user->lang[$row['module_langname']])) ? $mx_user->lang[$row['module_langname']] : $row['module_langname']), 'langname' => $row['module_langname'], --- 221,225 ---- 'url_extra' => (function_exists($url_func)) ? $url_func($row['module_mode'], $row) : '', ! 'lang' => ($row['module_basename'] && function_exists($lang_func)) ? $lang_func($row['module_mode'], $row['module_langname']) : ((!empty($mx_user->lang[$row['module_langname']])) ? $mx_user->lang[$row['module_langname']] : $row['module_langname']), 'langname' => $row['module_langname'], *************** *** 241,252 **** /** ! * Check if a certain main module is accessible/loaded ! * By giving the module mode you are able to additionally check for only one mode within the main module ! * ! * @param string $module_basename The module base name, for example logs, reports, main (for the mcp). ! * @param mixed $module_mode The module mode to check. If provided the mode will be checked in addition for presence. ! * ! * @return bool Returns true if module is loaded and accessible, else returns false ! */ function loaded($module_basename, $module_mode = false) { --- 241,252 ---- /** ! * Check if a certain main module is accessible/loaded ! * By giving the module mode you are able to additionally check for only one mode within the main module ! * ! * @param string $module_basename The module base name, for example logs, reports, main (for the mcp). ! * @param mixed $module_mode The module mode to check. If provided the mode will be checked in addition for presence. ! * ! * @return bool Returns true if module is loaded and accessible, else returns false ! */ function loaded($module_basename, $module_mode = false) { *************** *** 285,290 **** /** ! * Check module authorisation ! */ function module_auth($module_auth, $forum_id = false) { --- 285,290 ---- /** ! * Check module authorisation ! */ function module_auth($module_auth, $forum_id = false) { *************** *** 318,322 **** case '||': case ',': ! break; default: --- 318,322 ---- case '||': case ',': ! break; default: *************** *** 325,329 **** $token = ''; } ! break; } } --- 325,329 ---- $token = ''; } ! break; } } *************** *** 343,348 **** /** ! * Set active module ! */ function set_active($id = false, $mode = false) { --- 343,348 ---- /** ! * Set active module ! */ function set_active($id = false, $mode = false) { *************** *** 364,372 **** // If no category or module selected, go active for first module in first category if ( ! (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && (($item_ary['mode'] == $mode && !$item_ary['cat']) || ($icat && $item_ary['cat']))) || ! ($item_ary['parent'] === $category && !$item_ary['cat'] && !$icat && $item_ary['display']) || ! (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && !$mode && !$item_ary['cat']) || ! (!$id && !$mode && !$item_ary['cat'] && $item_ary['display']) ! ) { if ($item_ary['cat']) --- 364,372 ---- // If no category or module selected, go active for first module in first category if ( ! (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && (($item_ary['mode'] == $mode && !$item_ary['cat']) || ($icat && $item_ary['cat']))) || ! ($item_ary['parent'] === $category && !$item_ary['cat'] && !$icat && $item_ary['display']) || ! (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && !$mode && !$item_ary['cat']) || ! (!$id && !$mode && !$item_ary['cat'] && $item_ary['display']) ! ) { if ($item_ary['cat']) *************** *** 399,406 **** /** ! * Loads currently active module ! * ! * This method loads a given module, passing it the relevant id and mode. ! */ function load_active($mode = false, $module_url = false, $execute_module = true) { --- 399,406 ---- /** ! * Loads currently active module ! * ! * This method loads a given module, passing it the relevant id and mode. ! */ function load_active($mode = false, $module_url = false, $execute_module = true) { *************** *** 425,442 **** $modulecode = file_get_contents("$module_path/{$this->p_class}_$this->p_name.$phpEx"); ! $modulecode = str_replace('<?php','',$modulecode); ! $modulecode = str_replace('?>','',$modulecode); ! $modulecode = str_replace('$config', '$board_config', $modulecode); ! $modulecode = str_replace('$cache', '$mx_cache', $modulecode); ! $modulecode = str_replace('$user', '$mx_user', $modulecode); ! $modulecode = str_replace('$auth', '$phpbb_auth', $modulecode); ! $modulecode = str_replace('append_sid(', 'mx3_append_sid(', $modulecode); ! $modulecode = str_replace('get_username_string(', 'mx_get_username_string(', $modulecode); ! $modulecode = str_replace('request_var(', 'phpBB3::request_var(', $modulecode); ! $modulecode = str_replace('add_form_key(', 'phpBB3::add_form_key(', $modulecode); $mx_user = new mx_user(); - //print htmlentities( $modulecode);die(); eval($modulecode); --- 425,448 ---- $modulecode = file_get_contents("$module_path/{$this->p_class}_$this->p_name.$phpEx"); ! $func_array = array( ! 'request_var', 'add_form_key', 'generate_text_for_display' ! ); ! $preg_array = array( ! '#^<\?(php)?|\?>$#si' => '', ! '#\$config#si' => '$board_config', ! '#\$cache#si' => '$mx_cache', ! '#\$user#si' => '$mx_user', ! '#\$auth#si' => '$phpbb_auth', ! '#append_sid\(#si' => 'mx3_append_sid(', ! '#get_username_string\(#si' => 'mx_get_username_string(', ! '#global#si' => 'global $mx_acp,', ! '#\$template-#si' => '$mx_acp->template-', ! '#(' . implode( '|', $func_array) . ')\(#si' => 'phpBB3::\1(', ! ); + $modulecode = preg_replace( array_keys( $preg_array), array_values( $preg_array), $modulecode); + $mx_user = new mx_user(); eval($modulecode); *************** *** 497,500 **** --- 503,507 ---- if ($execute_module) { + $this->module->main($this->p_name, $this->p_mode); } *************** *** 505,518 **** /** ! * Appending url parameter to the currently active module. ! * ! * This function is called for adding specific url parameters while executing the current module. ! * It is doing the same as the _module_{name}_url() function, apart from being able to be called after ! * having dynamically parsed specific parameters. This allows more freedom in choosing additional parameters. ! * One example can be seen in /includes/mcp/mcp_notes.php - $this->p_master->adjust_url() call. ! * ! * @param string $url_extra Extra url parameters, e.g.: &u=$mx_user_id ! * ! */ function adjust_url($url_extra) { --- 512,525 ---- /** ! * Appending url parameter to the currently active module. ! * ! * This function is called for adding specific url parameters while executing the current module. ! * It is doing the same as the _module_{name}_url() function, apart from being able to be called after ! * having dynamically parsed specific parameters. This allows more freedom in choosing additional parameters. ! * One example can be seen in /includes/mcp/mcp_notes.php - $this->p_master->adjust_url() call. ! * ! * @param string $url_extra Extra url parameters, e.g.: &u=$mx_user_id ! * ! */ function adjust_url($url_extra) { *************** *** 532,537 **** /** ! * Check if a module is active ! */ function is_active($id, $mode = false) { --- 539,544 ---- /** ! * Check if a module is active ! */ function is_active($id, $mode = false) { *************** *** 552,557 **** /** ! * Get parents ! */ function get_parents($parent_id, $left_id, $right_id, &$all_parents) { --- 559,564 ---- /** ! * Get parents ! */ function get_parents($parent_id, $left_id, $right_id, &$all_parents) { *************** *** 580,585 **** /** ! * Get tree branch ! */ function get_branch($left_id, $right_id, $remaining) { --- 587,592 ---- /** ! * Get tree branch ! */ function get_branch($left_id, $right_id, $remaining) { *************** *** 600,606 **** /** ! * Build true binary tree from given array ! * Not in use ! */ function build_tree(&$modules, &$parents) { --- 607,613 ---- /** ! * Build true binary tree from given array ! * Not in use ! */ function build_tree(&$modules, &$parents) { *************** *** 638,643 **** /** ! * Build navigation structure ! */ function assign_tpl_vars($module_url) { --- 645,650 ---- /** ! * Build navigation structure ! */ function assign_tpl_vars($module_url) { *************** *** 759,764 **** /** ! * Returns desired template name ! */ function get_tpl_name() { --- 766,771 ---- /** ! * Returns desired template name ! */ function get_tpl_name() { *************** *** 767,772 **** /** ! * Returns the desired page title ! */ function get_page_title() { --- 774,779 ---- /** ! * Returns the desired page title ! */ function get_page_title() { *************** *** 782,787 **** /** ! * Load module as the current active one without the need for registering it ! */ function load($class, $name, $mode = false) { --- 789,794 ---- /** ! * Load module as the current active one without the need for registering it ! */ function load($class, $name, $mode = false) { *************** *** 796,801 **** /** ! * Display module ! */ function display($page_title, $display_online_list = true) { --- 803,808 ---- /** ! * Display module ! */ function display($page_title, $display_online_list = true) { *************** *** 827,832 **** /** ! * Toggle whether this module will be displayed or not ! */ function set_display($id, $mode = false, $display = true) { --- 834,839 ---- /** ! * Toggle whether this module will be displayed or not ! */ function set_display($id, $mode = false, $display = true) { *************** *** 841,846 **** /** ! * Add custom MOD info language file ! */ function add_mod_info($module_class) { --- 848,853 ---- /** ! * Add custom MOD info language file ! */ function add_mod_info($module_class) { |