From 08e6e289626620abd5dea49c0485fa80dc011e79 Mon Sep 17 00:00:00 2001 From: BigCoke233 Date: Wed, 15 Jul 2020 00:18:04 +0800 Subject: =?UTF-8?q?:poop:=20Add:=20=E5=88=9D=E6=AD=A5=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E5=A4=9A=E8=AF=AD=E8=A8=80=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=20hint.css=20=E6=B7=BB=E5=8A=A0=20tooltip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/Contents.php | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'libs/Contents.php') diff --git a/libs/Contents.php b/libs/Contents.php index bad09a9..da7d321 100644 --- a/libs/Contents.php +++ b/libs/Contents.php @@ -246,17 +246,8 @@ class Contents static private $CurrentTocID = 0; static public function parseHeaderCallback($matchs) { - // 增加单独标记,否则冲突 - $id = $matchs[3]; - $id = str_replace(' ','_',$id); - $id = str_replace('&','_',$id); - $id = str_replace('?','_',$id); - $id = str_replace("'",'_',$id); - $id = str_replace('"','_',$id); - $id = str_replace('’','_',$id); - $id = str_replace('“','_',$id); - $id = str_replace('?','_',$id); - return ''.$matchs[3].''; + $id = trim($matchs[3]); + return ''.$matchs[3].''; } /* == 其他内容 == */ @@ -377,6 +368,19 @@ class Contents Typecho_Cookie::set('extend_contents_views', $views); //记录查看cookie } } - echo $row['views']; + return $row['views']; + } + + /** + * 获取最早文章创建时间 + */ + public static function getOldestPostDate() { + $db = Typecho_Db::get(); + $content = $db->fetchRow($db->select()->from('table.contents') + ->where('table.contents.status = ?', 'publish') + ->where('table.contents.password IS NULL') + ->order('table.contents.created', Typecho_Db::SORT_ASC) + ->limit(1)); + return date('Y-m-d', $content['created']); } } \ No newline at end of file -- cgit v1.2.3