这是要替换的代码
<?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">此处内容需要评论回复后方可阅读。</div>',$this->content);
}
echo $content;
?>
替换模板 post.php 中的
使用方法, 在写文章需要隐藏部分内容时用以下写法
为了让隐藏内容更加美观,我们需要对其设置css样式,放在主题文件夹中的css文件中
.reply2view {
background:#f8f8f8;
padding:10px 10px 10px 40px;
position:relative
}
]]>/.lantern/bin/lantern: error while loading shared libraries: libappindicator3.so.1: cannot open shared object file: No such file or directory
尝试:
# apt-cache search libappindicator3
gir1.2-appindicator3-0.1 - Typelib files for libappindicator3-1
<span style="margin: 0px; padding: 0px;">libappindicator3-1</span> - allow applications to export a menu into the panel -- GTK3 version
libappindicator3-dev - allow applications to export a menu into the panel -- GTK3 development
安装 apt-get install libappindicator3-1
结果:
可以愉快的玩耍了