Support jOOmla! Autoit!
 
joomla 1.0.12 问题集 输出PDF 打印 E-mail
Author Author: Autoit | Date Date:2007-03-12 | View Count View: 20164 | Digg Count Digg: 85

1: 在首页上, 文章里的阅读更多出现 Itemid 错误的问题

方法: 编辑  components/com_content/content.html.php

约400行左右

$_Itemid = $Itemid;

替换为:

$_Itemid = $mainframe->getItemid( $rows[$i]->id, 0, 0  );

约556行左右

$row->_Itemid = $Itemid;

替换为:

if ( $task != 'view' && $task != 'category' ) {
     $row->_Itemid = $mainframe->getItemid( $row->id, 0, 0 );
} else {
     $row->_Itemid = $Itemid;
}

2: [评论里2楼的 july 提供 ]建立 "List - Content Section"类型菜单,设置 “Empty Categories in Section”时,得不到预期效果:将空的Category也显示出来 这主要是由于SQL语句的Left Join 造成的,Left Join没有匹配的,会自动赋值为NULL(b.access 字段), 最后SQL语句执行时为 数值和NULL 的比较。解决的办法如下:  

components/com_content/content.php [~344行 ]

$access_check_content = "\n AND b.access <= " . (int) $gid;

替换为:

$access_check_content   = "\n AND ( b.access <= " . (int) $gid ." OR b.access is null)";

3: 后台增加菜单时, 查询次数上千次问题的解决方法:

/administrator/components/com_menus/content_item_link.class.php

将:

 $query = "SELECT a.id AS value, a.title AS text, a.sectionid, a.catid "
. "\n FROM #__content AS a"
. "\n INNER JOIN #__categories AS c ON a.catid = c.id"
. "\n INNER JOIN #__sections AS s ON a.sectionid = s.id"
. "\n WHERE a.state = 1"
. "\n ORDER BY a.sectionid, a.catid, a.title"
;
$database->setQuery( $query );
$contents = $database->loadObjectList( );
 
foreach ( $contents as $content ) {
$query = "SELECT s.title"
. "\n FROM #__sections AS s"
. "\n WHERE s.scope = 'content'"
. "\n AND s.id = " . (int) $content->sectionid
;
$database->setQuery( $query );
$section = $database->loadResult();
 
$query = "SELECT c.title"
. "\n FROM #__categories AS c"
. "\n WHERE c.id = " . (int) $content->catid
;
$database->setQuery( $query );
$category = $database->loadResult();
 
$value = $content->value;
$text = $section ." - ". $category ." / ". $content->text ."&nbsp;&nbsp;&nbsp;&nbsp;";
 
$temp[] = mosHTML::makeOption( $value, $text );
$contents = $temp;
}

替换为:

$query = 'SELECT a.id AS value, CONCAT(s.title, \' - \',c.title,\' / \',a.title, \'&nbsp;&nbsp;&nbsp;&nbsp;\') AS text
  FROM #__content AS a
  INNER JOIN #__categories AS c ON a.catid = c.id
  INNER JOIN #__sections AS s ON a.sectionid = s.id AND s.scope = \'content\'
  WHERE a.state = 1
  ORDER BY a.sectionid, a.catid, a.title';
$database->setQuery($query);
$contents = $database->loadObjectList();

4:两个未过滤的标题的地方:

/components/com_content/content.html.php [~607, 614行]

搜:

<?php echo $row->title;?>

替换为:

<?php echo htmlentities($row->title);?>

5:...

 

 


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

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

« First « 1 2 » Last »
 
单元页面罗列出所有分类的最新10个条目   补遗: 随心所欲的自定义joomla模板的方法