hack文件: includes/joomla.php
503行段:
function setPageTitle( $title=null ) {
if (@$GLOBALS['mosConfig_pagetitles']) {
$title = trim( htmlspecialchars( $title ) );
$title = stripslashes($title);
$this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title :
$GLOBALS['mosConfig_sitename'];
}
}里面的
$this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title :
替换为:
$this->_head['title'] = $title ? $title . " - ". $GLOBALS['mosConfig_sitename'] :
当然上面的 $this一整行也可以直接写为:
$this->_head['title'] = $title . " - ". $GLOBALS['mosConfig_sitename'];
我的joomla.php里改的:
if ($title == '首页') {
$this->_head['title'] = $GLOBALS['mosConfig_sitename'];
}else {
$this->_head['title'] = $title . " - ". $GLOBALS['mosConfig_sitename'];
}
}
}其实是一样,只是在首页的时候,首页不显示而已.
针对 meta 里的 name="description" 做一下改动!
默认是 "你站点的描述+本页文章的标题" 如果你的描述多的话,这样有点不利!
方法 function appendMetaTag 段里:
$this->_head['meta'][$i][1] = $content .', '. $this->_head['meta'][$i][1];
改为:
$this->_head['meta'][$i][1] = $this->_head['meta'][$i][1] .', '.$content ;
end by Autoit.
| 10 | 访客 @ 2008-03-11 18:18:37 : |
| joomla 1.013貌似没法这样干 |
| 9 | gypsy @ 2007-04-28 06:39:56 : |
| 我用的台湾1.0.12版,按第一种方法替换为$this->_head['title'] = $title ? $title . " - ". $GLOBALS['mosConfig_sitename'] :后,页面打不开,报第507行就是修改的这段代码出错,还好,第二种方法修改代码为$this->_head['title'] = $title . " - ". $GLOBALS['mosConfig_sitename'];后一切正常,真受教了,等于说把文章的关键字和文章描述,都提到了全站布局里的关键字和站点描述前面,高!实在是高! |
| 8 | Asia@Asiaing @ 2007-03-03 07:35:07 : |
| 学习了,Done. |
| 7 | cnhack @ 2006-11-20 12:31:17 : |
| 使用中! 谢谢!!! |
| 6 | 访客 @ 2006-10-19 02:37:07 : |
| 不错的说! |
| 5 | Autoit @ 2006-10-03 11:13:13 : to baijianpeng |
不会的吧. 我刚在他svn里看了下,还是和以前一样... 并没有我下面的修改 |
| 4 | baijianpeng @ 2006-10-03 10:39:38 : |
| 呵呵,这个功能在 Joomla 1.0.11 中文版中已经默认打开,代码与此相同。 |
| 3 | 访客 @ 2006-08-30 17:08:55 : |
| 好东西.不错. 谢谢分享 !!! |
| 2 | yacZ @ 2006-08-28 23:28:24 : |
| thanks ! |
| 1 | 访客 @ 2006-08-08 17:17:12 : |
谢谢 !!! 找了好久才在这里找到... |
Only registered users can write comments.
Please login or register.
hack文件: includes/joomla.php
503行段:
function setPageTitle( $title=null ) {
if (@$GLOBALS['mosConfig_pagetitles']) {
$title = trim( htmlspecialchars( $title ) );
$title = stripslashes($title);
$this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title :
$GLOBALS['mosConfig_sitename'];
}
}里面的
$this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title :
替换为:
$this->_head['title'] = $title ? $title . " - ". $GLOBALS['mosConfig_sitename'] :
当然上面的 $this一整行也可以直接写为:
$this->_head['title'] = $title . " - ". $GLOBALS['mosConfig_sitename'];
我的joomla.php里改的:
if ($title == '首页') {
$this->_head['title'] = $GLOBALS['mosConfig_sitename'];
}else {
$this->_head['title'] = $title . " - ". $GLOBALS['mosConfig_sitename'];
}
}
}其实是一样,只是在首页的时候,首页不显示而已.
针对 meta 里的 name="description" 做一下改动!
默认是 "你站点的描述+本页文章的标题" 如果你的描述多的话,这样有点不利!
方法 function appendMetaTag 段里:
$this->_head['meta'][$i][1] = $content .', '. $this->_head['meta'][$i][1];
改为:
$this->_head['meta'][$i][1] = $this->_head['meta'][$i][1] .', '.$content ;
end by Autoit.
Permanent URL:
http://www.autoit.cn/index.php/content/view/68/25.html
Only registered users can write comments.
Please login or register.