|
From: Jon O. <jon...@us...> - 2005-10-02 18:52:27
|
Update of /cvsroot/mxbb/mx_phpbb/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7419/modules/mx_phpbb/includes Modified Files: forum_hack.php Log Message: minor fixes Index: forum_hack.php =================================================================== RCS file: /cvsroot/mxbb/mx_phpbb/includes/forum_hack.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** forum_hack.php 20 Sep 2005 15:40:17 -0000 1.1 --- forum_hack.php 1 Oct 2005 08:54:04 -0000 1.2 *************** *** 369,375 **** function get_portal_url( $url, $non_html_amp = false, $by_http_vars = false ) { ! global $phpEx; $script_name = $this->_validate_redirection( $url, $by_http_vars ); if ( !empty($script_name) && isset( $this->forum_pages[$script_name] ) && $this->forum_pages[$script_name] > 0 ) --- 369,461 ---- function get_portal_url( $url, $non_html_amp = false, $by_http_vars = false ) { ! global $phpEx, $mx_root_path, $HTTP_GET_VARS, $userdata; $script_name = $this->_validate_redirection( $url, $by_http_vars ); + + // + // Support for the ProfileCP Module + // + if (file_exists($mx_root_path . 'modules/mx_profilecp/profile.php')) + { + switch ($script_name) + { + case 'memberlist': + $mx_profilecp_vars = '&mode=buddy&sub=memberlist'; + break; + + case 'privmsg': + + $get_vars = array('folder', 'sid', 'mode', 'start', 'msgdays', POST_POST_URL, POST_USERS_URL); + $s_call = ''; + $newpm = false; + + for ($i = 0; $i < count($get_vars); $i++) + { + $key = $get_vars[$i]; + $val = $HTTP_GET_VARS[$get_vars[$i]]; + + switch ($get_vars[$i]) + { + case POST_USERS_URL: + $key = 'b'; + break; + + case 'mode': + $newpm = ($val == 'newpm'); + + if (!$newpm) + { + $key = 'privmsg_mode'; + } + break; + + case 'folder': + $key = 'sub'; + break; + + default: + $key = $get_vars[$i]; + } + + if (isset($HTTP_GET_VARS[$get_vars[$i]])) + { + $s_call .= '&' . $key . '=' . $HTTP_GET_VARS[$get_vars[$i]]; + } + } + + $mx_profilecp_vars = '&mode=privmsg'.$s_call; + break; + + case 'profile': + + $s_call = ''; + if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) + { + $mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode']; + $user_id = ( isset($HTTP_GET_VARS['u']) ) ? $HTTP_GET_VARS['u'] : $userdata['user_id']; + + if ( $mode == 'viewprofile' ) + { + $s_call = "&mode=viewprofile&u=" . $user_id; + } + else if ( $mode == 'editprofile' || $mode == 'register' ) + { + if ( $mode == 'editprofile' ) + { + $s_call = "&mode=profil"; + } + else + { + $s_call = "&mode=register"; + } + } + } + + $mx_profilecp_vars = $s_call; + + break; + } + + } if ( !empty($script_name) && isset( $this->forum_pages[$script_name] ) && $this->forum_pages[$script_name] > 0 ) *************** *** 377,387 **** if (empty($url)) { ! return $this->portal_url . "index.$phpEx?page=" . $this->forum_pages[$script_name] . '&phpbb_script=' . $script_name; } if ( ( $pos = strpos( $url, '?', $pos + 1 ) ) === false ) { ! return $this->portal_url . "index.$phpEx?page=" . $this->forum_pages[$script_name] . '&phpbb_script=' . $script_name; } ! return $this->portal_url . "index.$phpEx?page=" . $this->forum_pages[$script_name] . ( ( $non_html_amp ) ? '&' : '&' ) . substr( $url, $pos + 1 ) . '&phpbb_script=' . $script_name; } return ''; --- 463,473 ---- if (empty($url)) { ! return $this->portal_url . "index.$phpEx?page=" . $this->forum_pages[$script_name] . '&phpbb_script=' . $script_name . $mx_profilecp_vars; } if ( ( $pos = strpos( $url, '?', $pos + 1 ) ) === false ) { ! return $this->portal_url . "index.$phpEx?page=" . $this->forum_pages[$script_name] . '&phpbb_script=' . $script_name . $mx_profilecp_vars; } ! return $this->portal_url . "index.$phpEx?page=" . $this->forum_pages[$script_name] . ( ( $non_html_amp ) ? '&' : '&' ) . substr( $url, $pos + 1 ) . '&phpbb_script=' . $script_name . $mx_profilecp_vars; } return ''; *************** *** 1108,1112 **** function read_file( $phpbb_file, $sub_call = false ) { ! global $phpbb_root_path, $mx_root_path, $phpEx, $template, $HTTP_POST_VARS, $HTTP_GET_VARS, $db, $userdata, $mode, $theme, $lang, $table_prefix, $mx_table_prefix, $board_config, $portal_config; global $html_entities_match, $html_entities_replace; --- 1194,1198 ---- function read_file( $phpbb_file, $sub_call = false ) { ! global $phpbb_root_path, $mx_root_path, $phpEx, $template, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $db, $userdata, $mode, $theme, $lang, $table_prefix, $mx_table_prefix, $board_config, $portal_config; global $html_entities_match, $html_entities_replace; |