扯淡

安装EZ时站点选择

站点选择的列表从哪儿来的呢?

在package.ini中RemotePackagesIndexURL做了设置,试一下可不可以设定自己的(不从ez.no下载,太慢了)

默认的是RemotePackagesIndexURL=http://packages.ez.no/ezpublish/4.0/4.0.4(不同的版本号)

在该目录下有个index.xml的文件

内容如下:


<?xml version="1.0"?>
<packages vendor="eZ systems">
<package name="ezwebin_banners"
version="1.3-3"
type="contentobject"
summary="Demo content (banners) for the ezwebin extension"
description="This package contains the following nodes :
Banners - subtree"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezwebin_banners.ezpkg"
thumbnail_url="http://packages.ez.no/ezpublish/4.0/4.0.4/thumbnails/ezwebin_banners.png" />
<package name="ezwebin_classes"
version="1.3-3"
type="contentclass"
summary="ezwebin content classes"
description="This package contains definitions of content classes used by the ezwebin extension"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezwebin_classes.ezpkg"
thumbnail_url="http://packages.ez.no/ezpublish/4.0/4.0.4/thumbnails/ezwebin_classes.png" />
<package name="ezwebin_democontent"
version="1.3-3"
type="contentobject"
summary="Home, News and Events, Products, Partner, Community, Knowledge Base, Company"
description="This package contains the following nodes :
Home - subtree
News and Events - subtree
Products - subtree
Partner - subtree
Community - subtree
Knowledge Base - subtree
Company - subtree"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezwebin_democontent.ezpkg"
thumbnail_url="http://packages.ez.no/ezpublish/4.0/4.0.4/thumbnails/ezwebin_democontent.png" />
<package name="ezwebin_design_blue"
version="1.3-3"
type="sitestyle"
summary="eZ Publish Website Interface design (blue)"
description="This site style package contains the design for the Website Interface"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezwebin_design_blue.ezpkg"
thumbnail_url="http://packages.ez.no/ezpublish/4.0/4.0.4/thumbnails/ezwebin_design.png" />
<package name="ezwebin_design_gray"
version="1.3-3"
type="sitestyle"
summary="eZ Publish Website Interface design (gray)"
description="This site style package contains the design for the Website Interface"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezwebin_design_gray.ezpkg"
thumbnail_url="http://packages.ez.no/ezpublish/4.0/4.0.4/thumbnails/ezwebin_design.png" />
<package name="ezwebin_extension"
version="1.3-3"
type="extension"
summary="ezwebin extension"
description="ezwebin extension"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezwebin_extension.ezpkg"
thumbnail_url="http://packages.ez.no/ezpublish/4.0/4.0.4/thumbnails/ezwebin_extension.png" />
<package name="ezwebin_site"
version="1.3-3"
type="site"
summary="Website Interface"
description="Website Interface is a web based CMS solution based on eZ Publish. It contains templates and settings that meets the most common requirements for content management systems."
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezwebin_site.ezpkg"
thumbnail_url="http://packages.ez.no/ezpublish/4.0/4.0.4/thumbnails/ezwebin_site.png">
<requires>
<require name="ezwebin_classes"
min-version="1.3"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezwebin_classes.ezpkg" />
<require name="ezwebin_extension"
min-version="1.3"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezwebin_extension.ezpkg" />
<require name="ezwebin_banners"
min-version="1.3"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezwebin_banners.ezpkg" />
<require name="ezwebin_democontent"
min-version="1.3"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezwebin_democontent.ezpkg" />
<require name="ezwebin_design_blue"
min-version="1.3"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezwebin_design_blue.ezpkg" />
<require name="ezwebin_design_gray"
min-version="1.3"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezwebin_design_gray.ezpkg" />
</requires>
</package>
<package name="ezflow_classes"
version="1.0-4"
type="contentclass"
summary="ezflow content classes"
description="This package contains definitions of content classes used by the ezflow extension"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezflow_classes.ezpkg"
thumbnail_url="http://packages.ez.no/ezpublish/4.0/4.0.4/thumbnails/ezflow_classes.png" />
<package name="ezflow_democontent"
version="1.0-4"
type="contentobject"
summary="Home, Conference, Discussion Forum, Conference Blog, Live Video"
description="This package contains the following nodes:
Home - node
Conference - subtree
Discussion Forum - subtree
Conference Blog - subtree
Live Video - subtree"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezflow_democontent.ezpkg"
thumbnail_url="http://packages.ez.no/ezpublish/4.0/4.0.4/thumbnails/ezflow_democontent.png" />
<package name="ezflow_design"
version="1.0-4"
type="sitestyle"
summary="eZ Flow design"
description="This site style package contains the design for the eZ Flow"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezflow_design.ezpkg"
thumbnail_url="http://packages.ez.no/ezpublish/4.0/4.0.4/thumbnails/ezflow_design.png" />
<package name="ezflow_extension"
version="1.0-4"
type="extension"
summary="ezflow extension"
description="ezflow extension"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezflow_extension.ezpkg"
thumbnail_url="http://packages.ez.no/ezpublish/4.0/4.0.4/thumbnails/ezflow_extension.png" />
<package name="ezflow_site"
version="1.0-4"
type="site"
summary="eZ Flow"
description="The eZ Flow extension to eZ Publish enables editors to build complex page layouts and pre-plan the publication schedule to ensure a constant flow of rich content."
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezflow_site.ezpkg"
thumbnail_url="http://packages.ez.no/ezpublish/4.0/4.0.4/thumbnails/ezflow_site.png">
<requires>
<require name="ezflow_extension"
min-version="1.0"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezflow_extension.ezpkg" />
<require name="ezwebin_extension"
min-version="1.3"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezwebin_extension.ezpkg" />
<require name="ezflow_classes"
min-version="1.0"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezflow_classes.ezpkg" />
<require name="ezflow_democontent"
min-version="1.0"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezflow_democontent.ezpkg" />
<require name="ezflow_design"
min-version="1.0"
url="http://packages.ez.no/ezpublish/4.0/4.0.4/ezflow_design.ezpkg" />
</requires>
</package>
<package name="plain_site"
version="1.1-2"
type="site"
summary="Plain site"
description="Stripped install. Contains no special toolbar or menu choices"
url="http://packages.ez.no/ezpublish/3.8/plain_site.ezpkg"
thumbnail_url="http://packages.ez.no/ezpublish/3.8/thumbnails/plain_site.png" />
</packages>

