|
不装组件也让你的文章显示出关键字来--[1]
|
|
|
|
Author: Autoit | Date:2006-07-31 | View: 15924 | Digg: 64 |
|
在编辑文章的时候,meta 参数里有关键字项, 那么为什么不直接把他提取出来呢? 修改方法: components/com_content/content.php 1330行下面[或$params = new mosParameters( $row->attribs );上行]加 //以下加上是为了获取tags
$links = '';
$keys = explode( ',', $row->metakey );
foreach ($keys as $key) {
$key = trim( $key );
if ($key) {
$link="index.php?option=com_search&searchphrase=all&ordering=newest&searchword=";
$link.=rawurlencode($key);
$links.="<a href='".$link."'>".$key."</a> ";
}
}
if ($links!=""){
$row->fulltext.="<div align='right' style='background-color:#efefef';>Tags: ". $links ."</div>";
}
//结束 在你编辑文章的时候,如果是多个关键字就用英文半角的逗号,分开就可以了。当然你有写这个的话,那么默认有的“相关文章” 模块也就有内容的了!
Permanent URL: http://www.autoit.cn/index.php/content/view/64/25.html
|
| « First « 1 2 » Last » |