Repair wecenter Mobile Home description describes the same problem

   Due to user requirements, wecenter description Mobile Home description as well, so write in this tutorial, we hope to help you!

  

Modification method

Open app / m / main.php

TPL::output('m/question');

  

Add this line of code in front

TPL::set_meta('keywords', implode(',', $this->model('system')->analysis_keyword($question_info['question_content'])));
TPL::set_meta('description', $question_info['question_content'] . ' - ' . cjk_substr(str_replace("\r\n", ' ', strip_tags($question_info['question_detail'])), 0, 128, 'UTF-8', '...'));

  

The article describes repair

 

TPL::output('m/article');

  Add this line of code in front

  

TPL::set_meta('keywords', implode(',', $this->model('system')->analysis_keyword($article_info['title'])));
TPL::set_meta('description', $article_info['title'] . ' - ' . cjk_substr(str_replace("\r\n", ' ', strip_tags($article_info['message'])), 0, 128, 'UTF-8', '...'));

  

Repair topic description

 

TPL::output('m/topic');

  Add this line of code in front

$related_topics_ids = array();
        $page_keywords[] = $topic_info['topic_title'];
        if ($related_topics = $this->model('topic')->related_topics($topic_info['topic_id']))
        {
            foreach ($related_topics AS $key => $val)
            {
                $related_topics_ids[$val['topic_id']] = $val['topic_id'];
                $page_keywords[] = $val['topic_title'];
            }
        }
        TPL::set_meta('keywords', implode(',', $page_keywords));
        TPL::set_meta('description', cjk_substr(str_replace("\r\n", ' ', strip_tags($topic_info['topic_description'])), 0, 128, 'UTF-8', '...'));

  

Guess you like

Origin www.cnblogs.com/68xi/p/11521076.html