<?php
define('EmpireCMSAdmin','1');
require('../../../class/connect.php');
require('../../../class/db_sql.php');
require('../../../class/functions.php');
$link=db_connect();
$empire=new mysqlquery();
$editor=2;
$myname="帝国cms标题生成图片插件";
$menuname="标题生成图片";
$urlweizhi=$public_r['newsurl'].'e/jhc/title2pic/';
$submenur=array(
'参数设置'=>'shezhi.php',
'图片缓存设置'=>'wjt_shezhi.php',
'安装设置'=>'readme.php',
);
$act=$_GET['act'];
if($act=="install")
{
if(file_exists("install.off"))
{
echo"{$myname}安装程序已锁定。如果要重新安装,请删除<b>install/install.off</b>文件!";
exit();
}
//------ 插件安装 ------
//增加插件菜单
$empire->query("insert into `{$dbtbpre}enewsmenuclass` values(NULL,'$menuname','0','0','2','');");
$menuclassid=$empire->lastid();
foreach($submenur as $key=>$url){
$url=$urlweizhi.$url;
$empire->query("insert into `{$dbtbpre}enewsmenu` values(NULL,'$key','$url','0','$menuclassid',2);");
}
//锁定安装程序
$fp=@fopen("install.off","w");
@fclose($fp);
$word='已安装完毕!请在帝国后台点击查看!';
exit("$myname $word 感谢您的关注。插件定制QQ 110102296");
}
if($act=='uninstall'){//卸载操作
//------ 插件卸载 ------
if(file_exists("install.off"))exit("{$myname}安装程序已锁定。如果要重新安装/卸载,请删除<b>install/install.off</b>文件!");
//删除插件菜单
$menuclassr=$empire->fetch1("select classid from {$dbtbpre}enewsmenuclass where classname='$menuname' limit 1");
$empire->query("delete from {$dbtbpre}enewsmenuclass where classid='$menuclassr[classid]'");
$empire->query("delete from {$dbtbpre}enewsmenu where classid='$menuclassr[classid]'");
$word='已卸载完毕!';
exit("$myname $word 感谢您的关注。插件定制QQ 110102296");
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?=$myname?>安装/卸载程序</title>
<style>
a:link { COLOR: #000000; TEXT-DECORATION: none }
a:visited { COLOR: #000000 ; TEXT-DECORATION: none }
a:active { COLOR: #000000 ; TEXT-DECORATION: underline }
a:hover { COLOR: #000000 ; TEXT-DECORATION:underline }
.home_top { border-top:2px solid #4798ED; }
.home_path { background:#4798ED; padding-right:10px; color:#F0F0F0; font-size: 11px; }
td, th, caption { font-family: "宋体"; font-size: 14px; color:#000000; LINE-HEIGHT: 165%; }
.hrLine{MARGIN: 0px 0px; BORDER-BOTTOM: #807d76 1px dotted;}
</style>
<script>
function CheckUpdate(obj){
if(confirm('确认操作?'))
{
obj.updatebutton.disabled=true;
return true;
}
return false;
}
</script>
</head>
<body>
<form method="GET" action="index.php" name="formupdate" onsubmit="return CheckUpdate(document.formupdate);">
<br>
<br>
<br>
<table width="500" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#4FB4DE">
<tr>
<td height="30" colspan="2"> <div align="center"><strong><font color="#FFFFFF"><?=$myname?>安装/卸载程序</font></strong></div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="141" height="36">
<div align="right">选择操作:</div></td>
<td width="344">
<input name="act" type="radio" value="install" checked>
安装
<input type="radio" name="act" value="uninstall">
卸载
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="30">
<div align="center"></div></td>
<td> <input type=submit name=updatebutton value="提交操作">
</td>
</tr>
</table>
</form>
</body>
</html>
这是我的模板
|