标签:pre his bsp 问题 strip out page 添加 set
因网友要求,wecenter移动版description首页描述一样,所以在此写个教程,希望帮助大家!
打开app/m/main.php
TPL::output(‘m/question‘);
在这行代码前面添加
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‘, ‘...‘));
TPL::output(‘m/article‘);
在这行代码前面添加
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‘, ‘...‘));
TPL::output(‘m/topic‘);
在这行代码前面添加
$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‘, ‘...‘));
修复wecenter移动版description首页描述一样问题
标签:pre his bsp 问题 strip out page 添加 set
原文地址:https://www.cnblogs.com/68xi/p/11521076.html