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

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: 问题  

7 Autoit @ 2007-04-27 10:10:23 : to 4 楼
这些就是 1.0.12 出的bug 吧, 日后版本应该会更新的.
6 访客 @ 2007-04-27 09:47:13 :
有bugs怎么不会理会,作为一个开发人员,出现bugs,然后解决bugs是非常开心的事情了,难道这些也是官方版本存在的bugs?
5 Autoit @ 2007-04-26 22:31:58 : to 4 楼
joomla.org.TW 是不理会这些的, 因为他们做是按官方给的版本来做的.
4 访客 @ 2007-04-26 20:37:56 :
这些bug怎么不发布给台湾joomla的eddy,这样出新版本的时候bugs会少点
3 Autoit @ 2007-03-28 00:17:28 : to july
:p very thanks ! 
 
等抽时间整理上去.
2 july @ 2007-03-27 15:24:54 : 添砖加瓦
呵呵 也跟一篇 
 
在1.0.12里 ,建立 "List - Content Section"类型菜单,设置 “Empty Categories in Section”时,得不到预期效果:将空的Category也显示出来 
 
这主要是由于SQL语句的Left Join 造成的,Left Join没有匹配的,会自动赋值为NULL(b.access 字段), 
最后SQL语句执行时为 数值和NULL 的比较。解决的办法如下: 
 
components\com_content 目录下 content.php 326行 
 
$access_check_content = "\n AND b.access
1 访客 @ 2007-03-19 14:29:34 :
我正好用这个版本,多谢AUTOIT!

Only registered users can write comments.
Please login or register.

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