国外非常不错的论坛

源代码在线查看: upgrade-0-2-3.php

软件大小: 119 K
上传用户: lujing200912345
关键词: 论坛
下载地址: 免注册下载 普通下载 VIP

相关代码

												/*					Copyright (C) 2003-2005 UseBB Team					http://www.usebb.net										$Header: /cvsroot/usebb/UseBB/install/upgrade-0-2-3.php,v 1.19 2005/08/22 17:52:17 pc_freak Exp $										This file is part of UseBB.										UseBB 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.										UseBB is distributed in the hope that it will be useful,					but WITHOUT ANY WARRANTY; without even the implied warranty of					MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the					GNU General Public License for more details.										You should have received a copy of the GNU General Public License					along with UseBB; if not, write to the Free Software					Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA				*/								define('INCLUDED', true);				include('../config.php');								class functions {										function usebb_die($errno, $error, $file, $line) {												global $connerror;												//						// Don't show various errors on PHP5						//						if ( intval(substr(phpversion(), 0, 1)) > 4 ) {														$ignore_warnings = array(								'var: Deprecated. Please use the public/private/protected modifiers',								'Trying to get property of non-object',							);							if ( in_array($error, $ignore_warnings) )								return;													}												$connerror = $error;											}										function get_config($setting) {												global $conf;												if ( isset($conf[$setting]) )							return $conf[$setting];						else							return '';											}									}								$functions = new functions;								function error_handler($errno, $error, $file, $line) {										global $functions;					$functions->usebb_die($errno, $error, $file, $line);									}				set_error_handler('error_handler');								if ( !empty($_POST['step']) && intval($_POST['step']) > 1 ) {										include('../sources/db_'.$dbs['type'].'.php');					$db = new db;					$db->connect($dbs);									}								function to_step($step) {										return '';									}								?>																				UseBB Upgrade 0.2.3									body {						font-family: sans-serif;						text-align: center;						font-size: 10pt;					}					#logo {						margin-bottom: 0px;					}					h1 {						color: #336699;						font-size: 18pt;						font-weight: bold;						margin-top: 0px;					}					#wrap {						width: 600px;						margin: 0px auto 0px auto;						background-color: #EFEFEF;						border: 1px solid silver;						padding: 10px;						text-align: left;					}					h2 {						color: #336699;						font-size: 12pt;						font-weight: bold;						text-align: center;					}					form {						text-align: center;					}					address {						color: #333333;						margin: 10px 0px 0px 0px;					}																				Upgrade 0.2.3																if ( empty($_POST['step']) ) {										echo 'Welcome';					echo 'Welcome to the UseBB upgrade 0.2.3 wizard. This wizard will help you upgrade UseBB 0.2.3(a) to version 0.3.';					echo to_step(1);									} elseif ( intval($_POST['step']) === 1 ) {										echo 'Step 1';										if ( !function_exists('version_compare') ) {												echo 'We\'re sorry. UseBB does not work on the PHP version running on this server (PHP '.phpversion().'). You need at least 4.1.0. Get a recent version from PHP.net.';											} else {												echo 'First, upload UseBB 0.3 to the same location as 0.2.3, overwriting the old files. Then edit the database configuration values in config.php. Make sure the database settings match with those for your host. If in doubt, please contact your web host for information regarding accessing databases.';						echo 'Tip: if you already use MySQL 4.1, it might be interesting to set $dbs[\'type\'] to \'mysqli\'. If you don\'t know which version you are running, leave the default value.';						echo 'Another tip: you might want to check this document out to change config.php.';						echo to_step(2);											}									} elseif ( intval($_POST['step']) === 2 ) {										echo 'Step 2';					if ( !empty($connerror) ) {												echo 'An error was encountered while trying to access the database. The error was:';						echo ''.$connerror.'';						echo 'Please check your database settings in config.php!';						echo to_step(2);											} else {												echo 'The database settings are OK!';						echo to_step(3);											}									} elseif ( intval($_POST['step']) === 3 ) {										echo 'Step 3';										$queries = array(						"ALTER TABLE `".$dbs['prefix']."users` RENAME `".$dbs['prefix']."members`",						"ALTER TABLE `".$dbs['prefix']."members` ADD `last_pageview` INT( 10 ) NOT NULL AFTER `last_login_show` , ADD `hide_from_online_list` INT( 1 ) NOT NULL AFTER `last_pageview`",						"ALTER TABLE `".$dbs['prefix']."members` ADD `target_blank` INT( 1 ) NOT NULL AFTER `return_to_topic_after_posting` , ADD `hide_avatars` INT( 1 ) NOT NULL AFTER `target_blank` , ADD `hide_userinfo` INT( 1 ) NOT NULL AFTER `hide_avatars` , ADD `hide_signatures` INT( 1 ) NOT NULL AFTER `hide_userinfo`"					);										$error = false;					foreach ( $queries as $query ) {												if ( !($db->query($query)) ) {														$error = true;							break;													}											}										$db->disconnect();										if ( $error ) {												echo 'An error occured while executing the SQL queries.';						echo to_step(3);											} else {												echo 'All SQL queries have been executed. Your board has now been updated to version 0.3. If the latest release is newer, you might need to run other wizards too. See the UPGRADE document. Otherwise, please delete the directory install/ for security reasons. You can now go to your UseBB board and continue using it.';						echo 'Tip: you might want to use this manual to further set up your forum.';						echo 'Thanks for choosing UseBB! We wish you a lot of fun with your board!';											}									}								?>								Copyright © 2003-2005 UseBB Team											

相关资源