This commit is contained in:
LyLme 2023-12-25 22:26:12 +08:00
parent 2ee2c30306
commit 6bbc820e11
3 changed files with 54 additions and 50 deletions

View File

@ -1,7 +1,10 @@
<?php
include_once("../include/common.php");
if(isset($islogin) == 1) {
} else exit("<script language='javascript'>window.location.href='./login.php';</script>");
} else {
exit("<script language='javascript'>window.location.href='./login.php';</script>");
}
header('Content-Type:application/json');
$set = isset($_GET['set']) ? $_GET['set'] : null;
@ -18,9 +21,9 @@ switch($set) {
$url = strip_tags(daddslashes($applyres['apply_url']));
$icon = daddslashes($applyres['apply_icon']);
$group_id = strip_tags(daddslashes($applyres['apply_group']));
$mail=strip_tags(daddslashes($applyres['apply_mail']));
$desc = strip_tags(daddslashes($applyres['apply_desc']));
$link_order = $DB->count('select MAX(id) from `lylme_links`') + 1;
$sql1 = "INSERT INTO `lylme_links` (`id`, `name`, `group_id`, `url`, `icon`, `PS`,`link_order`) VALUES (NULL, '" . $name . "', '" . $group_id . "', '" . $url . "', '" . $icon . "', '" . $mail . "的提交 ', '" . $link_order . "');";
$sql1 = "INSERT INTO `lylme_links` (`id`, `name`, `group_id`, `url`, `icon`, `link_desc`,`link_order`) VALUES (NULL, '" . $name . "', '" . $group_id . "', '" . $url . "', '" . $icon . "', '" . $desc . " ', '" . $link_order . "');";
if($DB->query($sql1)) {
exit('{"code": "200","msg":"成功!网站已成功收录!"}');
} else {
@ -30,12 +33,10 @@ switch($set) {
} elseif($sw == 2) {
if ($DB->query($sql)) {
exit('{"code": "200","msg":"操作成功!"}');
}
else{
} else {
exit('{"code": "-1","操作失败!原因:\n' . $DB->error() . '"}');
}
}
else{
} else {
exit('{"code": "-2","操作失败!-2"}');
}
break;

View File

@ -145,7 +145,7 @@ if ($set == 'add') {
if ($name == null or $url == null) {
echo '<script>alert("保存错误,请确保带星号的都不为空!");history.go(-1);</script>';
} else {
$sql = "INSERT INTO `lylme_links` (`id`, `name`, `group_id`, `url`, `icon`, `PS`,`link_order`) VALUES (NULL, '" . $name1 . "', '" . $group_id . "', '" . $url . "', '" . $icon . "', '" . $name . "', '" . $link_order . "');";
$sql = "INSERT INTO `lylme_links` (`id`, `name`, `group_id`, `url`, `icon`, `link_desc`,`link_order`) VALUES (NULL, '" . $name1 . "', '" . $group_id . "', '" . $url . "', '" . $icon . "', '" . $name . "', '" . $link_order . "');";
if ($DB->query($sql)) {
echo '<script>alert("添加链接 ' . $name . ' 成功!");window.location.href="./link.php";</script>';
} else {

View File

@ -2,3 +2,6 @@
ALTER TABLE `lylme_apply` CHANGE `apply_mail` `apply_desc` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '链接描述';
ALTER TABLE `lylme_links` CHANGE `PS` `link_desc` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '链接描述';
ALTER TABLE `lylme_tags` ADD `sort` INT NOT NULL DEFAULT '10' COMMENT '权重' AFTER `tag_target`;
ALTER TABLE `lylme_config` ADD UNIQUE( `k`);
ALTER TABLE `lylme_config` DROP PRIMARY KEY;
ALTER TABLE `lylme_config` ADD `id` INT NOT NULL AUTO_INCREMENT COMMENT 'ID' FIRST, ADD PRIMARY KEY (`id`);