ACG模板3.6.0版本问题回复不显示编辑器BUG解决方案

kprimo
kprimo 这家伙很懒,还没有设置简介

0 人点赞了该文章 · 1989 浏览

已知3.6.0版本ACG模板存在问题回复无法正常加载编辑器BUG


修复前:




修复后:


  

修复方法:  


1.打开\views\acg\question\index.tpl.htm,找到<!-- 回复编辑器 -->,在下方找到:


<p align="center"><?php _e('该问题目前已经被锁定, 无法添加新回复'); ?>


加上:

<script type="text/javascript" charset="utf-8" src="<?PHP echo base_url();?>/plugins/wc_editor/static/wangeditor/release/wangEditor.js"></script>
<script type="text/javascript" charset="utf-8" src="<?PHP echo base_url();?>/plugins/wc_editor/static/wangeditor/release/wangEditor.js"></script>
<script type="text/javascript" charset="utf-8" src="<?PHP echo base_url();?>/plugins/wc_editor/static/wangeditor/release/wangEditorExt.js"></script>
<script type="text/javascript" src="<?PHP echo base_url();?>/plugins/wc_editor/static/wangeditor/plugin/attach/plugin.js"></script>


2.继续往下找到:


<?php } else if ($this->user_answered) { ?>


在下方加上:

<script type="text/javascript" charset="utf-8" src="<?PHP echo base_url();?>/plugins/wc_editor/static/wangeditor/release/wangEditor.js"></script>
<script type="text/javascript" charset="utf-8" src="<?PHP echo base_url();?>/plugins/wc_editor/static/wangeditor/release/wangEditor.js"></script>
<script type="text/javascript" charset="utf-8" src="<?PHP echo base_url();?>/plugins/wc_editor/static/wangeditor/release/wangEditorExt.js"></script>
<script type="text/javascript" src="<?PHP echo base_url();?>/plugins/wc_editor/static/wangeditor/plugin/attach/plugin.js"></script>


3.往下找到:


<div>
<?php if(get_hook_config('editor')['type']['value']=='ueditor'):?>
<script id="wmd-input" name="answer_content" type="text/plain"><?php echo html_entity_decode($this->draft_content['message']); ?></script>
<?php else:?>
<textarea id="wmd-input" rows="15" name="answer_content"><?php echo html_entity_decode($this->draft_content['message']); ?></textarea>
<?php endif;?>
</div>


替换为:

<div>
<?php if($this->user_id && !$this->question_info['lock'] && ((get_setting('answer_self_question') != 'N') || ($this->user_id != $this->question_info['published_uid']))){
run_hook('editor',['name'=>'answer_content','cat'=>'answer','attach_access_key'=>$this->attach_access_key,'value'=>html_entity_decode($this->draft_content['message'])]);
} ?>
</div>


4.继续往下,找到:


<div>
<?php if(get_setting('draft_enabled')!='Y'){ ?>
<a id="draft" style="margin-right: 20px;"><?php _e('保存草稿'); ?>
<?php } ?>
<span id="answer_content_message"> </span>
</div>


替换为:


<div>
<?php run_hook('page_publish_footer_hook',['page'=>'question_answer','question_info'=>$this->question_info]);?>
<?php if(get_setting('enable_preview')=='Y') { ?>
<a id="preview" href="javascript:;" style="margin-left: 15px"><?php _e('实时预览'); ?>
<?php } ?>
<?php if(get_setting('draft_enabled')!='N'){ ?>
<a id="saveDraft" style="margin-right: 20px;"><?php _e('保存草稿'); ?>
<?php } ?>
<span id="answer_content_message"> </span>
</div>

发布于 2020-09-28 10:16

免责声明:

本文由 kprimo 原创发布于 WeCenter ,著作权归作者所有。

登录一下,更多精彩内容等你发现,贡献精彩回答,参与评论互动

登录! 还没有账号?去注册

暂无评论