js下拉,加个OPTION的

2009年11月23日

slct=document.createElement(”Option”);
slct.value= ‘value’;
slct.text= ‘text’;
document.getElementById(”selectID”).appendChild(slct);

site.ini 控制module

2009年11月17日

[SiteAccessRules]
Rules[]=Access;enable
Rules[]=ModuleAll;true
Rules[]=Access;disable
Rules[]=module; user/register

How to assign an object(multi locations)

2009年11月17日

$Object->addLocation( $Object, false );

通过ftp进行远程备份

2009年08月12日

2009/8/12, 陈明星

系统:centos 5.3

控制面板:ISP-CP

想通过FTP把服务器中的几个网站备份上传到另一个服务器:

######################################################
#!/bin/bash
#get current date
currdate=`date +%Y%m%d`
#define ftp server ip
serverip=127.0.0.1
#define ftp username
serveruser=mingxing
#define ftp password
serverpass=password
host=`hostname`
echo "Starting FTP backup on " $host " at " `date`
#switch to the local dir
for i in /var/www/virtual/*; do
domain=${i:17:${#i}};
cd /var/www/virtual/$domain/backups
#ftp upload
/usr/bin/ftp -in <
open $serverip
user $serveruser $serverpass
cd public_html
#create a directory by current date
mkdir $currdate
cd $currdate
bin
verbose
mput *.*
stat
bye
EOF
done
echo "Backup finished at `date`"
######################################################

eZ Website Toolbar

2009年07月31日

http://projects.ez.no/ezwebsitetoolbar

This extension contains the Website Toolbar only, extracted from the Website Interface. You can install the Website Toolbar on an existing site in order to enable editors browsing the front-end of an eZ Publish website to conveniently edit content.

The Website Toolbar integrates into your front-end site design and contains useful functions to edit, move, delete, copy and add new content.

Website Toolbar not showing up

2009年07月31日

In our 4.1 installation, the toolbar was not available due to the following fetch:

$website_toolbar_access = fetch( 'user', 'has_access_to', hash( 'module', 'websitetoolbar', 'function', 'use' ) )

Module "websitetoolbar" was not registered, to solve this, just set the
following lines in your settings/override/module.ini.append.php:
[ModuleSettings]
ModuleList[]=websitetoolbar

More information at: http://issues.ez.no/IssueView.php?Id=14705

Automatic object relation

2009年07月30日

Version 3.1 of eZ publish introduced a powerful datatype: keyword. This datatype can be used as an additional attribute in content classes to assign one or more keywords to an object.

Individual keywords need to be separated with a comma. Extra whitespace at the beginning or end of a keyword is stripped automatically when they are stored.

Objects which have one or more common keyword to the current node can be related in the templates as follows:

{let related=$node.object.data_map.keywords.content.related_objects}

{section show=$related}

<h2>Related documents</h2>

<ol>

{section name=Related loop=$related}

<li><a href={$:item.url_alias|ezurl}>{$:item.name}</a></li>

{/section}

</ol>

{/section}

{/let}

The first part is used to set an array of related objects. If there are no related objects through common keywords, the section is not producing any output (equivalent to php evaluation: empty arrays are considered “false”):

{let related=$node.object.data_map.keywords.content.related_objects}

{section show=$related}

The rest of the template code loops around any related objects and displays a link and their name.

安装EZ时站点选择

2009年06月29日

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

在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

2009年05月5日

诸如邮件地址太长等……

自动换行问题,正常字符的换行是比较合理的,而连续的数字和英文字符常常将容器撑大,挺让人头疼,下面介绍的是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

2009年04月30日

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

(ModuleList[]=modulename)