From 375a141cf65d0f2078027147b50362a0bb8bc11a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=BE?= Date: Thu, 18 Oct 2012 14:47:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E4=B9=9F=E5=8F=AF=E8=A7=A6=E5=8F=91=E5=8F=91=E5=B8=83=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E7=9A=84=E5=8A=A8=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- autopub.php | 4 ++-- autopub_show.php | 44 +++++++++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/autopub.php b/autopub.php index d705840..8fdda57 100644 --- a/autopub.php +++ b/autopub.php @@ -1,7 +1,7 @@ $(function(){$.get("'.DYNAMIC_BLOGURL.'?plugin=autopub");})'."\n"; + echo ''."\n"; } if (!dir_is_empty(AUTOPUB_CACHE_DIR)) { diff --git a/autopub_show.php b/autopub_show.php index 3e2ed6b..bc781e0 100644 --- a/autopub_show.php +++ b/autopub_show.php @@ -1,22 +1,24 @@ -query($sql); -while($row = $DB->fetch_array($result)){ - if(file_exists(AUTOPUB_CACHE_DIR.$row['gid'].'.php')){ - include_once(AUTOPUB_CACHE_DIR.$row['gid'].'.php'); - $pub_time = emStrtotime($year.'-'.$month.'-'.$day.' '.$hour.':'.$minute.':'.$second); - if(time() > $pub_time){ - $sql_do = "UPDATE ".DB_PREFIX."blog SET hide = 'n',date = '".$pub_time."' WHERE gid='".$row['gid']."'"; - $DB->query($sql_do); - $CACHE->updateCache(); - doAction('save_log', $row['gid']); - unlink(AUTOPUB_CACHE_DIR.$row['gid'].'.php'); - } - } -} +query($sql); +while($row = $DB->fetch_array($result)){ + if(file_exists(AUTOPUB_CACHE_DIR.$row['gid'].'.php')){ + include_once(AUTOPUB_CACHE_DIR.$row['gid'].'.php'); + $pub_time = emStrtotime($year.'-'.$month.'-'.$day.' '.$hour.':'.$minute.':'.$second); + $autopubCopyRight = '

(此文通过emlog自动发布插件发布)

'; + $content = $row['content'].$autopubCopyRight; + if(time() > $pub_time){ + $sql_do = "UPDATE ".DB_PREFIX."blog SET hide = 'n',date = '".$pub_time."',content = '".$content."' WHERE gid='".$row['gid']."'"; + $DB->query($sql_do); + $CACHE->updateCache(); + doAction('save_log', $row['gid']); + unlink(AUTOPUB_CACHE_DIR.$row['gid'].'.php'); + } + } +} ?> \ No newline at end of file