增加对空间支持的判断,获取feed方法更强大
This commit is contained in:
@@ -61,6 +61,66 @@ function plugin_setting_view(){
|
||||
endif;
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
function plugin_setting(){
|
||||
$do = isset($_GET['do']) ? addslashes($_GET['do']) : '';
|
||||
if ($do == 'del') {
|
||||
$id = intval($_GET['id']);
|
||||
if ($id != 0) {
|
||||
deleteFeed($id);
|
||||
header("Location:plugin.php?plugin=lastRSS&setting=true");
|
||||
}
|
||||
} elseif ($do == 'update') {
|
||||
$id = intval($_POST['id']);
|
||||
$url = isset($_POST['url']) ? trim($_POST['url']) : '';
|
||||
if (!empty($url)) {
|
||||
$title = (isset($_POST['title']) && trim($_POST['title']) !='') ? $_POST['title'] : getTitle($url);
|
||||
$title = addslashes($title);
|
||||
if (!empty($title)) {
|
||||
updateFeed($id, $url, $title);
|
||||
header("Location:plugin.php?plugin=lastRSS&setting=true");
|
||||
} else {
|
||||
emMsg("RSS修改失败,插件无法获取{$url}的标题,请自行添加标题再添加该RSS");
|
||||
}
|
||||
} else {
|
||||
emMsg("RSS修改失败,RSS地址不能为空");
|
||||
}
|
||||
} elseif ($do == 'add') {
|
||||
$url = isset($_POST['url']) ? trim($_POST['url']) : '';
|
||||
if (!empty($url)) {
|
||||
$title = (isset($_POST['title']) && trim($_POST['title']) !='') ? $_POST['title'] : getTitle($url);
|
||||
$title = addslashes($title);
|
||||
if (!empty($title)) {
|
||||
insertFeed($url, $title);
|
||||
updateLogs();
|
||||
header("Location:plugin.php?plugin=lastRSS&setting=true");
|
||||
} else {
|
||||
emMsg("RSS导入失败,插件无法获取{$url}的标题,请自行添加标题再导入该RSS");
|
||||
}
|
||||
} else {
|
||||
emMsg("RSS导入失败,RSS地址不能为空");
|
||||
}
|
||||
} elseif ($do == 'config') {
|
||||
$lastRSS_cache_time = isset($_POST['lastRSS_cache_time']) ? intval($_POST['lastRSS_cache_time']) : 0;
|
||||
$lastRSS_item_num = isset($_POST['lastRSS_item_num']) ? intval($_POST['lastRSS_item_num']) : 2;
|
||||
$lastRSS_is_urlshort = isset($_POST['lastRSS_is_urlshort']) ? intval($_POST['lastRSS_is_urlshort']) : 0;
|
||||
$lastRSS_urlshort_domain = isset($_POST['lastRSS_urlshort_domain']) ? trim($_POST['lastRSS_urlshort_domain']) : 't.cn';
|
||||
$lastRSS_is_blank = isset($_POST['lastRSS_is_blank']) ? intval($_POST['lastRSS_is_blank']) : 0;
|
||||
$data = "<?php
|
||||
\$lastRSS_cache_time = ".$lastRSS_cache_time.";
|
||||
\$lastRSS_item_num = ".$lastRSS_item_num.";
|
||||
\$lastRSS_is_urlshort = ".$lastRSS_is_urlshort.";
|
||||
\$lastRSS_urlshort_domain = '".$lastRSS_urlshort_domain."';
|
||||
\$lastRSS_is_blank = ".$lastRSS_is_blank.";
|
||||
?>";
|
||||
$file = EMLOG_ROOT.'/content/plugins/lastRSS/lastRSS_config.php';
|
||||
@ $fp = fopen($file, 'wb') OR emMsg('读取文件失败,如果您使用的是Unix/Linux主机,请修改文件/content/plugins/lastRSS/lastRSS_config.php的权限为777。如果您使用的是Windows主机,请联系管理员,将该文件设为everyone可写');
|
||||
@ $fw = fwrite($fp,$data) OR emMsg('写入文件失败,如果您使用的是Unix/Linux主机,请修改文件/content/plugins/lastRSS/lastRSS_config.php的权限为777。如果您使用的是Windows主机,请联系管理员,将该文件设为everyone可写');
|
||||
fclose($fp);
|
||||
header("Location:plugin.php?plugin=lastRSS&setting=true");
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ol>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
@@ -88,61 +148,3 @@ function plugin_setting_view(){
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<?php
|
||||
$do = isset($_GET['do']) ? addslashes($_GET['do']) : '';
|
||||
if ($do == 'del') {
|
||||
$id = intval($_GET['id']);
|
||||
if ($id != 0) {
|
||||
deleteFeed($id);
|
||||
header("Location:plugin.php?plugin=lastRSS&setting=true");
|
||||
}
|
||||
} elseif ($do == 'update') {
|
||||
$id = intval($_POST['id']);
|
||||
$url = isset($_POST['url']) ? trim($_POST['url']) : '';
|
||||
if (!empty($url)) {
|
||||
$title = (isset($_POST['title']) && trim($_POST['title']) !='') ? $_POST['title'] : getTitle($url);
|
||||
$title = addslashes($title);
|
||||
if (!empty($title)) {
|
||||
updateFeed($id, $url, $title);
|
||||
header("Location:plugin.php?plugin=lastRSS&setting=true");
|
||||
} else {
|
||||
emMsg("RSS修改失败,插件无法获取{$url}的标题,请自行添加标题再添加该RSS");
|
||||
}
|
||||
} else {
|
||||
emMsg("RSS修改失败,RSS地址不能为空");
|
||||
}
|
||||
} elseif ($do == 'add') {
|
||||
$url = isset($_POST['url']) ? trim($_POST['url']) : '';
|
||||
if (!empty($url)) {
|
||||
$title = (isset($_POST['title']) && trim($_POST['title']) !='') ? $_POST['title'] : getTitle($url);
|
||||
$title = addslashes($title);
|
||||
if (!empty($title)) {
|
||||
insertFeed($url, $title);
|
||||
updateLogs();
|
||||
header("Location:plugin.php?plugin=lastRSS&setting=true");
|
||||
} else {
|
||||
emMsg("RSS导入失败,插件无法获取{$url}的标题,请自行添加标题再导入该RSS");
|
||||
}
|
||||
} else {
|
||||
emMsg("RSS导入失败,RSS地址不能为空");
|
||||
}
|
||||
} elseif ($do == 'config') {
|
||||
$lastRSS_cache_time = isset($_POST['lastRSS_cache_time']) ? intval($_POST['lastRSS_cache_time']) : 0;
|
||||
$lastRSS_item_num = isset($_POST['lastRSS_item_num']) ? intval($_POST['lastRSS_item_num']) : 2;
|
||||
$lastRSS_is_urlshort = isset($_POST['lastRSS_is_urlshort']) ? intval($_POST['lastRSS_is_urlshort']) : 0;
|
||||
$lastRSS_urlshort_domain = isset($_POST['lastRSS_urlshort_domain']) ? trim($_POST['lastRSS_urlshort_domain']) : 't.cn';
|
||||
$lastRSS_is_blank = isset($_POST['lastRSS_is_blank']) ? intval($_POST['lastRSS_is_blank']) : 0;
|
||||
$data = "<?php
|
||||
\$lastRSS_cache_time = ".$lastRSS_cache_time.";
|
||||
\$lastRSS_item_num = ".$lastRSS_item_num.";
|
||||
\$lastRSS_is_urlshort = ".$lastRSS_is_urlshort.";
|
||||
\$lastRSS_urlshort_domain = '".$lastRSS_urlshort_domain."';
|
||||
\$lastRSS_is_blank = ".$lastRSS_is_blank.";
|
||||
?>";
|
||||
$file = EMLOG_ROOT.'/content/plugins/lastRSS/lastRSS_config.php';
|
||||
@ $fp = fopen($file, 'wb') OR emMsg('读取文件失败,如果您使用的是Unix/Linux主机,请修改文件/content/plugins/lastRSS/lastRSS_config.php的权限为777。如果您使用的是Windows主机,请联系管理员,将该文件设为everyone可写');
|
||||
@ $fw = fwrite($fp,$data) OR emMsg('写入文件失败,如果您使用的是Unix/Linux主机,请修改文件/content/plugins/lastRSS/lastRSS_config.php的权限为777。如果您使用的是Windows主机,请联系管理员,将该文件设为everyone可写');
|
||||
fclose($fp);
|
||||
header("Location:plugin.php?plugin=lastRSS&setting=true");
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user