优化 收录申请
This commit is contained in:
parent
b482b4b656
commit
ef12a6d987
|
@ -1,20 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
include("../include/common.php");
|
include("../include/common.php");
|
||||||
$grouplists =$DB->query("SELECT * FROM `lylme_groups`");
|
$grouplists =$DB->query("SELECT * FROM `lylme_groups`");
|
||||||
|
|
||||||
if(isset($_REQUEST['authcode'])) {
|
if(isset($_REQUEST['authcode'])) {
|
||||||
session_start();
|
session_start();
|
||||||
if(strtolower($_REQUEST['authcode'])== $_SESSION['authcode']) {
|
if(strtolower($_REQUEST['authcode'])== $_SESSION['authcode']) {
|
||||||
if(isset($_POST['name'])&& isset($_POST['url'])&& isset($_POST['icon'])&& isset($_POST['group_id'])&& isset($_POST['mail'])!=NULL) {
|
if(isset($_POST['name'])&& isset($_POST['url'])&& isset($_POST['icon'])&& isset($_POST['group_id'])&& isset($_POST['mail'])!=NULL) {
|
||||||
|
|
||||||
$status = $conf["apply"];
|
$status = $conf["apply"];
|
||||||
if($status==2) {
|
if($status==2) {
|
||||||
exit('<script>alert("提交失败,网站已关闭申请收录功能!");window.location.href="./";</script>');
|
exit('<script>alert("提交失败,网站已关闭申请收录功能!");window.location.href="./";</script>');
|
||||||
}
|
}
|
||||||
$name=strip_tags(daddslashes($_POST['name']));
|
$name=strip_tags(daddslashes($_POST['name']));
|
||||||
$url=strip_tags(daddslashes($_POST['url']));
|
$url=strip_tags(daddslashes($_POST['url']));
|
||||||
$icon=daddslashes($_POST['icon']);
|
$icon=strip_tags(daddslashes($_POST['icon']));
|
||||||
$group_id=daddslashes($_POST['group_id']);
|
$group_id=strip_tags(daddslashes($_POST['group_id']));
|
||||||
$mail=strip_tags(daddslashes($_POST['mail']));
|
$mail=strip_tags(daddslashes($_POST['mail']));
|
||||||
$sw = 1;
|
$sw = 1;
|
||||||
$date = date("Y-m-d H:i:s");
|
$date = date("Y-m-d H:i:s");
|
||||||
|
@ -29,6 +27,9 @@ if(isset($_REQUEST['authcode'])){
|
||||||
|| !preg_match('{^http[s]?://([\w-]+\.)+[\w-]+(/[\w-./?%&#=]*)?$}i', $url)) {
|
|| !preg_match('{^http[s]?://([\w-]+\.)+[\w-]+(/[\w-./?%&#=]*)?$}i', $url)) {
|
||||||
exit('<script>alert("提交失败!输入不符合要求");history.go(-1);</script>');
|
exit('<script>alert("提交失败!输入不符合要求");history.go(-1);</script>');
|
||||||
} else {
|
} else {
|
||||||
|
if($DB->num_rows($DB->query("SELECT * FROM `lylme_apply` WHERE `apply_url` LIKE '".$url."';"))>0) {
|
||||||
|
exit('<script>alert("链接已存在,请勿重复提交!");history.go(-1);</script>');
|
||||||
|
}
|
||||||
$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."');";
|
$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)) {
|
if($DB->query($sql)) {
|
||||||
switch ($status) {
|
switch ($status) {
|
||||||
|
@ -36,7 +37,13 @@ if(isset($_REQUEST['authcode'])){
|
||||||
echo '<script>alert("提交成功!请等待管理员审核!");window.location.href="./";</script>';
|
echo '<script>alert("提交成功!请等待管理员审核!");window.location.href="./";</script>';
|
||||||
break;
|
break;
|
||||||
case 1:
|
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 . "', '" . $mail . "的提交 ', '" . $link_order . "');";
|
||||||
|
if($DB->query($sql1)) {
|
||||||
echo '<script>alert("提交成功!网站已成功收录!");window.location.href="./";</script>';
|
echo '<script>alert("提交成功!网站已成功收录!");window.location.href="./";</script>';
|
||||||
|
} else {
|
||||||
|
echo '<script>alert("提交成功!请等待管理员审核!");</script>';
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -50,13 +57,13 @@ if(isset($_REQUEST['authcode'])){
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="zh">
|
<html lang="zh">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
||||||
<title>申请收录 - <?php echo $conf['title'];?></title>
|
<title>申请收录 - <?php echo $conf['title'];
|
||||||
|
?></title>
|
||||||
<link rel="icon" href="/assets/img/logo.png" type="image/ico">
|
<link rel="icon" href="/assets/img/logo.png" type="image/ico">
|
||||||
<meta name="author" content="LyLme">
|
<meta name="author" content="LyLme">
|
||||||
<link href="../admin/css/materialdesignicons.min.css" rel="stylesheet">
|
<link href="../admin/css/materialdesignicons.min.css" rel="stylesheet">
|
||||||
|
@ -110,14 +117,14 @@ if(isset($_REQUEST['authcode'])){
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="row lylme-wrapper" style="background-image: url(../assets/img/background.jpg);background-size: cover;">
|
<div class="row lylme-wrapper" style="background-image: url(<?php echo background()?>);background-size: cover;">
|
||||||
<div class="lylme-form">
|
<div class="lylme-form">
|
||||||
<div class="lylme-center">
|
<div class="lylme-center">
|
||||||
<?php if($conf["apply"]==2) {
|
<?php if($conf["apply"]==2) {
|
||||||
exit('<div class="lylme-header text-center"><h2>网站已关闭申请收录</h2></div> </div>');
|
exit('<div class="lylme-header text-center"><h2>网站已关闭申请收录</h2></div> </div>');
|
||||||
}?>
|
}
|
||||||
|
?>
|
||||||
<div class="lylme-header text-center"><h2>申请收录</h2></div>
|
<div class="lylme-header text-center"><h2>申请收录</h2></div>
|
||||||
<form action="" method="POST">
|
<form action="" method="POST">
|
||||||
<div class="form-group has-feedback feedback-left row">
|
<div class="form-group has-feedback feedback-left row">
|
||||||
|
@ -127,7 +134,6 @@ if(isset($_REQUEST['authcode'])){
|
||||||
<span class="mdi mdi-format-title form-control-feedback" aria-hidden="true"></span>
|
<span class="mdi mdi-format-title form-control-feedback" aria-hidden="true"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group has-feedback feedback-left row">
|
<div class="form-group has-feedback feedback-left row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<label>* 网站链接:</label>
|
<label>* 网站链接:</label>
|
||||||
|
@ -135,21 +141,24 @@ if(isset($_REQUEST['authcode'])){
|
||||||
<span class="mdi mdi-link-variant form-control-feedback" aria-hidden="true"></span>
|
<span class="mdi mdi-link-variant form-control-feedback" aria-hidden="true"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group has-feedback feedback-left row">
|
<div class="form-group has-feedback feedback-left row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<label>* 选择分组:</label>
|
<label>* 选择分组:</label>
|
||||||
<select class="form-control" name="group_id">
|
<select class="form-control" name="group_id">
|
||||||
<?php
|
<?php
|
||||||
while($grouplist = $DB->fetch($grouplists)) {
|
while($grouplist = $DB->fetch($grouplists)) {
|
||||||
if($grouplist["group_id"]==$row['group_id']){$select='selected="selected"';}else {$select='';}
|
if($grouplist["group_id"]==$row['group_id']) {
|
||||||
|
$select='selected="selected"';
|
||||||
|
} else {
|
||||||
|
$select='';
|
||||||
|
}
|
||||||
echo '<option value="'.$grouplist["group_id"].'">'.$grouplist["group_id"].'. '.$grouplist["group_name"].'</option>';
|
echo '<option value="'.$grouplist["group_id"].'">'.$grouplist["group_id"].'. '.$grouplist["group_name"].'</option>';
|
||||||
}?>
|
}
|
||||||
|
?>
|
||||||
</select>
|
</select>
|
||||||
<span class="mdi mdi-folder form-control-feedback" aria-hidden="true"></span>
|
<span class="mdi mdi-folder form-control-feedback" aria-hidden="true"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group has-feedback feedback-left row">
|
<div class="form-group has-feedback feedback-left row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<label>* 网站图标:</label>
|
<label>* 网站图标:</label>
|
||||||
|
@ -160,7 +169,6 @@ if(isset($_REQUEST['authcode'])){
|
||||||
3. 仅支持<code>.ico .png .jpg .gif</code>的格式</small>
|
3. 仅支持<code>.ico .png .jpg .gif</code>的格式</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group has-feedback feedback-left row">
|
<div class="form-group has-feedback feedback-left row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<label>* 联系邮箱:</label>
|
<label>* 联系邮箱:</label>
|
||||||
|
@ -168,7 +176,6 @@ if(isset($_REQUEST['authcode'])){
|
||||||
<span class="mdi mdi-email form-control-feedback" aria-hidden="true"></span>
|
<span class="mdi mdi-email form-control-feedback" aria-hidden="true"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label>* 验证码:</label>
|
<label>* 验证码:</label>
|
||||||
<div class="form-group has-feedback feedback-left row">
|
<div class="form-group has-feedback feedback-left row">
|
||||||
<div class="col-xs-9">
|
<div class="col-xs-9">
|
||||||
|
@ -179,8 +186,6 @@ if(isset($_REQUEST['authcode'])){
|
||||||
<img id="captcha_img" src='../include/validatecode.php?r=echo rand(); ?>' class="pull-right code"
|
<img id="captcha_img" src='../include/validatecode.php?r=echo rand(); ?>' class="pull-right code"
|
||||||
onclick="document.getElementById('captcha_img').src='../include/validatecode.php?r='+Math.random()"
|
onclick="document.getElementById('captcha_img').src='../include/validatecode.php?r='+Math.random()"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
@ -193,8 +198,16 @@ if(isset($_REQUEST['authcode'])){
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var inputInt = document.getElementById('icon');
|
var inputInt = document.getElementById('icon');
|
||||||
var submit = document.getElementById("submit");
|
var submit = document.getElementById("submit");
|
||||||
function sw_on(){inputInt.style.borderColor = "#ebebeb";submit.disabled = false;submit.value = "提交";}
|
function sw_on() {
|
||||||
function sw_off(){inputInt.style.borderColor = "#ff0000";submit.disabled = true;submit.value = "输入不符合要求";}
|
inputInt.style.borderColor = "#ebebeb";
|
||||||
|
submit.disabled = false;
|
||||||
|
submit.value = "提交";
|
||||||
|
}
|
||||||
|
function sw_off() {
|
||||||
|
inputInt.style.borderColor = "#ff0000";
|
||||||
|
submit.disabled = true;
|
||||||
|
submit.value = "输入不符合要求";
|
||||||
|
}
|
||||||
inputInt.oninput = function() {
|
inputInt.oninput = function() {
|
||||||
var re =/^http[s]?:\/\/([\w-]+\.)+[\w]+(\/[\w-./%&=]*)\.(jpg|png|ico|gif)$/
|
var re =/^http[s]?:\/\/([\w-]+\.)+[\w]+(\/[\w-./%&=]*)\.(jpg|png|ico|gif)$/
|
||||||
if (!re.test(this.value)) {
|
if (!re.test(this.value)) {
|
||||||
|
@ -202,9 +215,9 @@ if(isset($_REQUEST['authcode'])){
|
||||||
} else {
|
} else {
|
||||||
sw_on();
|
sw_on();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
;
|
||||||
sw_on();
|
sw_on();
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue