Support jOOmla! Autoit!
关注 Joomla 的页面 meta 标签 输出PDF 打印 E-mail
Author Author: Autoit | Date Date:2007-01-15 | View Count View: 11321 | Digg Count Digg: 57

meta是在文档中模拟HTTP协议的响应头报文。meta 标签用于网页的<head>与</head>中, meta 的属性有两种:name和http-equiv。name属性主要用于描述网页,对应于content(网页内容),以便于搜索引擎机器人查找、分类(目前几乎所有的搜索引擎都使用网上机器人自动查找meta值来给网页分类)。这其中最重要的是description(站点在搜索引擎上的描述)和keywords(分类关键词), 而默认的joomal却都是固定相同的.那么你想关注你joomla网站的以下标签吗?

<title></title>
<meta name="title" content="" />
<meta name="author" content="" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="Generator" content="" />
<meta name="robots" content="index, follow" />
......

如果你想简单使用, 可以看看 Joomla SEF Patch  :  http://www.autoit.cn/forum/?thread-579-1-1.html

相应版本都有下载链接. [如果使用记得备份]

你还可以看看这里: http://www.autoit.cn/index.php/content/view/68/25.html

其他: 让description及keywords更完善等hack及使用规则视情况整理.

 
让com_banner支持flash输出的hack 输出PDF 打印 E-mail
Author Author: Autoit | Date Date:2007-01-05 | View Count View: 22211 | Digg Count Digg: 2708

其实com_banner本身支持flash的banner输出.只是在joomla本身上未定义 swf 格式而已.

在joomla.php 里

搜索:

bmp|gif|jpg|png

替换为:

bmp|gif|jpg|png|swf

 然后将 里的:

                } else if (eregi("\.swf$", $banner->imageurl)) {
                        $imageurl         = "$mosConfig_live_site/images/banners/".$banner->imageurl;
                        echo "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" border=\"5\">
                                        <param name=\"movie\" value=\"$imageurl\"><embed src=\"$imageurl\" loop=\"false\" pluginspage=\"http://www.macromedia.com/go/get/flashplayer\" type=\"application/x-shockwave-flash\"></embed></object>";
                }
        }

替换为:

} else if (eregi("\.swf$", $banner->imageurl)) {
                        $imageurl         = "$mosConfig_live_site/images/banners/".$banner->imageurl;
            $getflashinfo = @getimagesize( $imageurl );
 
                       echo "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab\#version=6,0,0,0\" border=\"5\" width=\"".$getflashinfo[0]."\"  height=\"".$getflashinfo[1]."\">
                        <param name=\"movie\" value=\"$imageurl\">
                        <embed src=\"$imageurl\" loop=\"false\" pluginspage=\"http://www.macromedia.com/go/get/flashplayer\" type=\"application/x-shockwave-flash\"  width=\"".$getflashinfo[0]."\"  height=\"".$getflashinfo[1]."\">
                        </embed></object>";
                }
                                }

[这个替换是增加flash的高与宽]就可以了,如果你需要定义 flash 上输出后台里写的 url 的话, 就把上面段直接替换为:

} else if (eregi("\.swf$", $banner->imageurl)) {
                        $imageurl         = "$mosConfig_live_site/images/banners/".$banner->imageurl;
            $link = sefRelToAbs( 'index.php?option=com_banners&task=click&bid='. $banner->bid );
            $getflashinfo = @getimagesize( $imageurl );
 
                        echo "<button  title=\"Advertisement\"  style=\"border: 0; padding:0; background: none transparent scroll repeat 0 0; width:".$getflashinfo[0]."; height:".$getflashinfo[1]."; cursor: hand; \" onclick=\"window.location.href='".$link."'\">
                        <object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab\#version=6,0,0,0\" border=\"5\" width=\"".$getflashinfo[0]."\"  height=\"".$getflashinfo[1]."\">
                       \ <param name=\"movie\" value=\"$imageurl\">  <param name=\"wmode" value="transparent\">
 
                        <embed src=\"$imageurl\" loop=\"false\" pluginspage=\"http://www.macromedia.com/go/get/flashplayer\" type=\"application/x-shockwave-flash\"  width=\"".$getflashinfo[0]."\"  height=\"".$getflashinfo[1]."\">
                        </embed></object></button>";
                }
                                }

在论坛里答网友并测试后整理过来的. End. by Autoit.

 

 
pre中自动换行的问题 输出PDF 打印 E-mail
Author Author: Autoit | Date Date:2007-01-02 | View Count View: 17890 | Digg Count Digg: 80

