ppypp伦理天堂,91手机在线视频,免费在线观看黄色毛片,夜夜穞天天穞狠狠穞AV美女按摩

聯系官方銷售客服

1835022288

028-61286886

投訴 已解決 評論內容不能為空,請問怎么解決 11 0
迅睿CMS版本:4.5.2

評論內容不能為空,請問怎么解決

show.html 使用的 問答插件復制過來的評論方式,然后看到論壇有回答說替換以下代碼

<?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))
                        ]);
                        ?>

不知道怎么替換為 textarea

解決方案
  •             <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>

    此代碼在回復的時候提示評論內容不能為空

  • 復制過來沒效果,因為問到插件,他要寫個專門的擦肩控制器里面才有這個轉換的代碼,評論他就有專門的阿賈克斯提交函數。

  • 回復@官方插件技術-武科文

    我已經加了Article/Models/Content.php 文件

    <?php namespace Phpcmf\Model\Article;
    
    // 模塊內容模型類
    
    class Content extends \Phpcmf\Model\Content {
    
        // 格式化顯示內容,用于前端內容詳情頁面的格式化
        public function _call_show($data) {
    
            $cache = \Phpcmf\Service::L('cache')->get('app-comment-'.SITE_ID, 'module', MOD_DIR);
            if (!$cache) {
                return $data;
            } elseif (!$cache['use']) {
                return $data;
            }
    
            if (!isset($cache['order']) || !$cache['order']) {
                $cache['order'] = 'inputtime desc';
            }
    
            $page = max(1, (int)\Phpcmf\Service::L('input')->get('page'));
    
            if (IS_API_HTTP) {
                $pagesize = (int)$cache['pagesize_api'];
            } elseif (\Phpcmf\Service::IS_MOBILE()) {
                $pagesize = (int)$cache['pagesize_mobile'];
            } else {
                $pagesize = (int)$cache['pagesize'];
            }
            !$pagesize && $pagesize = 10;
    
            // 查詢數據
            list($list, $total) = $this->get_comment_result($data['id'], $cache['order'], $page, $pagesize, 0, $cache['field']);
    
            $data['comment_list'] = $list;
            $data['comment_pages'] = $this->_get_pages(\Phpcmf\Service::L('Router')->show_url(\Phpcmf\Service::C()->module, $data, '{page}'), $total, $pagesize);
            $data['comment_cache'] = $cache;
    
            return $data;
        }
    
        /**
         * 評論ajax分頁 方便二次開發和重寫
         */
        protected function _get_pages($url, $total, $pagesize) {
    
            $config = [];
    
            $file = 'config/page/'.(\Phpcmf\Service::IS_PC() ? 'pc' : 'mobile').'/ajax.php';
            if (is_file(WEBPATH.$file)) {
                $config = require WEBPATH.$file;
            } elseif (is_file(ROOTPATH.$file)) {
                $config = require ROOTPATH.$file;
            } else {
                $config['next_link'] = '>';
                $config['prev_link'] = '<';
                $config['last_link'] = '>|';
                $config['first_link'] = '|<';
                $config['cur_tag_open'] = '<a class="ds-current">';
                $config['cur_tag_close'] = '</a>';
            }
    
            $config['base_url'] = $url;
            $config['per_page'] = $pagesize;
            $config['total_rows'] = $total;
            $config['use_page_numbers'] = TRUE;
            $config['query_string_segment'] = 'page';
    
            return \Phpcmf\Service::L('Page')->initialize($config)->create_links();
        }
    
        public function author_url($uid) {
    
            $urlrule = \Phpcmf\Service::C()->get_cache('module-'.SITE_ID.'-article', 'setting', 'param', 'user', 'urlrule');
            if ($urlrule) {
                return dr_url_prefix(str_replace('{id}', $uid, $urlrule), 'article');
            }
    
            return '/index.php?s=article&c=user&uid='.$uid;
        }
    
        public function cache($siteid = SITE_ID) {
    
            $table = $this->prefix.$siteid.'_article_comment';
            if ($this->db->tableExists($table)) {
                if (!$this->db->fieldExists('zuijiadaan', $table)) {
                    $this->query_all('ALTER TABLE `{dbprefix}'.SITE_ID.'_article_comment` ADD `zuijiadaan` INT(10) NULL;');
                }
                // 遺漏的字段
                if (!$this->table('field')->where('relatedname', 'comment-module-article')->where('fieldname','zuijiadaan')->counts()) {
                    $this->query_sql('INSERT INTO `{dbprefix}field` (`id`, `name`, `fieldname`, `fieldtype`, `relatedid`, `relatedname`, `isedit`, `ismain`, `issystem`, `ismember`, `issearch`, `disabled`, `setting`, `displayorder`) VALUES
        (null, \'最佳答案\', \'zuijiadaan\', \'Text\', 0, \'comment-module-article\', 1, 1, 0, 0, 0, 0, \'{"option":{"fieldtype":"","fieldlength":"","value":"","width":"","css":""},"validate":{"required":"0","pattern":"","errortips":"","check":"","filter":"","formattr":"","tips":""},"is_right":"0"}\', 0);
        ');
                }
            }
        }
    }
  • 建議查一查comment的控制器文件,只是建議,因為評論插件沒有你這種的功能,需要二次開發,比如問答插件就是基于評論的二次開發

  • 回復@官方插件技術-武科文 算了 我問東 你回答西

  • 從頭到尾 沒一句話等于回答

    滿意答案
  • 可以參考4樓的思路,我剛剛做過這種編輯框的評論界面

  • 4樓上是完美答案啊,改comment才可以提交編輯器內容

  • 你改content沒有用的,官方說了提交需要改comment文件