現在很多使用織夢系統的用戶都去掉了織夢的評論功能,但是有些老用戶還保留著一些原始的織夢評論模板功能,但是又想在原來的織夢評論功能模塊上增加一個能讓游客自行輸入昵稱的小功能。
這個是武林網小編在論壇里看到的,很多朋友都在問怎樣才能使游客可以對文章進行評論,并且游客可以輸入自己的名字,而不是顯示游客,在評論后又怎樣跳轉回正在瀏覽的DEDECMS織夢內容頁面。
針對以上情況,織夢模板網給出如下的解決辦法,大家一起來看看吧。
首先找到dede默認模板里的article_article.htm文件,找出其中的
<div class="comment"> <!--評論:標題--> <div class="commenttitle"> <div class="title"><strong>最新評論</strong>共有 {dede:field name='postnum'/} 位網友發表了評論 </div> <div class="gotopost"><a href="{dede:field name='phpurl'/}/feedback.php?arcID={dede:field name=ID/}">查看所有評論</a></div> </div> <!--評論內容--> <div class="commentbox"> <script src="{dede:field name='phpurl'/}/feedback_js.php?arcID={dede:field name='ID'/}"></script> </div> <!--發表評論:標題--> <div class="posttitle"><strong>發表評論</strong></div> <!--發表評論--> <form action="{dede:field name='phpurl'/}/feedback.php?action=send" method="post" name="feedback"> <input type="hidden" name="arcID" value="{dede:field name="id"/}"> <div class="postbox"> <div class="txtbox"> <strong>評論內容:</strong>不能超過250字,需審核,請自覺遵守互聯網相關政策法規。 <textarea name="msg" cols="60" rows="6"></textarea> </div> <div class="userbox"> <dl> <dd> <strong>用戶名:</strong><input name="username" class="username" type="text" maxlength="20" /> <strong>密碼:</strong><input name="pwd" class="password" type="password" maxlength="20" /> </dd> <dd></dd> <dd class="mtop"><input name="notuser" type="checkbox" value="1" /> <strong>匿名?</strong></dd> <dd><input name="sb" type="button" class="submit" value="發表評論" onClick='javascript:if(document.feedback.msg.value!="") document.feedback.submit(); else alert("評論內容不能為空!");'/> </dd> <dd class="mtop"><a href="{dede:field name='memberurl'/}/index_do.php?fmdo=user&dopost=regnew" target="_blank">注冊</a></dd> </dl> </div> </div></form> </div> </div>以上的這段代碼,其實就是評論那一塊的所有代碼,有些朋友沒有找到,那就說明你的織夢模板放棄了原始的評論模塊了。
然后找到以上代碼中的
<strong>密碼:</strong><input name="pwd" class="password" type="password" maxlength="20" />
然后刪除。找到
<strong>匿名?</strong>
然后刪除。找到
<input name="notuser" type="checkbox" value="1" />
然后更改為
<input name="notuser" type="hidden" value="1" />
最后提交保存,OK了,大功告成!
新聞熱點
疑難解答