bomp to 2.1.0
fix bug
This commit is contained in:
12
autopub.php
12
autopub.php
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
Plugin Name: 自动发布
|
Plugin Name: 自动发布
|
||||||
Version: 2.0.0
|
Version: 2.1.0
|
||||||
Plugin URL: http://xiaosong.org/share/new-version-automatically-publish-plugin-released
|
Plugin URL: http://xiaosong.org/share/new-version-automatically-publish-plugin-released
|
||||||
Description: 自动发布文章,修正时区问题,增加相关挂载点,自动删除缓存文件。
|
Description: 自动发布文章,修正时区问题,增加相关挂载点,自动删除缓存文件。
|
||||||
Author: 小松
|
Author: 小松
|
||||||
@@ -11,10 +11,13 @@ Author URL: http://xiaosong.org
|
|||||||
!defined('EMLOG_ROOT') && exit('access deined!');
|
!defined('EMLOG_ROOT') && exit('access deined!');
|
||||||
|
|
||||||
function autopubAjax(){
|
function autopubAjax(){
|
||||||
echo '<script type="text/javascript">$(function(){$.get("'.BLOG_URL.'?plugin=autopub");})</script>'."\n";
|
echo '<script type="text/javascript">$.get("'.DYNAMIC_BLOGURL.'content/plugins/autopub/autopub_ajax.php")</script>'."\n";
|
||||||
|
}
|
||||||
|
function autopubAjaxAdmin(){
|
||||||
|
echo '<script type="text/javascript">$.get("'.BLOG_URL.'content/plugins/autopub/autopub_ajax.php")</script>'."\n";
|
||||||
}
|
}
|
||||||
function autopubPhp(){
|
function autopubPhp(){
|
||||||
echo '<script type="text/javascript">$(function(){$.ajax({url: "'.BLOG_URL.'content/plugins/autopub/autopub_cron.php",timeout: 1000,cache: false});})</script>'."\n";
|
echo '<script type="text/javascript">$.ajax({url: "'.BLOG_URL.'content/plugins/autopub/autopub_cron.php",timeout: 1000,cache: false})</script>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
function doPub(){
|
function doPub(){
|
||||||
@@ -46,7 +49,7 @@ if (count($autopubArray) > 1) {
|
|||||||
if (isset($autopubArray['trigger']) && $autopubArray['trigger'] == 'ajax') {
|
if (isset($autopubArray['trigger']) && $autopubArray['trigger'] == 'ajax') {
|
||||||
emLoadJQuery();
|
emLoadJQuery();
|
||||||
addAction('index_footer', 'autopubAjax');
|
addAction('index_footer', 'autopubAjax');
|
||||||
addAction('adm_footer', 'autopubAjax');
|
addAction('adm_footer', 'autopubAjaxAdmin');
|
||||||
} else if (isset($autopubArray['trigger']) && $autopubArray['trigger'] == 'php') {
|
} else if (isset($autopubArray['trigger']) && $autopubArray['trigger'] == 'php') {
|
||||||
addAction('adm_footer', 'autopubPhp');
|
addAction('adm_footer', 'autopubPhp');
|
||||||
}
|
}
|
||||||
@@ -57,4 +60,3 @@ function autopub_menu() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addAction('adm_sidebar_ext', 'autopub_menu');
|
addAction('adm_sidebar_ext', 'autopub_menu');
|
||||||
?>
|
|
||||||
@@ -3,11 +3,12 @@
|
|||||||
* 自动发布插件
|
* 自动发布插件
|
||||||
* @copyright (c) xiaosong.org All Rights Reserved
|
* @copyright (c) xiaosong.org All Rights Reserved
|
||||||
*/
|
*/
|
||||||
!defined('EMLOG_ROOT') && exit('access deined!');
|
@set_time_limit(0);
|
||||||
|
require_once('../../../init.php');
|
||||||
|
|
||||||
$isAjax = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strstr($_SERVER['HTTP_X_REQUESTED_WITH'], 'XMLHttpRequest')) ? 1 : 0;
|
$isAjax = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strstr($_SERVER['HTTP_X_REQUESTED_WITH'], 'XMLHttpRequest')) ? 1 : 0;
|
||||||
if ($isAjax) {
|
if ($isAjax) {
|
||||||
doPub();
|
doPub();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
emDirect(BLOG_URL);
|
emDirect(BLOG_URL);
|
||||||
?>
|
|
||||||
@@ -29,5 +29,3 @@ function callback_init(){
|
|||||||
$CACHE = Cache::getInstance();
|
$CACHE = Cache::getInstance();
|
||||||
$CACHE->updateCache('options');
|
$CACHE->updateCache('options');
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -5,10 +5,8 @@
|
|||||||
*/
|
*/
|
||||||
ignore_user_abort(true);
|
ignore_user_abort(true);
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
if (!defined('EMLOG_ROOT')) {
|
|
||||||
require_once('../../../init.php');
|
require_once('../../../init.php');
|
||||||
}
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
@@ -17,5 +15,3 @@ do {
|
|||||||
doPub();
|
doPub();
|
||||||
sleep(30);
|
sleep(30);
|
||||||
} while (true);
|
} while (true);
|
||||||
|
|
||||||
?>
|
|
||||||
Reference in New Issue
Block a user