2009年04月 存档

ez4.1的module

2009年04月30日,星期四

在module.ini中[ModuleSettings]添加ModuleList[]

(ModuleList[]=modulename)

template不被cache

2009年04月30日,星期四

{set-block scope=global variable=cache_ttl}0{/set-block}

eZURLWilcard做URL跳转

2009年04月28日,星期二

前段时间做的一个项目,先把代码放这:

I used eZURLWilcard to do this.

eZURLWilcard would create and store two php files in the /var/ezwebin_site/cache/wildcard/

I edited them, to redirect to the URL we wanted, and changed the permissions(755) to protect them.

The content of the two files is:

wildcard_04edd92347361aea4ba9f8857b265e72_0.php

function eZURLWilcardCachedTranslate( $wildcardNum, &$uri, &$wildcardInfo, $matches )
{
switch ( $wildcardNum )
{
case 0:
{
$nodeID = eZURLAliasML::fetchNodeIDByPath( “Users/HVAF-Members/” . $matches[1] ); //e.g fetchNodeIDByPath(’/About/Company’)
//$contentNode = eZContentObjectTreeNode::fetch( $nodeID );
$params=array(’Limit’=>’1′,
‘ClassFilterType’=>’include’,
‘ClassFilterArray’=>array(’gallery_basic’, ‘gallery_standard’, ‘gallery_extended’));
$nodes = eZContentObjectTreeNode::subTreeByNodeID($params,$nodeID);
$uri=$nodes[0]->attribute(’url’);
//$uri = “Users/HVAF-Members/” . $matches[1] . “/” . $matches[2] . “”;
$wildcardInfo = array( ‘id’ => ‘6′,
’source_url’ => ‘*/gallery’,
‘destination_url’ => ‘Users/HVAF-Members/{1}/{2}’,
‘type’ => ‘2′ );
} break;
};
}

wildcard_04edd92347361aea4ba9f8857b265e72_index.php

function eZURLWilcardCachedReqexpArray()
{
$wildcards = array(
“#^(.*)/gallery#”
);
return $wildcards;
}

XMLBOCK中添加
换行

2009年04月28日,星期二

按住shift+enter。
有个问题:想连续几个换行,但总不成功。解决办法:输入一个空格,然后shift+enter,就可以了

RemoveSiteAccessIfDefaultAccess

2009年04月28日,星期二

site.ini中,[SiteAccessSettings]设置

# Wheter to add siteaccess to the url if current siteaccess
# is the same as default siteaccess. Changing this setting will
# require clearing the cache.
#
# For instance if the default siteaccess is ‘en’ and you enable
# this you can access the siteacccess with ‘index.php’ instead of
# ‘index.php/en/’.
RemoveSiteAccessIfDefaultAccess=disabled

XAMPP:Can’t change between php4 and php5

2009年04月23日,星期四

Changing to php5:

..:# /opt/lampp/lampp php5
XAMPP: Sorry, but I’m unable to activate PHP 5.2.1.

to php4:
..:# /opt/lampp/lampp php4
XAMPP: Sorry, but I’m unable to activate PHP 4.4.6.

Because:
lampp script trying to call an older version of php4 and php5.

Fix:
edit lampp script.
at line 480 and 484 – Change to the right php versions. (4.4.7. and 5.2.3 used in xampp 1.6.3)

学习的几个误区及对策

2009年04月22日,星期三

原创!
1、东西太多无从下手=》东西多这是事实,只能安下心来,扎实的打好基础,这就是下手的地方
2、不知道学什么,不知道要做什么=》跟上面的问题差不多,还是迷失,做实例
3、实例一看就会,看看就行了吧=》最好动手
4、动手了,但是要自己做还是没想法=》多做,多看,把以前的艺术细胞激活
5、学够了,太痛苦=》半途而废没意义
6、以后到底做什么?=》如果没有基础,谈不上以后
7、有没有捷径?=》当初画了多少页纸?
8、我有伟大的理想与灿烂的明天=》还是再睡会吧

Google实验室推出相似图片搜索服务

2009年04月21日,星期二

http://cnbeta.com/articles/82366.htm

今日Google实验室也推出了类似图片搜索服务,而这个服务也跟许多Google好玩的服务一样,仅仅是Google的雇员们利于那著名的20%时间制作出来的,具体效果怎么样?你自己来试试吧。

访问:Google实验室类似图片搜索

输入一个关键词后,例如“Great Wall”,返回的页面里面点击某个图片的下面的Similar images,才是真正运用到了Google 类似图片搜索功能。

4.1 user subscription fatal error

2009年04月16日,星期四

when i try to subscribe as new user with user/register i obtain a
<code>PHP Fatal error: Call to a member function attribute() on a non-object in /ez/web/dev.visionova.it/kernel/classes/datatypes/eztext/eztexttype.php on line 99</code>
the problem is due to $classAttribute var that is declared inside if, just put the
<code>$classAttribute = $contentObjectAttribute->contentClassAttribute();</code>
few lines above.

http://issues.ez.no/IssueView.php?Id=14741&activeItem=2

把XMLBLOCK中的内容提取出来(转换成textblock)

2009年04月15日,星期三

因为PHP已经提供了strip_tags函数,可以创建一个template.ini.append.php,加入:PHPOperatorList[strip_tags]=strip_tags

然后通过$your_text|strip_tags()来调用就可以了。

关于strip_tags:

strip_tags

去掉 HTML 及 PHP 的标记。

语法: string strip_tags(string str);

返回值: 字符串

函数种类: 资料处理

内容说明

本函数可去掉字符串中包含的任何 HTML 及 PHP 的标记字符串。若是字符串的 HTML 及 PHP 标签原来就有错,例如少了大于的符号,则也会返回错误。而本函数和 fgetss() 有着相同的功能。