迅睿CMS框架是一款PHP8高性能·簡單易用的CMS開源開發(fā)框架,基于MIT開源許可協(xié)議發(fā)布,免費且不限制商業(yè)使用,是免費開源的產品,以萬端互聯為設計理念,支持的微信公眾號、小程序、APP客戶端、移動端網站、PC網站等多終端式管理系統(tǒng)。
聯系官方銷售客服
1835022288
028-61286886
默認的內容頁面的評論UI界面在那個模板里面修改?
comment_ajax。html
<div id="dr_module_comment_577"></div><script type="text/javascript"> function dr_ajax_module_comment_577(type, page) { var index = layer.load(2, { time: 10000 });$.ajax({type: "GET", url: "/index.php?s=article&c=comment&m=index&id=577&&type="+type+"&page="+page+"&"+Math.random(), dataType:"jsonp", success: function (data) { layer.close(index); if (data.code) { $("#dr_module_comment_577").html(data.msg); } else { dr_tips(0, data.msg); } }, error: function(HttpRequest, ajaxOptions, thrownError) { layer.closeAll(); var msg = HttpRequest.responseText; alert("評論調用函數返回錯誤:"+msg); } }); } dr_ajax_module_comment_577(0, 1); </script> </div>
回復@官方插件技術-吳若宇 我的意思是評論直接在內容頁面HTML代碼展現出來,需要怎么做
我的意思是評論直接在內容頁面HTML代碼展現出來,需要怎么做,而不是上面那段代碼
參考wenda插件的show.html寫法代碼
回復@官方插件技術-吳若宇
把官方的 問答插件的 comment_ajax.html 替換到默認模板的 comment_ajax.html 然后show.html 添加以下代碼不顯示已經評論的列表
<div id="commentlist" class="page-content"> <div class="boxedtitle page-title"><h2>回帖 ( <span class="color">{$comments}</span> )</h2></div> <ol class="commentlist clearfix" id="dr_module_comment_{$id}"> {php $ajax_pages=$comment_pages;} {php $list=$comment_list;} {template "comment_ajax.html"} </ol> {if $is_comment != 1} <form action="" method="post" id="myform_comment" class="comment-form"> {dr_form_hidden()} <input type="hidden" name="is_ajax" value="1"> <input type="hidden" name="catid" value="{$catid}"> <div id="respond-textarea"> <?php echo dr_field_form([ 'name' => '內容', 'ismain' => 1, 'fieldtype' => 'Ueditor', 'fieldname' => 'content', 'setting' => array('option' => array( 'mode' => 3, 'height' => 220, 'width' => '100%', 'tool' => IS_PC ? '\'undo\', \'bold\', \'forecolor\',\'simpleupload\', \'attachment\', \'insertimage\', \'insertcode\'' : '\'undo\', \'bold\', \'image\''), 'validate' => array('xss' => 1)) ]); ?> </div> <p class="form-submit" style="margin-top: 10px;"> <button class="color button dark_button medium" id="comment_submit" onclick="dr_post_comment()" type="button">回復帖子</button> </p> </form> {/if} </div>
不顯示已經評論的內容
我查了下,評論插件必須ajax輸出,否則按照wenda插件的偏方處理
問答插件/Wenda/Models/Content.php
這個函數體,放在你模塊的對應這個文件里面(沒有這個文件就自己創(chuàng)建,注意類名稱),然后就可以了模板不用修改,可以把模板的if判斷去掉就顯示表單了
這樣之后展現了評論內容,但是貌似不能展現第3層
回復@苦逼的民工 展現就好比這樣
老老實實用自帶的ajax吧
回復@談笑淡輕云 ajax 蜘蛛識別不了哈,就是想這樣實現半原創(chuàng)呢
問答插件就可以實現的
comment_ajax。html
回復@官方插件技術-吳若宇 我的意思是評論直接在內容頁面HTML代碼展現出來,需要怎么做
我的意思是評論直接在內容頁面HTML代碼展現出來,需要怎么做,而不是上面那段代碼
參考wenda插件的show.html寫法代碼
回復@官方插件技術-吳若宇
把官方的 問答插件的 comment_ajax.html 替換到默認模板的 comment_ajax.html 然后show.html 添加以下代碼不顯示已經評論的列表
不顯示已經評論的內容
我查了下,評論插件必須ajax輸出,否則按照wenda插件的偏方處理
問答插件/Wenda/Models/Content.php
這個函數體,放在你模塊的對應這個文件里面(沒有這個文件就自己創(chuàng)建,注意類名稱),然后就可以了模板不用修改,可以把模板的if判斷去掉就顯示表單了
回復@官方插件技術-吳若宇
這樣之后展現了評論內容,但是貌似不能展現第3層
回復@苦逼的民工 展現就好比這樣
老老實實用自帶的ajax吧
回復@談笑淡輕云 ajax 蜘蛛識別不了哈,就是想這樣實現半原創(chuàng)呢
問答插件就可以實現的