drupal

榨干drupal性能的最后一滴

Squeezing the last drop from Drupal: Performance and Scalability (part 1)
January 27, 2010 in Drupal Planet, Tech by Murray Woodman
http://cruncht.com/75/drupal-performance-scalability

啥也别说了。读。打印读。然后翻译造福中文社区。

测试draupl性能的工具包

项目在: http://github.com/jacobSingh/Drupal-Performance-Testing-Suite

README
Drupal Performance Testing Suite.
To run:
1. Open up the jmx file
2. Enable either Drupal-6 or Drupal-7 config sections (not both).
3. Edit the config section and change the host to reflect your target machine
4. (optional) change the output location in the general test configuration
5. (optional) run jmetergraph.pl on the *summary.xml files to generate charts.

如何用vim直接发文章到drupal上

喜欢简短的直接看英文愿望呢。画面很有说服力:)
http://reluctanthacker.rollett.org/software/drupavim
http://reluctanthacker.rollett.org/software/drupavim

我的做法:

1、看作者网站
2、下载vim插件放到 ~/.vim/plgin/ 下
3、看一下那个插件的INSTALL
4、编辑drupalvim.vim中用户密码和你站点域名
5、打开vim
6、输入 :source ~/.vim/plugin/druaplvim/druaplvim.vim 因为真的还不知道如何自动load pluing到vim
7、 :e blog/suibian 只要 :e blog/ 就是说我要写blog,也可以用 story或者其它contenttype。 blog/后面的文字随便写,只要不是之前有过的node id就可以,否则插件一位你要编辑以前文件呢
8、写好了 :w 就发表了 :)
9、如果你想用 free tagging 参考 INSTALL

To install DrupaVim, Copy drupavim.vim to ~/.vim/plugin and edit
your username, password and blog url.

Optionally copy drupavim.txt to ~/.vim/doc and run :helptags ~/.vim/doc

If you wish to use the freetagging capability, set useinlinetags = True
and install the inline tags module, which you may find here:

http://drupal.org/project/inlinetags

As of drupal-6.9, for file/image uploads to work, you must patch drupal
with the patch found here:

http://drupal.org/node/243907
INSTALL (END)

我最想要的durpal模块就是可以把druapl站点map到自己硬盘上,变成自己硬盘上的一个文件系统类型,我直接本地编辑,然后更新到服务器上。

我最想要的durpal模块就是可以把druapl站点map到自己硬盘上,变成自己硬盘上的一个文件系统类型,我直接本地编辑,然后更新到服务器上。
有类似模块支持用这个方法编辑wikipedia: http://wikipediafs.sourceforge.net

drupal中让你可以发email来发布和管理内容的模块

还可以挂附件。所以你用手机照的照片可以直接在手机上用发电子邮件的方式发布到你的网站。

使用说明: http://drupal.org/handbook/modules/mailhandler

粗看了一下,暂时对我用处不大,因为:
1、默认只是接受来自和网站同一域名的email。
2、命令有些麻烦

Mailhandler
Mail18 · Modules19
z.stolar20 - September 28, 2003 - 16:44

The Mailhandler module allows registered users to create or edit nodes and comments via email. Authentication is usually based on the From: email address. Users may post taxonomy terms, teasers, and other node parameters using the Commands capability. See useful command documentation21.

A tutorial for configuring this module for processing images attached to emails.22

http://drupal.org/project/mailhandler

drupal的footnote模块让你在文章中可以使用脚注

模块正式主页:http://drupal.org/project/footnotes

Footnotes 模块可用于建立自动编号的脚注。 当你要添加一个脚注时,使用 fn 标签: 第一个脚注写些什么的。脚注是直接写在文章中的fn标签间。过滤器将自动取出其中的文本,移到页面底部成为一个脚注,而正文的相应位置会出现脚注链接。
http://drupalchina.org/node/2035

脚注对我来说越来越重要。markdown本身不支持这个html的标签这点真是非常遗憾,所以现在我无法使用。只能考footnote这个模块了。

drupal的notify模块就可以通知用户站点最近有什么改变

http://drupal.org/project/notify
The notify module allows users to subscribe to periodic emails which include all new or revised content and/or comments much like the daily news letters sent by some websites. Even if this feature is not configured for normal site users, it can be a useful feature for an administrator of a site to receive notification of new content submissions and comment posts. It can be extended to select specific content to go to users individually using Views module and Notify by Views.

可以直接抓取和显示picasa公开相册的drupal模块

可以直接抓取和显示picasa公开相册的drupal模块
http://drupal.org/project/brilliant_gallery

对于自己的相册,google的picasa网站已经提供给你嵌入到网页的代码了。但对于其他人的公开网站,这个模块是不是就派上用处了?:)

喜欢这个干净的drupal theme

http://usingdrupal.com/
作为只发布少量信息的站点,该站的页面风格太好了。

