Differences between revisions 13 and 14
Revision 13 as of 2007-09-10 12:00:53
Size: 4318
Editor: dyn176154
Comment:
Revision 14 as of 2007-09-10 12:02:17
Size: 4446
Editor: dyn176154
Comment:
Deletions are marked like this. Additions are marked like this.
Line 19: Line 19:
 * in /administrator/includes/admin.php:  * solution: trim all slashes at the end of the path whenever "mkdir" is called. A new function trimEndingSlashes($base) is added, in /administrator/includes/admin.php:

TableOfContents

Components

Joomla

Full menu too short in the backend

  • /administrator/modules/mod_fullmenu.php, to changge the number of the items in the top level menus at the backend. Change $topLevelLimit = 19; to $topLevelLimit = 30;

Component installation failure due to ending slashes

  • solution: trim all slashes at the end of the path whenever "mkdir" is called. A new function trimEndingSlashes($base) is added, in /administrator/includes/admin.php:

/**
* @param string An existing base path
* @param string A path to create from the base path
* @param int Directory permissions
* @return boolean True if successful
*/
function mosMakePath($base, $path='', $mode = NULL) {
        global $mosConfig_dirperms;

        // convert windows paths
        $path = str_replace( '\\', '/', $path );
        $path = str_replace( '//', '/', $path );

        // check if dir exists
        if (file_exists( $base . $path )) return true;

        // set mode
        $origmask = NULL;
        if (isset($mode)) {
                $origmask = @umask(0);
        } else {
                if ($mosConfig_dirperms=='') {
                        // rely on umask
                        $mode = 0777;
                } else {
                        $origmask = @umask(0);
                        $mode = octdec($mosConfig_dirperms);
                } // if
        } // if

        $parts = explode( '/', $path );
        $n = count( $parts );
        $ret = true;
        if ($n < 1) {
                if (substr( $base, -1, 1 ) == '/') {
                        $base = substr( $base, 0, -1 );
                }
                $ret = @mkdir(trimEndingSlashes($base), $mode);
        } else {
                $path = $base;
                for ($i = 0; $i < $n; $i++) {
                        $path .= $parts[$i] . '/';
                        if (!file_exists( $path )) {
                                if (!@mkdir(trimEndingSlashes(substr($path,0,-1)),$mode)) {
                                        $ret = false;
                                        break;
                                }
                        }
                }
        }
        if (isset($origmask)) {
                @umask($origmask);
        }

        return $ret;
}

function trimEndingSlashes($base){
                if (substr( $base, -1, 1 ) == '/') {
                        return substr( $base, 0, -1 );
                } else {
                        return $base;
                }

}

Live bookmarks problem (Firefox 1.5, Joomla 1.0.7)

  • Problem does not exist any more. strange.

  • Problem: firefox shows "live bookmarks feed failed to laod" when add the frontpage as live bookmark.
  • Reason: the links in the feed is not full url.
  • Solution: in /components/com_rss/rss.php, change line 222

    $item->link             = $item_link;

    to

    $item->link             = $mosConfig_live_site.$item_link;

UTF-8 feeds

将Joomla!修改为UTF-8编码之后,发现新闻聚合导出(如rss 0.91 , rss 1.0 , rss 2.0 , atom , opml 等)中文字符为乱码显示。

该问题产生的原因是虽然在语言文件设置了变量DEFINE('_ISO','charset=utf-8');,但新闻聚合模块COM_RSS页面硬编码为iso-8859-1(西欧编码)。

解决方法为: 1、将/modules目录下的mod_rssfeed.xml的第一行 <?xml version="1.0" encoding="iso-8859-1"?> 更改为 <?xml version="1.0" encoding="UTF-8"?> ,同时将该文件转为UTF-8格式。 2、最重要:将/includes/feedcreator.class.php的第514行、 var $encoding = "UTF-8"; 改为 var $encoding = "UTF-8"; 3、

ps1:新闻聚合模块涉及到的文件如下: 1、/modules目录下的mod_rssfeed.xml和mod_rssfeed.php 2、/components/com_rss/rss.php 3、/includes/feedcreator.class.php

ps2:/includes/feedcreator.class.php第1181-1184行有如下函数

  • function MBOXCreator() {
    • $this->contentType = "text/plain"; $this->encoding = "ISO-8859-15";

    }

暂时不知何用。

Tooltip color

  • problem: red tooltip. want it to be blue.
  • file: /includes/js/overlib_mini.js
  • change ol_fgcolor to #fafafa
  • change ol_bgcolor to #0066cc

  • Problem: when using a centered template, the print view also centralize the paragraphs.
  • /index2.php
  • around line 144, change

            <body class="contentpane">
                    <?php mosMainBody(); ?>
            </body>

    to

            <body class="contentpane"><div id="maxwidthiehack">
                    <?php mosMainBody(); ?>
            </div></body>

    where

    div#maxwidthiehack {
       text-align       : left;
       width:expression(document.body.clientWidth > 960? "960px": "auto" );
    }
    should be placed in the site template css file, or integrated into index2.php.

"Written by" should be "Published by"

  • language files should be revised accordingly.

JunHu: JunHu/Memo/JoomlaTipsAndTricks (last edited 2008-10-03 20:19:42 by localhost)