destoon修改搜索页面标题方法
最近研究destoon内核开发,发现destoon6.0的搜索页面模块的标题太长,是搜索标题+模块+首页标题,这样导致标题过长,百度不喜欢,所以我经过修改成百度所喜欢的。
修改前截图:

修改的文件:/include/seo.inc.php 文件
在第90行左右,把$seo_title 修改为:$seo_sitename 这样就精简了
完整代码:
<?php
defined('IN_DESTOON') or exit('Access Denied');
$seo_modulename = $MOD['name'];
$seo_sitename = $city_sitename ? $city_sitename : $DT['sitename'];
$seo_sitetitle = $DT['seo_title'];
$seo_sitekeywords = $DT['seo_keywords'];
$seo_sitedescription = $DT['seo_description'];
$seo_delimiter = $DT['seo_delimiter'];
$seo_page = $page > 1 ? lang($L['seo_page'], array($page)).$seo_delimiter : '';
$seo_catname = $seo_cattitle = $seo_parentname = $seo_catkeywords = $seo_catdescription = '';
if($catid) {
if($CAT['parentid']) {
$seo_catname = '';
$tmp = strip_tags(cat_pos($CAT, 'DESTOON'));
$tmp = explode('DESTOON', $tmp);
$tmp = array_reverse($tmp);
foreach($tmp as $k=>$v) {
$seo_catname .= $v.$seo_delimiter;
}
} else {
$seo_catname = $CAT['catname'].$seo_delimiter;
}
$seo_cattitle = $CAT['seo_title'] ? $CAT['seo_title'].$seo_delimiter : $seo_catname;
$seo_catkeywords = $CAT['seo_keywords'] ? $CAT['seo_keywords'] : '';
$seo_catdescription = $CAT['seo_description'] ? $CAT['seo_description'] : '';
}
$seo_areaname = (isset($areaid) && $areaid) ? area_pos($areaid, $seo_delimiter).$seo_delimiter : '';
$seo_showtitle = isset($title) ? $title : '';
$seo_showintroduce = isset($introduce) ? $introduce : '';
switch($seo_file) {
case 'index':
if($MOD['title_index']) {
eval("\$seo_title = \"$MOD[title_index]\";");
} else {
$seo_title = $seo_modulename.$seo_delimiter.$seo_sitename;
}
if($MOD['keywords_index']) eval("\$head_keywords = \"$MOD[keywords_index]\";");
if($MOD['description_index']) eval("\$head_description = \"$MOD[description_index]\";");
break;
case 'list':
if($CAT['seo_title']) {
$seo_title = $CAT['seo_title'];
} else if($MOD['title_list']) {
eval("\$seo_title = \"$MOD[title_list]\";");
} else {
$seo_title = $seo_cattitle.$seo_page.$seo_modulename.$seo_delimiter.$seo_sitename;
}
$_seo_catname = $seo_catname;
$_seo_areaname = $seo_areaname;
if($CAT['seo_keywords']) {
$head_keywords = $CAT['seo_keywords'];
} else if($MOD['keywords_list']) {
if($_seo_catname) $seo_catname = str_replace($seo_delimiter, ',', $_seo_catname);
if($_seo_areaname) $seo_areaname = str_replace($seo_delimiter, ',', $_seo_areaname);
eval("\$head_keywords = \"$MOD[keywords_list]\";");
}
if($CAT['seo_description']) {
$head_description = $CAT['seo_description'];
} else if($MOD['description_list']) {
if($_seo_catname) $seo_catname = str_replace($seo_delimiter, ' ', $_seo_catname);
if($_seo_areaname) $seo_areaname = str_replace($seo_delimiter, ' ', $_seo_areaname);
eval("\$head_description = \"$MOD[description_list]\";");
}
break;
case 'show':
if($MOD['title_show']) {
eval("\$seo_title = \"$MOD[title_show]\";");
} else {
$seo_title = $seo_showtitle.$seo_delimiter.$seo_catname.$seo_modulename.$seo_delimiter.$seo_sitename;
}
$_seo_catname = $seo_catname;
$_seo_areaname = $seo_areaname;
if($MOD['keywords_show']) {
if($_seo_catname) $seo_catname = str_replace($seo_delimiter, ',', $_seo_catname);
if($_seo_areaname) $seo_areaname = str_replace($seo_delimiter, ',', $_seo_areaname);
eval("\$head_keywords = \"$MOD[keywords_show]\";");
} else {
$head_keywords = $keyword;
}
if($MOD['description_show']) {
if($_seo_catname) $seo_catname = str_replace($seo_delimiter, ' ', $_seo_catname);
if($_seo_areaname) $seo_areaname = str_replace($seo_delimiter, ' ', $_seo_areaname);
eval("\$head_description = \"$MOD[description_show]\";");
} else {
$head_description = $introduce ? $introduce : $title;
}
break;
case 'search':
$seo_title = $seo_modulename.$L['search'].$seo_delimiter.$seo_page.$seo_sitename ;
if($catid) $seo_title = $seo_catname.$seo_title;
if($areaid) $seo_title = $seo_areaname.$seo_title;
if($kw) $seo_title = $kw.$seo_delimiter.$seo_title;
break;
default:
break;
}
?>
这样就是我修改好的:http://zhimo.yuanzhumuban.cc/sell/search-htm-kw-黑龙江圆柱模板.html
destoon修改搜索页面标题方法的更多相关文章
- HTML-获取/修改html页面标题
作为一个标准的HTML文档,网页标题(title)是必不可少的属性.随着浏览器的发展,我们又多了一种访问和修改文档的方式:DOM.所以我们获取网页标题的方式大致可分为以下两种: 通过document对 ...
- django学习-26.admin管理后台里:修改登录页面标题,修改登录框标题,修改首页标题
目录结构 1.前言 2.完整的操作步骤 2.1.第一步:查看[site.py]的源码 2.2.第二步:在应用[hello]所在目录里的[admin.py]里重写三个属性的属性值 2.3.第三步:重启服 ...
- destoon公司搜索页面显示公司类型
首先找到前台模板文件:/template/default/company/search.htm 看到51行 {template 'list-company', 'tag'} 打开 /template/ ...
- 修改jQuery.validate验证方法和提示信息
1.添加验证方法 在jquery.validate.js文件中直接添加验证方法,例如: jQuery.validator.addMethod("Specialstring", fu ...
- 一个简单的修改 iis默认页面的方法..
1. IIS 默认打开的是欢迎页面 2. 然后找到了一个比较简单的修改默认界面的方法: 找到这个文件的默认路径 C:\inetpub\wwwroot 然后修改 iisstart.htm 文件 在hea ...
- 微信小程序动态修改页面标题setNavigationBarTitle
微信小程序是可以动态修改页面标题的. 首先我们来看看静态是怎么实现的 在对应页面的json文件里面加入下面代码就可以实现了 { "navigationBarTitleText": ...
- 小程序动态修改页面标题setNavigationBarTitle
可以使用setNavigationBarTitle方法动态设置页面标题 wx.setNavigationBarTitle({ title: options.name, })
- vue.js 使用 vue-router 修改页面标题
module.exports = { name: 'myComponent', data: {} route{ data: function(){ document.title = "页面标 ...
- SEO页面标题Title的优化
我在一个月前改过页面标题(Title),随后表现是:百度网页快照4天不更新,Google正常.而我仅仅是改了两个词组而已.在建博初期,修改Title的最频繁的时期,下面卢松松就我经历的修改Title过 ...
随机推荐
- WordPress 设计学习
"One can never be defeated until defeat has been accepted as a reality"----- Bruce Lee 官网免 ...
- Spring Boot之从Spring Framework装配掌握SpringBoot自动装配
Spring Framework模式注解 模式注解是一种用于声明在应用中扮演“组件”角色的注解.如 Spring Framework 中的 @Repository 标注在任何类上 ,用于扮演仓储角色的 ...
- python 之 Django框架(Django框架简介、视图装饰器、request对象、Response对象)
12.33 Django框架简介: MVC,全名是Model View Controller,是软件工程中的一种软件架构模式,把软件系统分为三个基本部分:模型(Model).视图(View)和控制器( ...
- python 坑1
目录 1.编码解码 2.基础数据类型补充: 2.1 str: 2.2list: 2.3tuple: 2.4dict: 2.5set: 3.坑 4.类型转换: 5.数据类型: 1.编码解码 编码:将文字 ...
- Keil 5出现Error: L6218E: Undefined symbol解决方法
首先列出网上百度到比较好的blog: blog1:https://blog.csdn.net/super_demo/article/details/32131379 总结了代码中可能因为几种初级或者粗 ...
- shiro源码解析
一.web.xml 文件中配置的 DelegatingFilterProxy 的 <filter-name>为啥与Spring文件中配置的ShiroFilterFactoryBean的Be ...
- 全栈项目|小书架|服务器开发-Koa2 连接MySQL数据库(Navicat+XAMPP)
为什么使用数据库 为什么需要数据库?-知乎 相比与文件系统,数据库具有以下优势: 高效率:查找效率高 高可用:可数据库共享 安全性强:数据不能随意修改 选择哪个数据库 数据库可以分为关系型数据库和非关 ...
- Spring Cloud Alibaba学习笔记(22) - Nacos配置管理
目前业界流行的统一配置管理中心组件有Spring Cloud Config.Spring Cloud Alibaba的Nacos及携程开源的Apollo,本文将介绍Nacos作为统一配置管理中心的使用 ...
- 论文笔记 XGBoost: A Scalable Tree Boosting System
XGBoost是boosting算法的其中一种.Boosting算法的思想是将许多弱分类器集成在一起形成一个强分类器,其更关注与降低基模型的偏差.XGBoost是一种提升树模型(Gradient bo ...
- C#代码常用技巧
1.拼sql语句时,list中元素加单引号并以逗号分开:string.Join(",",list.Select(r=>"'"+r+"'" ...