将帖子备份到邮箱的Drupal模块

自己随手写的,基于Action/Trigger模式,可以在帖子被更新时把贴子源代码和一些基本信息发送到指定邮箱。收到的邮件类似于:
http://puppy.cnbits.com/node/634

高手!有用。对我,不是为了备份,而是方便快速看到网站有没有更新。特别是留言更新。

drupal中的filter cache表会在每次cron运行时被清空?

Filter Cache

The filter cache serves cached filtered content to anonymous and authenticated users alike. The more complex your filters are, the greater the performance gain from this cache. (I have been working on a site which does extensive xsl transformations to turn xml in node bodies into html on the page, making filter caching critical.) Cached filtered content gets cleared out on cron

http://www.zivtech.com/blog/understanding-input-formats

如果情况属实,站点的cron还不能运行过于频繁,否则每次都需要重新生成filter cache,影响站点反应速度吧。

让drupal的统计模块(statistics)将记录保留更长的时间。可以设置为永久保留

需要解决的问题

durpal代码让你保留统计信息,比如最近点击、访问来源等信息,最长保留时间是16周。我想让它保留更长时间的信息。搜索了一下,决定直接改代码。

方法

因为我使用drupal 6。以下修改都是针对drupal 6的代码。

需要修改的文件是 modules/statistics/statistics.admin.inc

编辑该文件,查找 3600 这个关键词,会看到这行

'#description' => t('Log each page access. Required for referrer statistics\
.'));
$period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172\
800, 259200, 604800, 1209600, 2419200, 4838400, 9676800,3600000000), 'format_in\
terval')
;

其中 $period 后面是默认的保存时间,以秒来计算。诉一3600就是一个小时。10800是一天。你要保留多少天直接用 天数 x 24 x 3600 就是添上去的秒数。

我图省事。直接加了 3600000000 ,就是1000000个一小时。:)

修改好了,保存。

回到管理页面。 /admin/reports/settings

在“Discard access logs older than:”中现在可以选择的时间断中赫然出现 114 years 这个选项。原来1000000个小时就是114年啊。足够长了。:)

可惜114年太长。drupal不同意。最后我删除了2个零。改为1年零7周。

参考文章:
http://api.drupal.org/api/function/statistics_access_logging_settings/6
需要修改的代码片段就在上面链接页面中。

解释statistics模块是干嘛的。http://drupal.org/node/297

我为了解决这个问题进行的关键词搜索

修改显示参数,让每页显示超过30条信息

我只想每页多显示些referrers条目,比如显示200条

第一步:让每次查询数据库的时候多查一些,而不是默认的30条

还是在 modules/statistics/statistics.admin.inc 搜索一下

  $result = pager_query($sql, 30);

之类的看看。修改30为400,就是每次查询400条。

第二步:修改输出查询条目的参数

参考源代码: http://api.drupal.org/api/function/statistics_top_referrers。这是修改referrer的,修改hits和top pages, top visits一样道理。

最简单的方法,就是搜索关键词“30”,看到默认output是30,直接改为100就好了或任何你想要的数字就好了。

注意

按我的方法直接改动核心代码的好处是方便。增加几个字符,就好了。

坏处是下次升级的时候,你还要记得修改相同的地方,不然你的修改就被覆盖了。所有,有些麻烦。

drupal 6 的 cache_form 代码有问题,不能够按cron设置 expire 和清空该表的数据

drupal 6 的 cache_form 代码有问题,不能够按cron设置 expire 和清空该表的数据

发现自己站点这个缓存表很大。查了一下,现在管理该cache的代码有写些问题。不影响我的使用,就是看着烦人。:)

下面是相关搜索:
http://www.google.cn/search?hl=zh-CN&newwindow=1&client=fire...

drupal中添加下一篇上一篇到相同node形式的文章

Adding next & previous links for node types within taxonomy terms (e.g. Image Galleries)
http://drupal.org/node/45050

drupal mobile 5.x 的代码直接拿到6.x也能用

随便找一个theme的info,把它内容替换为mobile就可以了
复制粘贴内容
http://cvs.drupal.org/viewvc.py/drupal/contributions/themes/...

drupal模板:在聚合页不显示文章正文

自己老文章重读
http://pengyou.rijiben.org/node/2032
在node.tp.php中用

就是如果这个node是单独的一个page,那么打印$content。也就是说,如果不是单独的,就不打印。成功了。:)

顺便在聚合页也不显示作者了

   <?php if ($page == 1)print $submitted ?>
   <?php if ($page == 1)print $submitted ?>

大家举一反三去。哈哈。

    <?php if ($page == 0): ?>

drupal. iUI theme:模仿iphone的

没有iphone,不知道iphone浏览器和opera之类有何不同么?为什么需要特别的theme?