本站文章中使用了 pre 格式输出 代码。 而浏览器默认是强制不换行输出 pre 里的内容。这样的话,代码一长就出现了撑到页面外部的样子。在之前我都是有意的在代码里强制换行... 累啊. 今天有意的google了下,找到了:

pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}

经测试,除IE[当前使用6]外, 其他可以.... 郁闷,然后增加 width:600px; 后,ok,.换行了,其实位置还是衍生出去了。样子是这样的: 代码是在里面了,但下面的叙述性的东西却出了去。在说,定义一个这个宽度也不是个好的方法,其他的不直接改这个css的方法基本没有了。

然后看上面css想到, 为什么定义其他的都用 white-space 而定义 IE 的不使用呢? 又不是IE 不支持。。于是加上就可以了[翻了google的前5页, 没找到一个改css解决的...汗]。

 pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
white-space : normal ;       /* Internet Explorer 5.5+ */
}

至于本站上使用的是把ie和其他的分开了,因为white-space 在最后也都作用于其他了....

pre {
 white-space: pre-wrap;       /* css-3 */
 white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
 white-space: -pre-wrap;      /* Opera 4-6 */
 white-space: -o-pre-wrap;    /* Opera 7 */
}
* html pre {
 word-wrap: break-word;       /* Internet Explorer 5.5+ */
 white-space : normal ;       /* Internet Explorer 5.5+ */
}

End. by Autoit.

 
在最新文章模块标题右侧加 more 的推荐方法! 输出PDF 打印 E-mail
Author Author: Autoit | Date Date:2007-01-01 | View Count View: 28341 | Digg Count Digg: 121

之前的 "另类的模块标题右侧加"更多"链接" 一文, 方法比较简陋. 到J1.0.12的话,也要改系统文件, 所以就产生了这种方法.

乘新年之际写出来送给大家。祝大家在新的一年里一切顺意,心想事成!

1, 在mod_latestnews.xml里结尾处的

 </params>

 上行加

 <param name="diymore" type="text" size="60" default="" label="DIY More URL" description="DIY More URL by Autoit!" />

2, 将mod_latestnews.php里的

 <ul class="latestnews<?php echo $moduleclass_sfx; ?>">

替换为:

 <?php if ($module->showtitle == 0) {?>
<h3><?php if ($diymore !="") echo '<a href="'.$diymore.'">More...</a>' ?><?php echo $module->title ; ?></h3>
<?php }?>
 
 <ul class="latestnews<?php echo $moduleclass_sfx; ?>">

$nullDate  = $database->getNullDate();

下面增加下面一行:

$diymore  = trim( $params->get( 'diymore' ) );

3,在你使用的模板里 template_css.css 的最后增加:

div.module h3 a,  div.moduletable h3 a {
 float:right;
 text-decoration:none;
 color:#1B57B1;
 padding-right:20px;
}

如果你模板还是 table 的话,可能还要把上面的 div.module h3 a,  div.moduletable h3 a 改变为: div.module h3 a,  div.moduletable h3 a, table.moduletable th a

Ok , end !

 

使用注意:


1,如果要显示more的话, 模块设置里的 Show title [显示标题] 选 否[No]
2,如果你这个模块设置里有使用 Module Class Suffix 的话,上面第三步要的css名字要做适当调整,假如你在后台Module Class Suffix设置为 -blank , 那么上面css的名称地方应该就是 div.module-blank h3 a,  div.moduletable-blank h3 a

其实其他任何想加 more 的都可以这样做的。。。By  Autoit!

 
最新文章模块条目后面增加new或图片 输出PDF 打印 E-mail
Author Author: Autoit | Date Date:2006-12-27 | View Count View: 12842 | Digg Count Digg: 65

本文以 " 最新文章模块增加发布时间的hack " 为基础hack的. 来实现 "一周内最新文章"的标题后面增加一个 New! 的文字或图片.

主要是依据时间戳的差值来判断的. 方法: 在上篇文章里增加的

<small><?php echo $row->created; ?></small>

后面增加:

<?php if ((abs(strtotime ($now) - strtotime ($row->created))/86400) < 7) 
echo " <sup style='color:#FF0000; cursor:hand;' title='一周内最新文章'>New!</sup>";
 ?>

就可以了.

如果需要24小时,把上面的7换为1就可以了. 如果和上面一样有中文字出现,那么你修改的这个文档就要保存为 utf-8 格式. 

如果需要把 New! 文字换为你的一个小new的图片. 就改上面 echo 里面的了.大概这个样子, 当然,如果不想显示日期的话,<small>...</small> 句就可以不要了.

echo "<img src='.....'>";

End. by Autoit.

 
« First « 1 2 3 4 5 6 7 8 9 10 » Last »

21 - 25 / 109