diff options
| author | BigCoke233 <hi@guhub.cn> | 2020-07-30 23:49:46 +0800 |
|---|---|---|
| committer | BigCoke233 <hi@guhub.cn> | 2020-07-30 23:49:46 +0800 |
| commit | 52ab9c1909f39c8854e8235cddd351ef72505e91 (patch) | |
| tree | 0d8de56dc167919197d9567578430c106e996c1e /libs/Comments.php | |
| parent | 23c8e8fed64c5995101cc9ceb08706d8849b0a3c (diff) | |
:fire: Del: 移除旧版本所有文件,准备 2.0 版本
Diffstat (limited to 'libs/Comments.php')
| -rw-r--r-- | libs/Comments.php | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/libs/Comments.php b/libs/Comments.php deleted file mode 100644 index 1e4cb7e..0000000 --- a/libs/Comments.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * Comments.php - * 评论处理 - * - * Author: Eltrac(BigCoke233) - * License: MIT - */ -if (!defined('__TYPECHO_ROOT_DIR__')) exit; -class Comments -{ - /** - * 评论反垃圾 - * from ohmyga233/castle-Typecho-Theme - * - * @access public - */ - public static function AntiSpam($id, $value) { - echo '<!--<nocompress>-->'; - echo '<script>(function(){var a=document.addEventListener?{add:"addEventListener",focus:"focus",load:"DOMContentLoaded"}:{add:"attachEvent",focus:"onfocus",load:"onload"};var c,d,e,f,b=document.getElementById("'.$id.'");null!=b&&(c=b.getElementsByTagName("form"),c.length>0&&(d=c[0],e=d.getElementsByTagName("textarea")[0],f=!1,null!=e&&"text"==e.name&&e[a.add](a.focus,function(){if(!f){var a=document.createElement("input");a.type="hidden",a.name="_",d.appendChild(a),f=!0,a.value='.$value.'}})))})();</script>'; - echo '<!--</nocompress>-->'; - } - - /** - * 获取上级评论人 - */ - public static function getCommentHF($coid){ - $db = Typecho_Db::get(); - $prow = $db->fetchRow($db->select('parent') - ->from('table.comments') - ->where('coid = ? AND status = ?', $coid, 'approved')); - $parent = $prow['parent']; - if ($parent != "0") { - $arow = $db->fetchRow($db->select('text','author','status') - ->from('table.comments') - ->where('coid = ?', $parent)); - $author = $arow['author']; - $status = $arow['status']; - if($author){ - if($status=='approved'){ - $href = '<a class="at" uid="'.$parent.'" href="#li-comment-'.$parent.'">@'.$author.'</a>';; - }else if($status=='waiting'){ - $href = '<a>评论审核中···</a>'; - } - } - echo $href; - } else { - echo ""; - } - } -} |