Module can be used for more than .mobi switching
This module can be used for more than .mobi switching-- you can have it work for any domain if you replace the following line (line 38 in mobi_loader.module):
if (substr($_SERVER['HTTP_HOST'], strrpos($_SERVER['HTTP_HOST'], '.')) == '.mobi')
to:
if ($_SERVER['HTTP_HOST'] == 'm.neopoet.com') {
where 'm.neopoet.com' is the domain of your mobile-only site.

If somebody has the time, a great feature would be to change this to a variable that can be set in the administration panel.

Cheers,
Andrew
http://drupal.org/node/137255

一次 untar 多个文件

我现在用的方法

我今天自己想到了用这个

  for f in *.gz; do tar xvzf $f;done 

用了一个 for ; do ; done 的bash循环。我喜欢用这个。

看到别人的方法

一次 untar 多個files
find [folder] -iname "*.tar" -exec tar xvfz {} \;
我現在多是用到sites/all/modules 用 wget 更新模組的
http://www.joetsuihk.com/node/117

不但解决了我的问题,而且都是为了解决同一个问题,更快速地升级drupal模块!

每次我升级ddrupal的时候都在想,如果不是drupal支持多站点,我每个站点升级一次,那是多么痛苦啊。幸好支持多站点的软件,只要升级同一个系统,所有站点都升级了。

让drupal运行在cherokee网页服务器上

让drupal运行在cherokee网页服务器上的菜谱
http://svn.cherokee-project.com/browser/cherokee/trunk/doc/c...

cherokke号称最快的web server
http://www.cherokee-project.com/

决定在自己的桌面机试验一下。

暂时用处不大。因为除非自己用虚拟服务器,不然各大虚拟主机提供商都是apache。

drupal education 包:为教育界打包的drupal程序

http://funnymonkey.com/drupaled-latest
暂时还是基于drupal 5.x 的。

实现的有些功能我很喜欢。就是文章在private和public之间方便转换。
http://funnymonkey.com/funnymonkey-commons

把quicktabs模块改造成能够以标签切换来显示节点内容

把quicktabs模块改造成能够以标签切换来显示节点内容
http://www.5iphp.com/zh-hans/heart/216.html

迄今为止我看到的drupal中方便快速建站的最佳模块

迄今为止我看到的drupal中方便快速建站的最佳模块

Introducing the Bones module for Drupal: Rapid Site Wireframing with YAML
by 13andy November 23, 2008

At the time, I was still getting my feet wet with Drupal module development, and managed to put together some code that:

* Reads a 14YAML file containing a site outline
* Builds stub nodes for each page in the outline
* Builds nested menu links pointing to those nodes
* Builds nested path aliases based on the node titles

http://proofgroup.com/blog/2008/nov/introducing_bones_module_drupal_rapid_site_wireframing_yaml

模块项目主页
http://drupal.org/project/bones

如果导入的yaml语法中body(正文)标识内支持多行文字,就完全是我现在最想要的一个drupal模块了!!!!

安装适合drupal运行的主机

安装适合drupal运行的主机

Installing a dedicated server or a VPS with Ubuntu Server 8.04 LTS (Hardy Heron) for Drupal 6.x

http://2bits.com/articles/installing-a-dedicated-server-or-a...

memcache

http://2bits.com/articles/installing-memcached-125-and-memca...

why ubuntu

http://2bits.com/news/wikimedia-standardizes-400-servers-ubu...

将多个drupal站点的数据库合并到一个数据库中

将多个drupal站点的数据库合并到一个数据库中

先看到这篇。用emacs查找替换。
http://www.opensourcery.com/blog/jonathan-hedstrom/merging-t...
从上篇留言中看到这篇,更简洁,提到了注意事项。用vim查找替换。
http://niebegeg.net/blog/changing-of-the-dbprefix-of-the-dru...

onsugar.com把drupal修改的非常适合喜欢图形界面发表文章的人使用;上传图片也很方便

http://www.onsugar.com/
http://blamcast.net/articles/onsugar-drupal-blogging

后台界面很好看,非常cute,各种也很简单,发图片什么的非常方便了。可以免费注册个帐号去看看。
该团队修改了durpal的核心和一些模块。
暂时没有发布他们做了什么修改。
团队说会在近期写一些这方面的东西发到drupal.org。

我现在听到的最大抱怨就是发图片麻烦。这个很难!!!!虽然以前用image+image assistant效果不错。但现在6.0版本我竟然搞不明白了。

还有想要图形界面的编辑器。这个到不难,但我不想实现。因为隐患很多。

drupalmu,一个类诉wordpressmu的durpal系统,其实就是一个特别的drupal profile

drupalmu,一个类诉wordpressmu的durpal系统,其实就是一个特别的drupal profile

核心加上一些插件就做到了。提供了安装profile,值得关注。
http://drupalmu.org/
http://groups.drupal.org/multiuser-blogging

Syndicate content