新聞中心
如何使Z-blog的評論顯示別名
作者 / 無憂主機(jī) 時間 2015-07-30 22:45:17
在網(wǎng)絡(luò)中暢游,我們經(jīng)常遇到被盜號的風(fēng)險,又分為各種各樣的盜號,有些高手能在您評論別人的回復(fù)的時候看到您的帳號名,然后強(qiáng)行破解登錄密碼。更有可惡的使用您的賬戶發(fā)表一些不好的言論,嚴(yán)重的導(dǎo)致網(wǎng)站封你的號。那么該怎么解決?如何才能夠隱藏自己真實(shí)的用戶名呢?今天小編在這兒介紹關(guān)于一下在php空間中,Z-blog的別名顯示的方法。 申明:此方法僅適用于Z-blog的php版本。 具體方法如下: 一、找到模版目錄下comment.php文件: 二、找到以下代碼:
<span?class="dot">{$key+1}#</span><a?href="{$comment.Author.HomePage}"?rel="nofollow"?target="_blank">{$comment.Author.Name}</a>??<span>{$comment.Time()}?<a?href="#comment"?onclick="RevertComment('{$comment.ID}')">回復(fù)</a></span> 修改為:
{if $comment.Author.Email==$article.Author.Email} <span class="dot">{$key+1}#</span>{$comment.Author.Alias}??<span>{$comment.Time()}?<a href="#comment" onclick="RevertComment('{$comment.ID}')">回復(fù)</a></span> </div> {else} <span class="dot">{$key+1}#</span><a href="{$comment.Author.HomePage}" rel="nofollow" target="_blank">{$comment.Author.Name}</a>??<span>{$comment.Time()}?<a href="#comment" onclick="RevertComment('{$comment.ID}')">回復(fù)</a></span> </div> <div class="msgarticle">{$comment.Content} {foreach $comment.Comments as $comment} {template:comment} {/foreach} </div> {/if} 三、保存。原理是增加了一個判斷,如果評論者的郵箱與文章作者的郵箱相同,那么就顯現(xiàn)別名,如不是就顯示用戶名。
{if $comment.Author.Email==$article.Author.Email} 以上方法是小編測試的,但不一定適合所有版本,如過有更好的方法,歡迎大家發(fā)出來和大家共享。無憂主機(jī)相關(guān)文章推薦閱讀: ZBLOG如何添加百度分享 無憂主機(jī)教程:ZBLOG2.2如何實(shí)現(xiàn)首頁顯示指定的分類 ZBLOG遷移報錯:E_ERROR:CALL TO UNDEFIND FUNTION SQLITE_OPEN()
本文地址:http://m.love62.cn/zblog/19827.html
![1](/wp-content/themes/starow_z/img/o-1.png)
![1](/wp-content/themes/starow_z/img/o-2.png)
![1](/wp-content/themes/starow_z/img/o-3.png)
![1](/wp-content/themes/starow_z/img/o-4.png)
![1](/wp-content/themes/starow_z/img/o-5.png)
![1](/wp-content/themes/starow_z/img/o-6.png)
![1](/wp-content/themes/starow_z/img/o-7.png)