From a3046f3b6ba772d28f659ec40b6aaa82ea81258f Mon Sep 17 00:00:00 2001 From: LyLme Date: Sat, 12 Mar 2022 15:38:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/sou.php | 26 ++++----- admin/tag.php | 147 ++++++++++++++++++++++---------------------------- 2 files changed, 78 insertions(+), 95 deletions(-) diff --git a/admin/sou.php b/admin/sou.php index dd04bcd..714ad79 100644 --- a/admin/sou.php +++ b/admin/sou.php @@ -1,7 +1,7 @@ num_rows($DB->query("SELECT * FROM `lylme_sou`")); ?>
@@ -72,8 +72,9 @@ echo '

新增搜索接

elseif($set=='edit') { $id=$_GET['id']; -$row2 = mysqli_query($con,"select * from lylme_sou where sou_id='$id' limit 1"); -$row=mysqli_fetch_assoc($row2); + +$row2 = $DB->query("select * from lylme_sou where sou_id='$id' limit 1"); +$row= $DB->fetch($row2); echo '

修改搜索引擎

@@ -153,8 +154,7 @@ $sql="INSERT INTO `lylme_sou` (`sou_id`, `sou_alias`, `sou_name`, `sou_hint`, `s (NULL, '".$alias."', '".$name."', '".$hint."', '".$color."', '".$link."', '".$waplink."', '".$icon."', '".$st."', '".$sou_order."'); "; - -if(mysqli_query($con,$sql)){ +if($DB->query($sql)){ echo ''; }else echo ''; @@ -163,8 +163,8 @@ if(mysqli_query($con,$sql)){ elseif($set=='edit_submit') { $id=$_GET['id']; -$rows2 = mysqli_query($con,"select * from lylme_sou where sou_id='$id' limit 1"); -$rows=mysqli_fetch_assoc($rows2); +$rows2 = $DB->query("select * from lylme_sou where sou_id='$id' limit 1"); +$rows=$DB->fetch($rows2); if(!$rows) echo ''; $name=$_POST['name']; @@ -183,7 +183,8 @@ if (empty($name) && empty($alias)&& empty($hint) && empty($link) && empty($color $sql="UPDATE `lylme_sou` SET `sou_alias` = '".$alias."', `sou_name` = '".$name."', `sou_hint` = '".$hint."', `sou_color` = '".$color."', `sou_link` = '".$link."', `sou_waplink` = '".$waplink."', `sou_icon` = '".$icon."', `sou_st` = '".$st."', `sou_order` = '".$order."' WHERE `lylme_sou`.`sou_id` = ".$id.";"; -if(mysqli_query($con,$sql)) + +if($DB->query($sql)) echo ''; else echo ''; @@ -193,7 +194,7 @@ elseif($set=='delete') { $id=$_GET['id']; $sql="DELETE FROM lylme_sou WHERE sou_id='$id'"; -if(mysqli_query($con,$sql)) +if($DB->query($sql)) echo ''; else echo ''; @@ -204,9 +205,10 @@ echo '
系统共有 '.$sousrows.' 个搜索 '; - -$rs=mysqli_query($con,"SELECT * FROM `lylme_sou` ORDER BY `lylme_sou`.`sou_order` ASC"); -while($res = mysqli_fetch_array($rs)) + + +$rs=$DB->query("SELECT * FROM `lylme_sou` ORDER BY `lylme_sou`.`sou_order` ASC"); +while($res = $DB->fetch($rs)) { echo '
排序权重名称别名地址状态操作
'.$res['sou_order'].''.$res['sou_name'].''.$res['sou_alias'].''.$res['sou_link'].''; diff --git a/admin/tag.php b/admin/tag.php index 3d1fea2..bbc108d 100644 --- a/admin/tag.php +++ b/admin/tag.php @@ -1,7 +1,7 @@ -num_rows($DB->query("SELECT * FROM `lylme_tags`")); ?>
@@ -12,12 +12,9 @@ $tagsrows=mysqli_num_rows(mysqli_query($con, "SELECT * FROM `lylme_tags`"));
新增导航菜单链接 +$set = isset($_GET['set']) ? $_GET['set'] : null; +if ($set == 'add') { + echo '

新增导航菜单链接

@@ -39,102 +36,88 @@ echo '

新增导航菜单链接


<<返回
'; -} -elseif($set=='edit') -{ -$id=$_GET['id']; -$row2 = mysqli_query($con,"select * from lylme_tags where tag_id='$id' limit 1"); -$row=mysqli_fetch_assoc($row2); -echo '

修改导航菜单链接

+} elseif ($set == 'edit') { + $id = $_GET['id']; + $row2 = $DB->query("select * from lylme_tags where tag_id='$id' limit 1"); + $row = $DB->fetch($row2); + echo '

修改导航菜单链接

- +

- +

- +


<<返回
'; -} -elseif($set=='add_submit') -{ -$name=$_POST['name']; - -$link=$_POST['link']; -if($_POST['target']==true){$target=1;}else{$target=0;} -if($name==NULL or $link==NULL){ - echo ''; +} elseif ($set == 'add_submit') { + $name = $_POST['name']; + $link = $_POST['link']; + if ($_POST['target'] == true) { + $target = 1; + } else { + $target = 0; + } + if ($name == NULL or $link == NULL) { + echo ''; + } else { + $sql = "INSERT INTO `lylme_tags` (`tag_id`, `tag_name`, `tag_link`, `tag_target`) VALUES (NULL, '" . $name . "', '" . $link . "', '" . $target . "');"; + if ($DB->query($sql)) { + echo ''; + } else echo ''; + } +} elseif ($set == 'edit_submit') { + $id = $_GET['id']; + $rows2 = $DB->query("select * from lylme_tags where tag_id='$id' limit 1"); + $rows = $DB->fetch($rows2); + if (!$rows) echo ''; + $name = $_POST['name']; + $link = $_POST['link']; + if ($_POST['target'] == true) { + $target = 1; + } else { + $target = 0; + } + if ($name == NULL or $link == NULL) { + echo ''; + } else { + $sql = "UPDATE `lylme_tags` SET `tag_name` = '" . $name . "', `tag_link` = '" . $link . "', `tag_target` = '" . $target . "' WHERE `lylme_tags`.`tag_id` = " . $id . ";"; + if ($DB->query($sql)) echo ''; + else echo ''; + } +} elseif ($set == 'delete') { + $id = $_GET['id']; + $sql = "DELETE FROM lylme_tags WHERE tag_id='$id'"; + if ($DB->query($sql)) echo ''; + else echo ''; } else { -$sql="INSERT INTO `lylme_tags` (`tag_id`, `tag_name`, `tag_link`, `tag_target`) VALUES (NULL, '".$name."', '".$link."', '".$target."');"; - -if(mysqli_query($con,$sql)){ - echo ''; -}else - echo ''; -} -} -elseif($set=='edit_submit') -{ -$id=$_GET['id']; -$rows2 = mysqli_query($con,"select * from lylme_tags where tag_id='$id' limit 1"); -$rows=mysqli_fetch_assoc($rows2); -if(!$rows) - echo ''; -$name=$_POST['name']; -$link=$_POST['link']; -if($_POST['target']==true){$target=1;}else{$target=0;} - -if($name==NULL or $link==NULL){ - echo ''; -} else { -$sql = "UPDATE `lylme_tags` SET `tag_name` = '".$name."', `tag_link` = '".$link."', `tag_target` = '".$target."' WHERE `lylme_tags`.`tag_id` = ".$id.";"; -if(mysqli_query($con,$sql)) -echo ''; -else - echo ''; -} -} -elseif($set=='delete') -{ -$id=$_GET['id']; -$sql="DELETE FROM lylme_tags WHERE tag_id='$id'"; -if(mysqli_query($con,$sql)) - echo ''; -else - echo ''; -} -else -{ - - -echo '
系统共有 '.$tagsrows.' 个导航菜单
新增导航菜单
'; - + echo '
系统共有 ' . $tagsrows . ' 个导航菜单
新增导航菜单
'; ?>
'; -} + $rs = $DB->query("SELECT * FROM `lylme_tags`"); + while ($res = $DB->fetch($rs)) { + echo ''; + } ?>
名称链接操作
'.$res['tag_name'].''.$res['tag_link'].'编辑 删除
' . $res['tag_name'] . '' . $res['tag_link'] . '编辑 删除
@@ -148,9 +131,7 @@ echo '
'.$res['tag_name'].''.$res['tag_link'].' - \ No newline at end of file