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过 ...
随机推荐
- AWD攻防赛之各类漏洞FIX方案
笔者<Qftm>原文发布<FreeBuf>:https://www.freebuf.com/articles/web/208778.html
- 使用Spring CROS解决项目中的跨域问题
CROS(Cross-Origin Resource Sharing) 用于解决浏览器中跨域请求的问题.简单的Get请求可以使用JSONP来解决,而对于其它复杂的请求则需要后端应用的支持CROS.Sp ...
- Redis的5中数据类型及应用场景
Redis的全称是Remote Dictionary Server,本质上是一个Key-Value类型的内存数据库,整个数据库统统加载在内存当中进行操作,定期通过异步操作把数据库数据Flush到硬盘行 ...
- SpringMVC笔记1
SpringMVC是一个一种基于Java的实现MVC设计模型的请求驱动类型的轻量级web框架 SpringMVC的入门案例 2.导入相关jar包 <?xml version="1.0& ...
- maven打包spring boot项目及跳过test文件
打包命令 mvn clean package // 会先清理现有的target目录 or mvn package 跳过测试文件 1. idea全局配置 右侧maven会取消test选项 2. 命令行附 ...
- quartz2.3.0(四)JobDataMap—带状态集合的定时器内置集合
任务类 package org.quartz.examples.example4; import java.util.Date; import org.quartz.DisallowConcurren ...
- backpropagation algorithm
搞卷积神经网络的时候突然发现自己不清楚神经网络怎么训练了,满脸黑线,借此机会复习一下把. 首先放一位知乎大佬的解释.https://www.zhihu.com/question/27239198?rf ...
- Disruptor与Netty实现百万级(十)
实体对象: import java.io.Serializable; public class TranslatorData implements Serializable { private sta ...
- JavaJDK多任务执行框架(六)
class Temp extends Thread { public void run() { System.out.println("run"); } } public clas ...
- 使用activiti的designer插件记录
1.activiti添加排他网,条件下载condition中 2.activiti添加监听Listener,知道3种方法 1.实现taskListener 通过加载java class的方式去加载实现 ...