技术

div 实现长英文字母自动换行CSS

诸如邮件地址太长等……

自动换行问题,正常字符的换行是比较合理的,而连续的数字和英文字符常常将容器撑大,挺让人头疼,下面介绍的是CSS如何实现换行的方法

最佳CSS定义换行代码

.wrap { table-layout:fixed; word-break: break-all; overflow:hidden; }
这里 overflow:hidden;或者 auto;
=================================================================
对于div,p等块级元素
正常文字的换行(亚洲文字和非亚洲文字)元素拥有默认的white-space:normal,当定义的宽度之后自动换行
html
<div id=”wrap”>正常文字的换行(亚洲文字和非亚洲文字)元素拥有默认的white-space:normal,当定义</div>
css
#wrap{white-space:normal; width:200px; }

1.(IE浏览器)连续的英文字符和阿拉伯数字,使用word-wrap : break-word ;或者word-break:break-all;实现强制断行

#wrap{word-break:break-all; width:200px;}
或者
#wrap{word-wrap:break-word; width:200px;}

<div id=”wrap”>abcdefghijklmnabcdefghijklmnabcdefghijklmn111111111</div>

效果:可以实现换行

2.(Firefox浏览器)连续的英文字符和阿拉伯数字的断行,Firefox的所有版本的没有解决这个问题,我们只有让超出边界的字符隐藏或者,给容器添加滚动条
#wrap{word-break:break-all; width:200px; overflow:auto;}

<div id=”wrap”>abcdefghijklmnabcdefghijklmnabcdefghijklmn111111111</div>

效果:容器正常,内容隐藏

对于table
http://www.knowsky.com/
1. (IE浏览器)使用 table-layout:fixed;强制table的宽度,多余内容隐藏

<table style=”table-layout:fixed” width=”200″>
<tr>
<td>abcdefghigklmnopqrstuvwxyz1234567890ssssssssssssss
</td>
</tr>
</table>

效果:隐藏多余内容

