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