diff --git a/apply/index.php b/apply/index.php
index 07daf67..e05f30c 100644
--- a/apply/index.php
+++ b/apply/index.php
@@ -1,98 +1,26 @@
query("SELECT * FROM `lylme_groups`");
if(!empty($url = isset($_GET['url']) ? $_GET['url'] : null)) {
- function get_head($url) {
- ini_set("user_agent","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36 Edg/101.0.1210.39 Lylme/11.24");
- $opts = array(
- 'http'=>array(
- 'method'=>"GET",
- 'timeout'=>4
- )
- );
- $contents = @file_get_contents("compress.zlib://".$url, false, stream_context_create($opts));
- preg_match('/
(.*?)<\/title>/is',$contents,$title); // 获取网站标题
- preg_match('//is', $contents,$icon); // 获取网站icon
- preg_match('/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'])) {
- $status = $conf["apply"];
- if($status==2) {
- exit('');
- }
- $name=strip_tags(daddslashes($_POST['name']));
- $url=strip_tags(daddslashes($_POST['url']));
- $icon=strip_tags(daddslashes($_POST['icon']));
- $group_id=strip_tags(daddslashes($_POST['group_id']));
- $userip=strip_tags(get_real_ip());
- $sw = 1;
- $date = date("Y-m-d H:i:s");
- if(empty($status)) {
- $status=0;
- }
- }
- function strlens($str) {
- if(strlen($str) > 255) {
- return true;
- } else {
- return false;
- }
- }
- if($sw == 1) {
- if(empty($name) || empty($url) || empty($group_id) || empty($userip) ) {
- //|| empty($icon)
- exit('');
- } else if(!preg_match('/^http*/i', $url)) {
- exit('');
- } else if(strlens($name)||strlens($url)||strlens($icon)||strlens($group_id)||strlens($userip)) {
- exit('');
- } else {
- if($DB->num_rows($DB->query("SELECT * FROM `lylme_apply` WHERE `apply_url` LIKE '".$url."';"))>0) {
- exit('');
- }
- $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."', '".$userip."', '".$date."', '".$status."');";
- if($DB->query($sql)) {
- switch ($status) {
- case 0:
- echo '';
- break;
- case 1:
- $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 . "', '" . $userip . "的提交 ', '" . $link_order . "');";
- if($DB->query($sql1)) {
- echo '';
- } else {
- echo '';
- }
- break;
- }
- } else {
- echo '';
- }
- }
- }
- } else {
- echo '';
- }
- exit();
+else if(isset($_GET['submit']) == 'post') {
+ if(isset($_REQUEST['authcode'])){
+ session_start();
+ if(strtolower($_REQUEST['authcode'])== $_SESSION['authcode']) {
+ $status = isset($conf["apply"]) ? $conf["apply"] :0;
+ if($status==2) {
+ exit('{"code": "400", "msg": "网站已关闭收录"}');
+ }
+ exit(apply($_POST['name'], $_POST['url'], $_POST['icon'], $_POST['group_id'], $status));
+ }
+ else {
+ exit('{"code": "-6", "msg": "验证码错误"}');
+ }
+ }
+ exit();
}
?>
@@ -117,6 +45,8 @@ if(isset($_REQUEST['authcode'])) {
.code{height:38px}
.apply_gg{margin:20px 0;font-size:15px;line-height:2}
.home{text-decoration: none;color: #bbb;line-height: 2;}
+li {list-style-type: none;}
+ol, ul {padding-left: 10px;}
@@ -131,15 +61,14 @@ if(!empty($background = background())){
');
+ exit(''. $conf['apply_gg']. '');
}
?>
-