zoukankan      html  css  js  c++  java
  • 修复wecenter移动版description首页描述一样问题

       因网友要求,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("
    ", ' ', 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("
    ", ' ', 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("
    ", ' ', strip_tags($topic_info['topic_description'])), 0, 128, 'UTF-8', '...'));
    

      

  • 相关阅读:
    你爱的不爱你,转身是幸福
    按字节长度截取字符串(支持截取带HTML代码样式的字符串)
    存储过程操作类
    C# 拖动控件
    文件同步类
    c# 动态改变控件大小的方法
    虚拟世界改变现实 盛大兴建永恒之塔
    c#百钱买百鸡
    序列化类
    DLL专题之MFC规则库和扩展库
  • 原文地址:https://www.cnblogs.com/68xi/p/11521076.html
Copyright © 2011-2022 走看看