|
用户名:草莓小丑 笔名:草莓小丑 地区: 行业:其他 |
| 日 | 一 | 二 | 三 | 四 | 五 | 六 |
To the April
"Tiny Dancer" ::Elton John
Blue jean baby, L.A. lady, seamstress for the band
Pretty eyed, pirate smile, you'll marry a music man
Ballerina, you must have seen her dancing in the sand
And now she's in me, always with me, tiny dancer in my hand
Jesus freaks out in the street
Handing tickets out for God
Turning back she just laughs
The boulevard is not that bad
Piano man he makes his stand
In the auditorium
Looking on she sings the songs
The words she knows the tune she hums
But oh how it feels so real
Lying here with no one near
Only you and you can hear me
When I say softly slowly
Hold me closer tiny dancer
Count the headlights on the highway
Lay me down in sheets of linen
you had a busy day today
Blue jean baby, L.A. lady, seamstress for the band
Pretty eyed, pirate smile, you'll marry a music man
Ballerina, you must have seen her dancing in the sand
And now she's in me, always with me, tiny dancer in my hand
yahoo 361
ruby on rails on slashdot
自己建立一个MidCOM网站
content(); ?>
$midcom_roottopic = "xxxxxx"; // GUID of your Topic "mysite-root"
mgd_include_snippet("/midcom/midcom");
// your sitegroup-global component configuration
mgd_include_snippet("/sitegroup-config/de.linkm.htmlfilter/config");
mgd_include_snippet("/sitegroup-config/de.linkm.taviewer/config");
...
//$midcom_debugger->disable();
?>
codeinit(); ?>
content(); ?>~page element "AIS/code-global"
// make browsers don't cache anything~page element "AIS/code-init"
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
$midcom_roottopic = "xxxxxx"; // GUID of your Topic "mysite-ais"
mgd_include_snippet("/midcom/midcom");
// component configuration
mgd_include_snippet("/sitegroup-config/de.linkm.htmlfilter/config");
mgd_include_snippet("/sitegroup-config/de.linkm.taviewer/config");
mgd_include_snippet("/sitegroup-config/de.linkm.newsticker/config");
...
$midcom_debugger->setLogFile("/tmp/aou-ais.log");
// $midcom_debugger->disable ();
$midcom->cache->no_cache();
?>
codeinit(); ?>
Parameters
midcom
component = de.linkm.newsticker
Parameters
midcom
component = midcom.admin.main
Parameters
midcom
component = midcom.admin.content
midcom.admin.content
nav_ellipsis = ...
nav_length = 45
root_page = xxxxxx GUID of your Page "mysite"
root_topic = xxxxxx GUID of your Topic "mysite-root"
...
finish(); ?>
来通知缓存引擎输出结束。
Midgard|MidCOM 介绍之二
Midgard系统介绍之一
可怜的Word Press
midgard CMS 介绍之零
尘世CMS使用自然树结构来表达:
程序员-----开发-->页面元素
美工-------设计-->格式元素
内容编辑---撰写-->文章
+-------+ +----+ +-----+ +-----+
| 文章 | = |页面| + |格式 | + |话题 |
+-------+ +----+ +-----+ +-----+
|Article| |Page| |Style| |Topic|
+-------+ +----+ +-----+ +-----+
交织的页面和格式元素提供了一个灵活强大的模版系统,并且可以容纳编辑说明和附加的多媒体
内容。
文本内容可以被即时格式化为基本的html格式。
一个或多个网站集合被分装为[Sitegroup|网站组],分别由指定的网管组来管理。
网站组内部是Unix模式的系统权限管理,根据用户所属的组限制他们对下属(树)结构的写权限。
[Snippets|散件]被放在[Snippetdirs|组件目录]中,散件目录是另外一个树结构,用来存储
和共享页面[Page]或格式
[Style]元素。它将成为尘世CMS的模版和应用程序的共享库。
[Asgard]是web-based的管理界面。
[Repligard]是command-line的备份程序。
+ 数据库
======
1.4版的尘世CMS使用MySQL来存储内容,模版元素,用户信息,和代码库。数据库使用一个PHP API来提供管理。
+ i18n
====
++ UTF-8 character encoding UTF-8 编码格式
============================
在尘世CMS中使用UTF-8编码格式,要在midgard-data.conf文件中设置:
MidgardParse russian /* russian是parser的名字!*/
将已经成立的Midgard数据库转化为UTF-8:
1. 将数据库dump成[replligard]形式。
2. 在[repligard]中设置数据库编码为UTF-8。
3. 导入数据库,强制对所有数据覆盖。
++ Multilingual content 多语言内容
===============================
在多语言版本的Midgard CMS中,[page|页面], [pageelement|页面元素], [element|元素], [snippet|散码], [article|文章]对象可以有各种语言的不同内容。[parameter|参数]和[attachment|附加文件]对象可以加上属于特定语言的标签。
在使用多语言功能的时候,对象会产生不同语言的版本,它们的内容记录会有不为0的语言参数值。除了 mgd_get_object_by_guid_all_langs(),其它函数都限制于一种语言的对象。因为一个对象总有一个结构记录和一个内容记录。如果这个对象没有目前语言的内容记录,就不能对之进行mgd_get或者其它操作。
/**
obj => { structure_record, content_record)
*/
所有的对象都有一个缺省的lang=0内容记录。如果要处理所有语言的对象。要将lang设置为0,可用mgd_get_object_by_guid_all_langs来获得不同语言版本的同一对象。
目前的语言是全局范围的。它可以用mgd_get_lang()来读取。这个函数返回语言表中一个记录的id值。内容语言可以有几种设置方法:
+++ mod_midgard 看是否有一个cookie叫做[MidgardLang],可以设置语言至这个cookie的值
+++ 如果[MidgardLang] cookie没有设置,或者设置为0,mod_midgard 根据目前的host的[lang field]设置。
+++ mgd_set_midgard($lang)设置语言。在处理请求的过程中可以被多次执行。但是不能重设
当前页面或任何[preparsed|预设置]的页面和格式元素,因为他们是在mgd-set-lang被执行前由mod-midgard预设置的。
如果不设置任何语言设计,它将一直是0 (即无语言设置),对应的,内容将带着lang=0参数被嵌入
记录中,每个结构记录和内容记录是1-1的关系。
+ [Quota|配额]
============
使用midgard配额,可以设置[Sitegroup|网站组]范围内的限制包括:
+++ 每个表中的记录数目
+++ 每个表中内容的最大值。(并且可以定义表中的哪些field计入内容)
+++ 附件的最大值
+++ 一个网站组中所有对象的内容总和的最大值。
如果在建立或更新记录中达到配额,会生成一个MGD_ERR_QUOTA错误信息。
在打开附件时达到配额同样生成错误信息。
++ 安装配额
========
./configure --with-quota
使用在/data中的quota.sql生成配额表。
++ 设置配额
========
[New apache configuration directive:]
MidgardCheckQuota(On|Off)default: Off
++ 实例
====
/* as $midgard->root: |作为root可以设置quota */
/* The total size of all content fields of table page_i may not exceed 1000 KB for sitegroup $sg
sitegroup $sg 中page_i表中所有的内容不能超过1000KB */
mgd_create_quota($sg, 'page_i', 'content', 0, 1000);
/* The total size of all value fields of table pageelement_i may not exceed 1000 KB for sitegroup $sg
sitegroup $sg 中pageelement_i表中所有的内容不能超过1000KB */
mgd_create_quota($sg, 'pageelement_i', 'content', 0, 1000);
/* The total size of all content & abstract fields of table article_i may not exceed 1000 KB for sitegroup $sg
sitegroup $sg中article_i表中所有的内容和摘要不能超过1000KB */
mgd_create_quota($sg, 'article_i', 'content,abstract', 0, 1000);
/* The total size of all value fields of table element_i may not exceed 1000 KB for sitegroup $sg
sitegroup $sg中element_i表中所有的[value]不可以超过1000KB */
mgd_create_quota($sg, 'element_i', 'value', 0, 1000);
/* as normal user: | 作为一般用户可以查询quota*/
$qinfo = mgd_get_quota_info_by_tablename('blobsdata');
$qinfosg = mgd_get_quota_info_by_tablename('wholesg');
/* Test if file $filename could be written into an attachment according to quota rules
测试看文件 $filename是否能根据配额条例来写入附件。*/
if ($qinfo->eff_space + (filesize($filename) / 1024) >= $qinfo->space or $qinfosg->eff_space + (filesize($filename) / 1024) >= $qinfosg->space) { echo "File too big"; }
+ Host, URL和动态页面参数
================
由浏览器发出的一个URL请求包括三个独立信息部分:
+++ host name
+++ page name
+++ path
和各种可能要传给目标页的参数。
Midgard在Apache上挂了一个过滤器检查每个请求来判断它是否要到midgard的页面。它的转译处理器检索出Midgard Host记录符合如下条件:
+++ 最长的符合host记录中name值或者name值和前缀的
+++ host记录中端口或者为0(任何),符合请求的端口号,或者是缺省的80
+++ host记录中online field设置为online
如果没有找到符合的记录,处理器会拒绝转译,Apache处理恢复。
到一个页面的路径在页面树结构中,而不是Apache的server root下的目录中。参数可以用midgard指定的模拟传统文件目录的语法来传递。
http://foo.org:80/foo/Geeks/Functions/ffunky/fcool.html?arg1=kiki&arg2=koko
|____________| |_____________| |_______________||____________|
host + prefix path to page arguments more arguments
(Midgard syntax) (usual syntax)
在这里 Functions是页面。如果目标页许可了[virtual paths|虚拟路径],剩下的[token]以C模式的[$argc $argv[]]来存储为参数。
$argc=2 and $argv=["ffunku", "fcool"]
这种结构让网站可以被搜索引擎爬虫爬过。.html后缀加强配适性,将在URL转译中去掉。其他的后缀保持不变。你也可以使用一般的参数语法。
Harder, Better, Faster, Stronger