打开wein.php
找到
if($_GET['t'] == 'add'){
$oid = intval($_GET['oid']);
$id = intval($_POST['id']);
if($_POST){
$weburl = $_POST['weburl'];
if($oid > 0){
$ret = $db->query("UPDATE " . $GLOBALS['ecs']->table('weixin_oauth') . "
SET `weburl`='$weburl',`id`=$id WHERE `oid`={$oid}" );
}else{
$ret = $db->query("INSERT INTO " . $GLOBALS['ecs']->table('weixin_oauth') . "
(`weburl`,`click`,`id`) VALUE ('$weburl',0,$id)");
}
$link [] = array ('href' => 'weixin.php?act=oauth','text' => 'oauth管理');
sys_msg ( '操作成功', 0, $link );
}else if($_GET['t'] == 'delete'){
$oid = intval($_GET['oid']);
$db->query("delete from ".$GLOBALS['ecs']->table('weixin_oauth')." where oid = '$oid'");
$link [] = array ('href' => 'weixin.php?act=oauth','text' => 'oauth管理');
sys_msg ( '操作成功', 0, $link );
}else{
$oauth = $db->getRow("select * from " . $GLOBALS['ecs']->table('weixin_oauth') . "
where oid={$oid}");
$smarty->assign('oauth',$oauth);
$smarty->display ( 'weixin/oauth_add.html' );
}
替换成
if($_GET['t'] == 'add'){
$oid = intval($_GET['oid']);
$id = intval($_POST['id']);
if($_POST){
$weburl = $_POST['weburl'];
if($oid > 0){
$ret = $db->query("UPDATE " . $GLOBALS['ecs']->table('weixin_oauth') . "
SET weburl='$weburl',id=$id WHERE `oid`={$oid}" );
}else{
$ret = $db->query("INSERT INTO " . $GLOBALS['ecs']->table('weixin_oauth') . "
(weburl,click,id) VALUE ('$weburl',0,$id)");
}
$link [] = array ('href' => 'weixin.php?act=oauth','text' => 'oauth管理');
sys_msg ( '操作成功', 0, $link );
}else{
$oauth = $db->getRow("select * from " . $GLOBALS['ecs']->table('weixin_oauth') . "
where oid={$oid}");
$smarty->assign('oauth',$oauth);
$smarty->display ( 'weixin/oauth_add.html' );
}
}
else if($_GET['t'] == 'delete'){
$oid = intval($_GET['oid']);
//$db->query("delete from ".$GLOBALS['ecs']->table('weixin_oauth')." where oid = '$oid'");
$sql = "delete from ".$GLOBALS['ecs']->table('weixin_oauth')." where oid = '$oid'";
$db->query($sql);
$link [] = array ('href' => 'weixin.php?act=oauth','text' => 'oauth管理');
sys_msg ( '操作成功', 0, $link );
}
即可
行数大概为523行