Typecho has no plug-in to implement visible replies

First, find the template of the article display page. The default is the post.php file

 <? php $this->content(); ?>

We find the code on the article display page template and replace it with:

 <? php $db = Typecho_Db::get(); $ sql = $db->select()->from('table.comments') ->where('cid = ?',$this->cid) ->where('mail = ?', $this->remember('mail',true)) ->limit(1); $ result = $db->fetchAll($sql);  If ($this ->user ->hasLogin() | | $result) {$content=preg_replace ("/ [hide ] (. *?)  [/hide ]/sm", '<div class="reply2view">$1</div>', $this ->content);} else {$content=preg_replace ("/ [hide ] (. *?)  [/hide ]/sm", '<div class="reply2view">The content here needs comments and replies Read.</div>', $this ->content);} echo $content?>

First, add css style

 .reply2view { background:#f8f8f8; padding:10px 10px 10px 40px; position:relative } .reply2view i { display:block;  font-size:20px; height:20px; left:10px; line-height:20px; position:absolute; top:15px;}

Third, how to use

 [# hide] Throw the content to be hidden here [/hide]

If we normally publish content without doing anything, if we need to hide content, we can hide it with tags according to the above method, and delete the # Do Not.

I referred to an article called Lao Jiang.