2.(IE浏览器)使用 table-layout:fixed;强制table的宽度,内层td,th采用word-break : break-all;或者word-wrap : break-word ;换行

<table width=”200″ style=”table-layout:fixed;”>
<tr>
<td width=”25%” style=”word-break : break-all; “>abcdefghigklmnopqrstuvwxyz 1234567890
</td>
<td style=”word-wrap : break-word ;”>abcdefghigklmnopqrstuvwxyz 1234567890
</td>
</tr>
</table>

效果:可以换行

3. (IE浏览器)在td,th中嵌套div,p等采用上面提到的div,p的换行方法

4.(Firefox浏览器)使用 table-layout:fixed;强制table的宽度,内层td,th采用word-break : break-all;或者word-wrap : break-word ;换行,使用overflow:hidden;隐藏超出内容,这里overflow:auto;无法起作用
<table style=”table-layout:fixed” width=”200″>
<tr>
<td width=”25%” style=”word-break : break-all; overflow:hidden; “>abcdefghigklmnopqrstuvwxyz1234567890</td>
<td width=”75%” style=”word-wrap : break-word; overflow:hidden; “>abcdefghigklmnopqrstuvwxyz1234567890</td>
</tr>
</table>

效果:隐藏多于内容

5.(Firefox浏览器) 在td,th中嵌套div,p等采用上面提到的对付Firefox的方法
运行代码框
最后,这种现象出现的几率很小,但是不能排除网友的恶搞。

下面是提到的例子的效果

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ />
<title>字符换行</title>
<style type=”text/css”>
table,td,th,div { border:1px green solid;}
code { font-family:”Courier New”, Courier, monospace;}
</style>
</head>
<body>
<h1><code>div</code></h1>
<h1><code>All white-space:normal;</code></h1>
<div style=”white-space:normal; width:200px;”>Wordwrap still occurs in a td element that has its WIDTH attribute set to a value smaller than the unwrapped content of the cell, even if the noWrap property is set to true. Therefore, the WIDTH attribute takes precedence over the noWrap property in this scenario</div>

<h1><code>IE \ word-wrap : break-word ;</code></h1>
<div style=”word-wrap : break-word ; width:200px;”>abcdefghijklmnabcdefghijklmnabcdefghijklmn111111111</div>
<h1><code>IE \ word-break:break-all;</code></h1>
<div style=”word-break:break-all;width:200px;”>abcdefghijklmnabcdefghijklmnabcdefghijklmn111111111</div>

<h1><code>Firefox/ word-break:break-all; overflow:auto;</code></h1>
<div style=”word-break:break-all; width:200px; overflow:auto;”>abcdefghijklmnabcdefghijklmnabcdefghijklmn111111111</div>
<h1><code>table</code></h1>
<h1><code>table-layout:fixed;</code></h1>
<table style=”table-layout:fixed” width=”200″>
<tr>
<td>abcdefghigklmnopqrstuvwxyz1234567890ssssssssssssss</td>
</tr>
</table>
<h1><code>table-layout:fixed; word-break : break-all; word-wrap : break-word ;</code></h1>
<table width=”200″ style=”table-layout:fixed;”>
<tr>
<td width=”25%” style=”word-break : break-all; “>abcdefghigklmnopqrstuvwxyz1234567890ssssssssssssss</td>
<td style=”word-wrap : break-word ;”>abcdefghigklmnopqrstuvwxyz1234567890ssssssssssssss</td>
</tr>
</table>
<h1><code>FF \ table-layout:fixed; overflow:hidden;</code></h1>
<table style=”table-layout:fixed” width=”200″>
<tr>
<td width=”25%” style=”word-break : break-all; overflow:hidden; “>abcdefghigklmnopqrstuvwxyz1234567890</td>
<td width=”75%” style=”word-wrap : break-word; overflow:hidden; “>abcdefghigklmnopqrstuvwxyz1234567890</td>
</tr>
</table>
</body>
</html>

扯淡

ez4.1的module

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

(ModuleList[]=modulename)

技术

template不被cache

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

扯淡

eZURLWilcard做URL跳转

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

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中添加
换行

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

技术

RemoveSiteAccessIfDefaultAccess

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

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)

扯淡

学习的几个误区及对策

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

扯淡

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

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

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

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

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