commit 7d64d938fdae983d8834efca1fb2be1c3b7f7ff6 Author: 小松 Date: Mon Oct 15 17:01:16 2012 +0800 1.9版 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..412eeda --- /dev/null +++ b/.gitattributes @@ -0,0 +1,22 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ebd21a --- /dev/null +++ b/.gitignore @@ -0,0 +1,163 @@ +################# +## Eclipse +################# + +*.pydevproject +.project +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results +[Dd]ebug/ +[Rr]elease/ +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.vspscc +.builds +*.dotCover + +## TODO: If you have NuGet Package Restore enabled, uncomment this +#packages/ + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf + +# Visual Studio profiler +*.psess +*.vsp + +# ReSharper is a .NET coding add-in +_ReSharper* + +# Installshield output folder +[Ee]xpress + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish + +# Others +[Bb]in +[Oo]bj +sql +TestResults +*.Cache +ClientBin +stylecop.* +~$* +*.dbmdl +Generated_Code #added for RIA/Silverlight projects + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML + + + +############ +## Windows +############ + +# Windows image file caches +Thumbs.db + +# Folder config file +Desktop.ini + + +############# +## Python +############# + +*.py[co] + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg + +# Mac crap +.DS_Store diff --git a/autopub.php b/autopub.php new file mode 100644 index 0000000..0c3798b --- /dev/null +++ b/autopub.php @@ -0,0 +1,40 @@ +$(function(){$.get("'.DYNAMIC_BLOGURL.'?plugin=autopub");})'."\n"; +} + +if (!dir_is_empty(AUTOPUB_CACHE_DIR)) { + addAction('index_footer', 'autopub'); + addAction('adm_footer', 'autopub'); +} + +function autopub_menu() { + echo '
自动发布
'; +} + +addAction('adm_sidebar_ext', 'autopub_menu'); +?> \ No newline at end of file diff --git a/autopub_setting.php b/autopub_setting.php new file mode 100644 index 0000000..d41a05a --- /dev/null +++ b/autopub_setting.php @@ -0,0 +1,75 @@ +query($sql); + $i = 1; + while($row = $DB->fetch_array($result)){ + if(file_exists(AUTOPUB_CACHE_DIR.$row['gid'].'.php')){ + include_once(AUTOPUB_CACHE_DIR.$row['gid'].'.php'); + }else{ + $year = $month = $day = $hour = $minute = $second = ''; + } + $output .= '

'; + $output .= $i.'、'.$row['title'].'  '; + $output .= '预发布时间:秒  '; + $output .= '

'; + $i++; + } + if(empty($output)){ + $output = '

暂无待发布日志!请将待发布日志保存为草稿!

'; + } + echo $output; +} +?> + +
自动发布 +插件设置完成 +插件设置失败,请填写合理日期!年月日必填 +
+
+
+ +
+"; + $file = AUTOPUB_CACHE_DIR.$gid.'.php'; + if($year != 0 && $month != 0 && $day != 0){ + @ $fp = fopen($file, 'wb') OR emMsg('读取文件失败,如果您使用的是Unix/Linux主机,请修改/content/plugins/autopub/cache/目录的权限为777。如果您使用的是Windows主机,请联系管理员,将该文件设为everyone可写'); + @ $fw = fwrite($fp,$data) OR emMsg('写入文件失败,如果您使用的是Unix/Linux主机,请修改/content/plugins/autopub/cache/目录的权限为777。如果您使用的是Windows主机,请联系管理员,将该文件设为everyone可写'); + fclose($fp); + }else{ + return false; + } +} +} \ No newline at end of file diff --git a/autopub_show.php b/autopub_show.php new file mode 100644 index 0000000..3e2ed6b --- /dev/null +++ b/autopub_show.php @@ -0,0 +1,22 @@ +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'); + } + } +} +?> \ No newline at end of file