############################################################## ## MOD Title: Profile Control Panel Module ## Original MOD Author: Ptirhiik < admin@rpgnet-fr.com >(Pierre) http://www.rpgnet-fr.com ## Develped for MX Haplo (jonohlsson@hotmail.com) ## MOD Description: This mod integrates the Profile CP module more closely to phpbb ## All calls to the Memberlist, PM:s and the user Profile are redirected to the module ## Note: This mod is optional...the module works without it!!! ## Note1: This mod is minimal, i.e. the full phpbb mod is outlined in the /tools folder ## Note2: All files to edit are phpbb files: memberlist.php, privmsg.php and profile.php ## Note3: You need to adapt the $path_to_mx and $path_to_mx_module paths for your setup yourself # #-----[ OPEN ]------------------------------------------------ # memberlist.php # #-----[ FIND ]------------------------------------------------ # // // End session management // # #-----[ AFTER, ADD ]------------------------------------------ # //-- Profile CP Module ------------------------------------------------------------------------------ //-- This code redirects all memberlist handling to the module // Define the path to mx root, eg '../mx/', '../' or similar $path_to_mx = "../core/"; // For Module Portal (Default - Block/Page) mode. Change "pageid" to whatever u r using!!!! For example page=4... $path_to_mx_module = "index.".$phpEx."?page=pageid&"; // Or if Standalone Mode is preferred, uncomment the following line (and comment out preceeding line) // $path_to_mx_module = "modules/mx_profilecp/profile.".$phpEx."?"; if(file_exists($path_to_mx . 'modules/mx_profilecp/profile.'.$phpEx)) { redirect(append_sid($path_to_mx.$path_to_mx_module."mode=buddy&sub=memberlist")); } //-- End Profile CP module code # #-----[ OPEN ]------------------------------------------------ # privmsg.php # #-----[ FIND ]------------------------------------------------ # // // Is PM disabled? // # #-----[ BEFORE, ADD ]------------------------------------------ # //-- Profile CP Module ------------------------------------------------------------------------------ // This code redirects all private message handling to the module // Define the path to mx root, eg '../mx/', '../' or similar $path_to_mx = "../core/"; // For Module Portal (Default - Block/Page) mode. Change "pageid" to whatever u r using!!!! For example page=4... $path_to_mx_module = "index.".$phpEx."?page=pageid&"; // Or if Standalone Mode is preferred, uncomment the following line (and comment out preceeding line) // $path_to_mx_module = "modules/mx_profilecp/profile.".$phpEx."?"; if(file_exists($path_to_mx . 'modules/mx_profilecp/profile.'.$phpEx)) { $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]]; } if ( !$newpm ) { redirect(append_sid($path_to_mx.$path_to_mx_module. "mode=privmsg" . $s_call, true)); exit; } } //-- End Profile CP module code # #-----[ OPEN ]------------------------------------------------ # profile.php # #-----[ FIND ]------------------------------------------------ # // // Start of program proper // # #-----[ AFTER, ADD ]------------------------------------------ # // Modded code for profile CP module --------------------------------------- // This code redirects all profile handling to the module // Define the path to mx root, eg '../mx/', '../' or similar $path_to_mx = "../core/"; // For Module Portal (Default - Block/Page) mode. Change "pageid" to whatever u r using!!!! For example page=4... $path_to_mx_module = "index.".$phpEx."?page=pageid&"; // Or if Standalone Mode is preferred, uncomment the following line (and comment out preceeding line) // $path_to_mx_module = "modules/mx_profilecp/profile.".$phpEx."?"; if(file_exists($path_to_mx . 'modules/mx_profilecp/profile.'.$phpEx)) { 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' ) { redirect(append_sid( $path_to_mx. $path_to_mx_module . "mode=viewprofile&u=" . $user_id )); exit; } else if ( $mode == 'editprofile' || $mode == 'register' ) { if ( !$userdata['session_logged_in'] && $mode == 'editprofile' ) { $redirect_tmp = str_replace("?", "&", $path_to_mx . $path_to_mx_module . "mode=profil" ); redirect(append_sid("login.$phpEx?redirect=".$redirect_tmp, true)); } else if ( $userdata['session_logged_in'] ) { redirect(append_sid( $path_to_mx . $path_to_mx_module . "mode=profil&u=" . $userdata['user_id'] )); } redirect(append_sid($path_to_mx . $path_to_mx_module . "mode=register" )); include($phpbb_root_path . 'includes/usercp_register.'.$phpEx); exit; } } } // End Module code # #-----[ SAVE/CLOSE ALL FILES ]-------------------------------- # # EoM