“扯淡”目录存档

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>

ez4.1的module

2009年04月30日,星期四

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

(ModuleList[]=modulename)

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;
}