Support jOOmla! Autoit!
 
在joomla中加入上下篇的标题 输出PDF 打印 E-mail
Author Author: gbloog | Date Date:2006-06-18 | View Count View: 10710 | Digg Count Digg: 56

本文介绍了通过修改joomla中的文件来实现加入上下篇标题的方法。适用于joomla1.0.x版本。 修改components\com_content\content.php文件找到

   $query = "SELECT a.id"
   . "\n FROM #__content AS a"
   . "\n WHERE a.catid = $row->catid"
   . "\n AND a.state = $row->state"
   . ($access->canEdit ? '' : "\n AND a.access <= $gid" )
   . $xwhere
   . "\n ORDER BY $orderby"
   ;
   $database->setQuery( $query );
   $list = $database->loadResultArray();

在后面加入语句,作用是加入标题

$query = "SELECT a.title"
. "\n FROM #__content AS a"
. "\n WHERE a.catid = $row->catid"
. "\n AND a.state = $row->state"
. ($access->canEdit ? '' : "\n AND a.access <= $gid" )
. $xwhere
 
. "\n ORDER BY $orderby";
$database->setQuery( $query );
$list1 = $database->loadResultArray();

继续找到

   if ( $location - 1 >= 0 ) {
   // the previous content item cannot be in the array position -1
    $row->prev = $list[$location - 1];
   }
   if ( ( $location + 1 ) < count( $list ) ) {
   // the next content item cannot be in an array position greater than the number of array postions
    $row->next = $list[$location + 1];
   }

加入两句就成这样

   if ( $location - 1 >= 0 ) {
   // the previous content item cannot be in the array position -1
    $row->prev = $list[$location - 1];
    $row->prevtitle=$list1[$location - 1];//加入
}
   if ( ( $location + 1 ) < count( $list ) ) {
   // the next content item cannot be in an array position greater than the number of array postions
    $row->next = $list[$location + 1];
       $row->nexttitle=$list1[$location + 1];//加入
   }

到此这个文件修改完毕 再修改content.html.php文件找到这两句

        <?php echo  _ITEM_PREVIOUS; ?>
       ...
       <?php echo _ITEM_NEXT; ?>

改成:

        <?php echo $row->prevtitle . _ITEM_PREVIOUS;  ?>
       ...
       <?php echo _ITEM_NEXT.$row->nexttitle; ?>

 

完成.本人试用不错,故转来[转载于http://joom.org.ru/]

Permanent URL: http://www.autoit.cn/index.php/content/view/41/25.html

Shares: Google书签 Yahoo书签 雅虎收藏夹 365Key网摘 新浪ViVi 百度收藏 天极网摘 diglog 和讯网摘 POCO网摘 YouNote网摘 博拉网 天下图摘 spurl blogmarks BlinkList reddit digg Del.icio.us   |  Tags: 标题  

 
将评分投票bot改造成现在流行用的 “顶”   mambo常用模块功能及说明