upgrade.php

来自「在综合英文版XOOPS 2.09, 2.091, 2.092 的基础上正式发布X」· PHP 代码 · 共 36 行

PHP
36
字号
<?php
include '../../../include/cp_header.php';

xoops_cp_header();

if (is_object($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->mid()))
{
	$sql=sprintf("SHOW TABLES LIKE '%s'",$xoopsDB->prefix('stories_files'));
	$result=$xoopsDB->queryF($sql);
	if($xoopsDB->getRowsNum($result)==0)
	{
		$sql = "CREATE TABLE ".$xoopsDB->prefix('stories_files')." (
  			fileid int(8) unsigned NOT NULL auto_increment,
  			filerealname varchar(255) NOT NULL default '',
  			storyid int(8) unsigned NOT NULL default '0',
  			date int(10) NOT NULL default '0',
  			mimetype varchar(64) NOT NULL default '',
  			downloadname varchar(255) NOT NULL default '',
  			counter int(8) unsigned NOT NULL default '0',
  			PRIMARY KEY  (fileid),
  			KEY storyid (storyid)
			) TYPE=MyISAM;";
		if ($xoopsDB->queryF($sql)) {
		    echo _AM_NEWS_UPGRADECOMPLETE." - <a href='".XOOPS_URL."/modules/system/admin.php?fct=modulesadmin&op=update&module=news'>"._AM_UPDATEMODULE."</a>";
		}
		else {
	    	echo _AM_NEWS_UPGRADEFAILED;
		}
	} else {
		redirect_header('index.php', 3, _AM_NEWS_UPGRADECOMPLETE);
	}
} else {
	printf("<H2>Error, to use the upgrade script, you must be an admin on this module</H2>\n");
}
xoops_cp_footer();
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?