|
From: FlorinCB <ory...@us...> - 2008-09-01 04:01:02
|
Update of /cvsroot/mxbb/mx_phpbb3 In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12102 Added Files: db_install.php db_uninstall.php index.htm mx_phpbb3.pak mx_phpbb3.php readme.txt Log Message: This is mx_phpbb3 first atemt .... --- NEW FILE: mx_phpbb3.php --- <?php /** * * @package mxBB Portal Module - mx_phpbb3 * @version $Id: mx_phpbb3.php,v 1.1 2008/09/01 04:00:56 orynider Exp $ * @copyright (c) 2002-2006 [Markus, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if( !defined('IN_PORTAL') ) { die("Hacking attempt"); } // // View Permissions // Due to BOTs and SPAM, it's preferable to hide some forum pages for anonymous users. // // phpBB pages to hide (uncomment to activate): $private_phpbb_script = array('memberlist', 'privmsg'); // // // // Restore POST vars after redirect // Will look into this later // $HTTP_POST_VARS = $_SESSION['mxbb_post_vars']; $HTTP_POST_FILES = $_SESSION['mxbb_post_files']; // // addslashes to vars if magic_quotes_gpc is off // this is a security precaution to prevent someone // trying to break out of a SQL statement. // if( !get_magic_quotes_gpc() ) { if( is_array($HTTP_POST_VARS) ) { while( list($k, $v) = each($HTTP_POST_VARS) ) { if( is_array($HTTP_POST_VARS[$k]) ) { while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) ) { $HTTP_POST_VARS[$k][$k2] = addslashes($v2); } @reset($HTTP_POST_VARS[$k]); } else { $HTTP_POST_VARS[$k] = addslashes($v); } } @reset($HTTP_POST_VARS); } } include_once($mx_root_path . "modules/mx_phpbb3/includes/phpbb3_constants.$phpEx"); include_once($mx_root_path . "modules/mx_phpbb3/includes/forum_hack.$phpEx"); $phpbb_auth->acl($mx_user->data); // Do only once, in user_init // Move later // // Auth // if ( isset($private_phpbb_script) ) { if ( in_array($mx_forum->phpbb_script, $private_phpbb_script) && !$userdata['session_logged_in'] ) { mx_redirect( mx_append_sid( $mx_root_path . "login.$phpEx?redirect=" . mx_this_url(), true ) ); } } ob_start(); $mx_forum->read_file( $mx_forum->phpbb_script ); $phpbb_output = ob_get_contents(); ob_end_clean(); // // Final template code fixup - these are really phpBB "bugs", hardcoded images etc. // switch ( $mx_forum->phpbb_script ) { case 'index': $phpbb_output = str_replace('"templates/'.$theme['template_name'].'/images/folder_new_big.gif', '"' . $phpbb_root_path . 'templates/'.$theme['template_name'].'/images/folder_new_big.gif', $phpbb_output); $phpbb_output = str_replace('"templates/'.$theme['template_name'].'/images/folder_big.gif', '"' . $phpbb_root_path . 'templates/'.$theme['template_name'].'/images/folder_big.gif', $phpbb_output); $phpbb_output = str_replace('"templates/'.$theme['template_name'].'/images/folder_locked_big.gif', '"' . $phpbb_root_path . 'templates/'.$theme['template_name'].'/images/folder_locked_big.gif', $phpbb_output); $phpbb_output = str_replace('"templates/'.$theme['template_name'].'/images/whosonline.gif', '"' . $phpbb_root_path . 'templates/'.$theme['template_name'].'/images/whosonline.gif', $phpbb_output); break; case 'viewforum': break; case 'viewtopic': $phpbb_output = str_replace('templates/'.$theme['template_name'].'/images/vote_lcap.gif', $phpbb_root_path . 'templates/'.$theme['template_name'].'/images/vote_lcap.gif', $phpbb_output); $phpbb_output = str_replace('templates/'.$theme['template_name'].'/images/vote_rcap.gif', $phpbb_root_path . 'templates/'.$theme['template_name'].'/images/vote_rcap.gif', $phpbb_output); break; case 'posting': break; case 'faq': $phpbb_output = str_replace('#top', $phpbb_root_path . 'faq.php#top', $phpbb_output); break; } $phpbb_output = str_replace('"templates/'.$theme['template_name'], '"' . $phpbb_root_path . 'templates/'.$theme['template_name'], $phpbb_output); //die(str_replace("\n", '<br>', htmlspecialchars($phpbb_output))); echo($phpbb_output); unset($phpbb_output); ?> --- NEW FILE: db_uninstall.php --- <?php /** * * @package mxBB Portal Module - mx_phpbb * @version $Id: db_uninstall.php,v 1.1 2008/09/01 04:00:48 orynider Exp $ * @copyright (c) 2002-2006 [Markus, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { $mx_root_path = './../../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include( $mx_root_path . 'common.' . $phpEx ); // Start session management $mx_user->init($user_ip, PAGE_INDEX); if ( !$userdata['session_logged_in'] ) { die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { die( "Hacking attempt(2)" ); } // End session management } $sql = array( "DROP TABLE IF EXISTS " . $mx_table_prefix . "phpbb3_plugin_config", ); echo "<br /><br />"; echo "<table width=\"90%\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" border=\"0\" class=\"forumline\">"; echo "<tr><th class=\"thHead\" align=\"center\">Module Installation/Upgrading/Uninstalling Information - module specific db tables</th></tr>"; echo "<tr><td class=\"row1\" align=\"left\"><span class=\"gen\">" . mx_do_install_upgrade( $sql ) . "</span></td></tr>"; echo "</table><br />"; ?> --- NEW FILE: db_install.php --- <?php /** * * @package mxBB Portal Module - mx_phpbb3 * @version $Id: db_install.php,v 1.1 2008/09/01 04:00:48 orynider Exp $ * @copyright (c) 2002-2006 [Markus, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { $mx_root_path = './../../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include( $mx_root_path . 'common.' . $phpEx ); // Start session management $mx_user->init($user_ip, PAGE_INDEX); // End session management if ( !$userdata['session_logged_in'] ) { die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { die( "Hacking attempt(2)" ); } } $mx_module_version = '3.0.0-alfa'; $mx_module_copy = 'Original mxBB <i> - phpBB integration</i> module by <a href="http://www.phpmix.com" target="_blank">Markus</a> & <a href="http://www.mxbb.net" target="_blank">Jon</a>'; // If fresh install if ( !$result = $db->sql_query( "SELECT config_name from " . $mx_table_prefix . "phpbb3_plugin_config" ) ) { $message = "<b>This is a fresh install!</b><br/><br/>"; $sql = array(); $sql[] = "DROP TABLE IF EXISTS " . $mx_table_prefix . "phpbb3_plugin_config"; $sql[] = "CREATE TABLE " . $mx_table_prefix . "phpbb3_plugin_config ( config_name VARCHAR(255) NOT NULL default '', config_value varchar(255) NOT NULL default '', PRIMARY KEY (config_name) ) TYPE=MyISAM"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb3_plugin_config VALUES ('override_default_pages', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb3_plugin_config VALUES ('enable_module', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb3_plugin_config VALUES ('faq', '2')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb3_plugin_config VALUES ('groupcp', '2')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb3_plugin_config VALUES ('index', '2')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb3_plugin_config VALUES ('login', '2')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb3_plugin_config VALUES ('memberlist', '2')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb3_plugin_config VALUES ('privmsg', '2')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb3_plugin_config VALUES ('profile', '2')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb3_plugin_config VALUES ('search', '2')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb3_plugin_config VALUES ('viewonline', '2')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb3_plugin_config VALUES ('other', '2')"; $sql[] = "UPDATE " . $mx_table_prefix . "module" . " SET module_version = '" . $mx_module_version . "', module_copy = '" . $mx_module_copy . "' WHERE module_id = '" . $mx_module_id . "'"; $message .= mx_do_install_upgrade( $sql ); } else { // If already installed $message = "<b>Module is already installed... consider upgrading ;)</b><br/><br/>"; } echo "<br /><br />"; echo "<table width=\"90%\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" border=\"0\" class=\"forumline\">"; echo "<tr><th class=\"thHead\" align=\"center\">Module Installation/Upgrading/Uninstallation Information - Module specific DB tables</th></tr>"; echo "<tr><td class=\"row1\" align=\"left\"><span class=\"gen\">" . $message . "</span></td></tr>"; echo "</table><br />"; ?> --- NEW FILE: readme.txt --- /** * * @package mxBB Portal Module - mx_phpbb3 * @version $Id: readme.txt,v 1.1 2008/09/01 04:00:57 orynider Exp $ * @copyright (c) 2002-2006 [Markus, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ /********************************************************************************\ | Installation Instructions \********************************************************************************/ Note: In order for this module to install you must have a working phpBB and mxBB installation. phpbbroot refers to where your phpBB2 install is located, e.g in phpBB2/ or forum/ # #-----[ OPEN ]------------------------------------------ # phpbbroot/common.php # #-----[ FIND ]------------------------------------------ # ?> # #-----[ REPLACE WITH ]------------------------------------------ # //+mxbb_portal if( !defined('IN_ADMIN') ) { $mx_root_path = './../'; if (file_exists($mx_root_path.'modules/mx_phpbb3/includes/forum_hack.'.$phpEx)) { include_once($mx_root_path.'modules/mx_phpbb3/includes/forum_hack.'.$phpEx); } } //-mxbb_portal ?> # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # EoM /********************************************************************************\ | Portal Setup \********************************************************************************/ ** Now, add the newly created mx_phpbb Block to a relevant portal page and remove, the now redundant mx_forum block. ** By default, native phpBB urls are redirected to portal page 2. Visit the module adminCP for customization. /********************************************************************************\ | End Of Document \********************************************************************************/ --- NEW FILE: mx_phpbb3.pak --- module=+:59=+:phpBB3 Integration=+:modules/mx_phpbb3/=+:Vanilla phpBB3 Forum Integration=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:59=+:58=+:phpBB=+:mxBB Forum Integration=+:mx_phpbb3.php=+: parameter=+:58=+:98=+:Source_phpBB_Forums=+:phpbb_type_select=+:=+:=+:0=+:0 parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:phpBB3=+:Demo block=+:58=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 function=+:0=+:0=+:0=+:endoflist=+:0=+:0 --- NEW FILE: index.htm --- <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> </body> </html> |