<?php
//设置页面
!defined('EMLOG_ROOT') && exit('error');
//设置页面加载配置文件函数
function plugin_setting_view(){
include(EMLOG_ROOT.'/content/plugins/vip_collect/vip_collect_config.php');
}
require_once 'vip_collect_config2.php';
echo '<div class=containertitle><b>插件设置</b>';
if (isset($_GET['setting'])) {echo '<span class="actived">插件设置完成</span>';plugin_setting();}
echo '</div>';
?>
<!-- 引入外部资源 -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- 使用说明 -->
<h3>小菜鸡 简介</h3>
<p>小菜鸡是一个高效的文章采集插件,作者:<code>DYBOY</code>,博客:<a href="http://www.aiwzx.cn" target="_blank">http://www.aiwzx.cn</a></p>
<p>为了解放站长的双手,减轻网站更新维护的压力,特此推出这款采集工具,希望大家用的舒心~</p>
<p>因为较多的站长朋友对于正则规则不是很熟悉,所以本插件直接封装正则语法,采用模块化的方式来采集对应的网站资源,更多模块会在售后Q群更新维护</p>
<p>插件使用教程:<a href="https://m.bilibili.com/video/av29995449.html" target="_blank">https://m.bilibili.com/video/av29995449.html</a></p>
<!-- setting -->
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">密钥设置</h3>
</div>
<div class="panel-body">
<p>密钥是为了确认管理员身份的一种方式,只有知道密钥的人/后台直接操作 才能够更新采集数据</p>
<p>您可以随时更改密钥,并且设置较为复杂的密钥</p>
<input type="text" name="secret_token" class="secret_token" value="<?php echo SECRET_TORKEN;?>" placeholder="secret_token" style="width:75%;padding-left: 2px;">
<button class="btn btn-success btn_setting">更新保存</button>
</div>
</div>
<!-- keywords -->
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">关键词替换</h3>
</div>
<div class="panel-body">
<p>替换原始采集数据中有些关键词</p>
<p>方便伪原创</p>
<form class="form_key">
<?php
include 'vip_collect_config.php';
$arr_length = count($config);
$count = 0;
foreach ($config as $key => $value) {
$count+=1;
echo '<input type="text" class="key" name="old_key'.$count.'" value="'.$key.'" style="padding-left: 2px;"> 替换为 <input type="text" class="key" name="new_key'.$count.'" value="'.$value.'" style="padding-left: 2px;"><br/><br/>';
}
?>
</form>
<button class="btn btn-success btn_add" onclick="add_new(<?php echo $count;?>)">增加替换</button>
<button type="submit" name="" class="btn btn-primary btn_keywords">更新保存</button>
</form>
</div>
</div>
<!-- 1 -->
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title">采集模块1:小高教学网(www.12580sky.com)</h3>
</div>
<div class="panel-body">
<p>- 采集的是手机端的列表,不是单独某篇文章,使用前请观看教程!</p>
<p>- 由于手机端被关闭,重新更新采集规则 <code>2018-09-25</code></p>
<input type="text" name="target_url" class="target_url1" placeholder="采集列表 exp:https://12580sky.com/sort/mianfeijishu" style="width:50%;padding-left: 2px;">
<input type="number" name="sort_id" class="sort_id1" placeholder="分类id" value="-1">
<button class="btn btn-danger btn_caiji1">开始采集</button>
<button class="btn btn-danger"><a href="https://12580sky.com/sort/mianfeijishu" target="_blank" style="color: #fff">查看源站</a></button>
</div>
</div>
<!-- 2 -->
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title">采集模块2:小僧辅助网(12345abc.cn)</h3>
</div>
<p>- 由爱玩娱乐网重新更新采集规则 <code>2020-01-5</code></p>
<div class="panel-body">
<input type="text" name="target_url" class="target_url2" placeholder="采集列表 exp:http://12345abc.cn/?sort=2" style="width:50%;padding-left: 2px;">
<input type="number" name="sort_id" class="sort_id2" placeholder="分类id" value="-1">
<button class="btn btn-danger btn_caiji2">开始采集</button>
<button class="btn btn-danger"><a href="http://12345abc.cn/?sort=2" target="_blank" style="color: #fff">查看源站</a></button>
</div>
</div>
<!-- 3 -->
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title">采集模块3:小超辅助网(www.5izyw.com)</h3>
</div>
<div class="panel-body">
<p>- 由爱玩娱乐网重新更新采集规则 <code>2020-01-5</code></p>
<input type="text" name="target_url" class="target_url3" placeholder="采集列表 exp:https://www.5izyw.com/sort/yxfz" style="width:50%;padding-left: 2px;">
<input type="number" name="sort_id" class="sort_id3" placeholder="分类id" value="-1">
<button class="btn btn-danger btn_caiji3">开始采集</button>
<button class="btn btn-danger"><a href="https://www.5izyw.com/sort/yxfz" target="_blank" style="color: #fff">查看源站</a></button>
</div>
</div>
<!-- 4 -->
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title">采集模块3:爱玩娱乐网 www.aiwzx.cn</h3>
</div>
<div class="panel-body">
<p>使用本采集插件请及时关注爱玩娱乐网,插件会不定时增加采集站点</p>
<input type="text" name="target_url" class="target_url3" placeholder="采集列表 exp:http://www.aiwzx.cn/?sort=2" style="width:50%;padding-left: 2px;">
<input type="number" name="sort_id" class="sort_id3" placeholder="分类id" value="-1">
<button class="btn btn-danger btn_caiji3">开始采集</button>
<button class="btn btn-danger"><a href="http://www.aiwzx.cn/?sort=2" target="_blank" style="color: #fff">查看源站</a></button>
</div>
</div>
<!-- 5 -->
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title">爱玩娱乐网首发</h3>
</div>
<div class="panel-body">
http://www.aiwzx.cn
</div>
</div>
<script type="text/javascript">
//设置关键词替换
function add_new(id){
var id_num = id+1;
$(".form_key").append('<input type="text" class="key" name="old_key'+id_num+'" value="" style="padding-left: 2px;"> 替换为 <input type="text" class="key" name="new_key'+id_num+'" value="" style="padding-left: 2px;"><br/><br/>');
$(".btn_add").attr("disabled",'true');
}
$("document").ready(function(){
//设置
$(".btn_setting").click(function(){
var secret_token = $(".secret_token").val();
if(secret_token){
$.get('<?php echo BLOG_URL;?>content/plugins/vip_collect/curl.php?token=<?php echo SECRET_TORKEN;?>&new_token='+secret_token,function(data){
if(data.status){
alert(data.msg);
window.location.reload();//refresh
}
else{ alert(data.msg); }
})
}
else{
alert("请填写密钥");
}
});
//设置关键词
$(".btn_keywords").click(function(){
$.post("<?php echo BLOG_URL;?>content/plugins/vip_collect/curl.php?setting=do&token=<?php echo SECRET_TORKEN;?>",
$(".form_key").serialize()
,function(data){
alert(data.msg);
window.location.reload();
})
})
$(".btn_caiji1").click(function(){
var input_val = $(".target_url1").val();
var sort_id = $(".sort_id1").val();
if(input_val){
$(".btn_caiji1").attr('disabled',"true");
$.get('<?php echo BLOG_URL;?>content/plugins/vip_collect/curl.php?target_url='+input_val+'&token=<?php echo SECRET_TORKEN;?>&model=1&sort_id='+sort_id,function(data){
if(data.status){
alert(data.msg);
$(".btn_caiji1").removeAttr("disabled");