|
From: Jon O. <jon...@us...> - 2005-09-20 15:40:26
|
Update of /cvsroot/mxbb/mx_phpbb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17659 Added Files: db_install.php db_uninstall.php db_upgrade.php mx_phpbb.pak mx_phpbb.php Log Message: adding new files for module mx_phpbb --- NEW FILE: mx_phpbb.pak --- module=+:57=+:mx_phpbb=+:modules/mx_phpbb/=+:mxBB Forum Integration=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:57=+:101=+:phpBB=+:mxBB Forum Integration=+:mx_phpbb.php=+: parameter=+:101=+:336=+:Source_phpBB_Forums=+:phpbb_type_select=+:=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - phpBB=+:Demo block=+:101=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 function=+:0=+:0=+:0=+:endoflist=+:0=+:0 --- NEW FILE: db_uninstall.php --- <?php /** * * ------------------------------------------------------------------------ * subject : mxBB-Portal - CMS & portal * begin : june, 2002 * copyright : (C) 2002-2005 mxBB-Portal * email : jon...@ho... * project site : www.mx-system.com * * ------------------------------------------------------------------------- * * $Id: db_uninstall.php,v 1.1 2005/09/20 15:40:17 jonohlsson Exp $ */ /** * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { $mx_root_path = './../../'; include( $mx_root_path . 'extension.inc' ); include( $mx_root_path . 'common.' . $phpEx ); // Start session management $userdata = session_pagestart( $user_ip, PAGE_INDEX ); mx_init_userprefs( $userdata ); 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 . "phpbb_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: mx_phpbb.php --- <?php /*************************************************************************** * mx_index.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: mx_phpbb.php,v 1.1 2005/09/20 15:40:17 jonohlsson Exp $ * * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ if( !defined('IN_PORTAL') ) { die("Hacking attempt !!!"); } // // Restore POST vars after redirect // //$_POST = $HTTP_POST_VARS = $_SESSION['mxbb_post_vars']; include_once($mx_root_path . "modules/mx_phpbb/includes/forum_hack.$phpEx"); include_once($mx_root_path . "modules/mx_phpbb/includes/phpbb_constants.$phpEx"); ob_start(); $mx_forum->read_file( $mx_forum->phpbb_script ); $phpbb_output = ob_get_contents(); ob_end_clean(); // // Final tpl code fixup - these are really phpBB "bugs", hardcoded images etc // switch ( $mx_forum->phpbb_script ) { case 'index': $phpbb_output = str_replace('templates/subSilver/images/folder_new_big.gif', $phpbb_root_path . 'templates/'.$theme['template_name'].'/images/folder_new_big.gif', $phpbb_output); $phpbb_output = str_replace('templates/subSilver/images/folder_big.gif', $phpbb_root_path . 'templates/'.$theme['template_name'].'/images/folder_big.gif', $phpbb_output); $phpbb_output = str_replace('templates/subSilver/images/folder_locked_big.gif', $phpbb_root_path . 'templates/'.$theme['template_name'].'/images/folder_locked_big.gif', $phpbb_output); $phpbb_output = str_replace('templates/subSilver/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/subSilver/images/vote_lcap.gif', $phpbb_root_path . 'templates/subSilver/images/vote_lcap.gif', $phpbb_output); $phpbb_output = str_replace('templates/subSilver/images/vote_rcap.gif', $phpbb_root_path . 'templates/subSilver/images/vote_rcap.gif', $phpbb_output); break; case 'posting': break; } echo($phpbb_output); unset($phpbb_output); ?> --- NEW FILE: db_install.php --- <?php /** * * ------------------------------------------------------------------------ * subject : mxBB-Portal - CMS & portal * begin : june, 2002 * copyright : (C) 2002-2005 mxBB-Portal * email : jon...@ho... * project site : www.mx-system.com * * ------------------------------------------------------------------------- * * $Id: db_install.php,v 1.1 2005/09/20 15:40:17 jonohlsson Exp $ */ /** * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { $mx_root_path = './../../'; include( $mx_root_path . 'extension.inc' ); include( $mx_root_path . 'common.' . $phpEx ); // Start session management $userdata = session_pagestart( $user_ip, PAGE_INDEX ); mx_init_userprefs( $userdata ); if ( !$userdata['session_logged_in'] ) { die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { die( "Hacking attempt(2)" ); } // End session management } $mx_module_version = 'mxBB - phpBB Integration Module 1.0.3'; $mx_module_copy = 'Based on <a href="http://www.phpbb.com/" target="_phpbb">phpBB</a>'; // If fresh install if ( !$result = $db->sql_query( "SELECT config_name from " . $mx_table_prefix . "phpbb_plugin_config" ) ) { $message = "<b>This is a fresh install!</b><br/><br/>"; $sql = array(); $sql[] = "DROP TABLE IF EXISTS " . $mx_table_prefix . "phpbb_plugin_config"; $sql[] = "CREATE TABLE " . $mx_table_prefix . "phpbb_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 . "phpbb_plugin_config VALUES ('override_default_pages', 'Block_setup')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('enable_module', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('faq', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('groupcp', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('index', '2')"; //$sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('viewforum', '0')"; //$sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('viewtopic', '0')"; //$sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('modcp', '0')"; //$sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('posting', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('login', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('memberlist', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('privmsg', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('profile', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('search', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('viewonline', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('other', '0')"; $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/Uninstalling 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: db_upgrade.php --- <?php /** * * ------------------------------------------------------------------------ * subject : mxBB-Portal - CMS & portal * begin : june, 2002 * copyright : (C) 2002-2005 mxBB-Portal * email : jon...@ho... * project site : www.mx-system.com * * ------------------------------------------------------------------------- * * $Id: db_upgrade.php,v 1.1 2005/09/20 15:40:17 jonohlsson Exp $ */ /** * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { $mx_root_path = './../../'; include( $mx_root_path . 'extension.inc' ); include( $mx_root_path . 'common.' . $phpEx ); // Start session management $userdata = session_pagestart( $user_ip, PAGE_INDEX ); mx_init_userprefs( $userdata ); if ( !$userdata['session_logged_in'] ) { die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { die( "Hacking attempt(2)" ); } // End session management } $mx_module_version = 'mxBB - phpBB Integration Module 1.0.3'; $mx_module_copy = 'Based on <a href="http://www.phpbb.com/" target="_phpbb" >phpBB</a>'; $sql = array(); // // Precheck // if ( $result = $db->sql_query( "SELECT config_name from " . $mx_table_prefix . "phpbb_plugin_config" ) ) { // // Upgrade checks // $upgrade_101 = 0; $upgrade_102 = 0; $upgrade_103 = 0; $upgrade_104 = 0; $upgrade_105 = 0; $upgrade_106 = 0; $upgrade_107 = 0; // // validate before 1.01 // $result = $db->sql_query( "SELECT config_value from " . $mx_table_prefix . "phpbb_plugin_config WHERE config_name = 'override_default_pages'" ); if ( $db->sql_numrows( $result ) == 0 ) { $upgrade_101 = 1; } $result = $db->sql_query( "SELECT config_value from " . $mx_table_prefix . "phpbb_plugin_config WHERE config_name = 'enable_module'" ); if ( $db->sql_numrows( $result ) == 0 ) { $upgrade_102 = 1; } $message = "<b>Upgrading!</b><br/><br/>"; if ( $upgrade_101 == 1 ) { $message .= "<b>Upgrading to v. 1.01...</b><br/><br/>"; $sql[] = "CREATE TABLE " . $mx_table_prefix . "phpbb_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 . "phpbb_plugin_config VALUES ('override_default_pages', 'Block_setup')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('faq', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('groupcp', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('index', '2')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('login', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('memberlist', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('modcp', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('posting', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('privmsg', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('profile', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('search', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('viewonline', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('other', '0')"; } else if ( $upgrade_102 == 1 ) { $sql[] = "INSERT INTO " . $mx_table_prefix . "phpbb_plugin_config VALUES ('enable_module', '1')"; } else { $message .= "<b>Nothing to upgrade...</b><br/><br/>"; } $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 not installed // $message = "<b>Module is not installed...and thus cannot be upgraded ;)</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/Uninstalling Information - module specific db tables</th></tr>"; echo "<tr><td class=\"row1\" align=\"left\"><span class=\"gen\">" . $message . "</span></td></tr>"; echo "</table><br />"; ?> |