From 130db39dfad8a24f40b36a76e5a1ca57dc583bbe Mon Sep 17 00:00:00 2001 From: LyLme Date: Sun, 20 Mar 2022 14:57:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E6=94=B6=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apply/index.php | 185 ++++++++++++++++++++++++++++++++++++++++++++ install/install.sql | 6 +- 2 files changed, 190 insertions(+), 1 deletion(-) create mode 100644 apply/index.php diff --git a/apply/index.php b/apply/index.php new file mode 100644 index 0000000..25d8eea --- /dev/null +++ b/apply/index.php @@ -0,0 +1,185 @@ +query("SELECT * FROM `lylme_groups`"); +if(isset($_REQUEST['authcode'])){ + session_start(); + if(strtolower($_REQUEST['authcode'])== $_SESSION['authcode']){ + if(isset($_POST['name'])&& isset($_POST['url'])&& isset($_POST['icon'])&& isset($_POST['group_id'])&& isset($_POST['mail'])!=NULL){ + $name=daddslashes($_POST['name']); + $url=daddslashes($_POST['url']); + $icon=daddslashes($_POST['icon']); + $group_id=daddslashes($_POST['group_id']); + $mail=daddslashes($_POST['mail']); + $sw = 1; + $date = date("Y-m-d H:i:s"); + $status = $conf["apply"]; + if($status==2) { + exit(''); + } + if(empty($status)){ + $status=0; + } + } + if($sw == 1){ + if(empty($name) || empty($url) || empty($icon) || empty($group_id) || empty($mail) ){ + exit(''); + } else if(strpos($icon, 'http') !== 0 && strpos($icon, 'alert("提交失败,请按要求填写!");history.go(-1);'); + } else{ + $sql = "INSERT INTO `lylme_apply` (`apply_id`, `apply_name`, `apply_url`, `apply_group`, `apply_icon`, `apply_mail`, `apply_time`, `apply_status`) VALUES (NULL, '".$name."', '".$url."', '".$group_id."', '".$icon."', '".$mail."', '".$date."', '".$status."');"; + if($DB->query($sql)){ + switch ($status) { + case 0: + echo ''; + break; + case 1: + echo ''; + break; + } + } else{ + echo ''; + } + } + } + } else{ + echo ''; + } + exit(); +} +?> + + + + + + +申请收录 - <?php echo $conf['title'];?> + + + + + + + + + +
+
+
+

申请收录

+
+ + + + + + + + + + + + +
+ +
+
+
+ + \ No newline at end of file diff --git a/install/install.sql b/install/install.sql index a496a13..d60555a 100644 --- a/install/install.sql +++ b/install/install.sql @@ -34,6 +34,7 @@ INSERT INTO `lylme_config` VALUES ('version', 'v1.1.3', '程序版本'); INSERT INTO `lylme_config` VALUES ('yan', 'true', '随机一言开关'); INSERT INTO `lylme_config` VALUES ('tq', 'true', '天气显示开关'); INSERT INTO `lylme_config` VALUES ('wztj', '', '网站统计代码'); +INSERT INTO `lylme_config` VALUES ('apply', '0','申请收录'); INSERT INTO `lylme_config` VALUES ('template', 'default','网站模板'); INSERT INTO `lylme_config` VALUES ('cdnpublic', NULL,'CDN地址'); -- ---------------------------- @@ -213,4 +214,7 @@ ALTER TABLE `lylme_tags` ADD PRIMARY KEY (`tag_id`); ALTER TABLE `lylme_tags` MODIFY `tag_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -COMMIT; \ No newline at end of file +COMMIT; + +-- 表`lylme_apply` +CREATE TABLE `cloud`.`lylme_apply` ( `apply_id` INT(4) NOT NULL AUTO_INCREMENT , `apply_name` VARCHAR(20) NOT NULL , `apply_url` VARCHAR(255) NOT NULL , `apply_group` INT(2) NOT NULL , `apply_icon` TEXT NOT NULL , `apply_mail` VARCHAR(30) NOT NULL , `apply_time` DATETIME NOT NULL , `apply_status` INT NOT NULL , PRIMARY KEY (`apply_id`)) ENGINE = InnoDB COMMENT = '收录申请'; \ No newline at end of file