Tag Archives: Postaday2011

Drupal – Define Your Own Cron Job

How does the cron job in Drupal work? Let’s take a look.
cron.php

<?php
// $Id: cron.php,v 1.36 2006/08/09 07:42:55 dries Exp $

/**
 * @file
 * Handles incoming requests to fire off regularly-scheduled tasks (cron jobs).
 */

include_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
drupal_cron_run();

 

Looks simple, right? the drupal_cron_run() function will run the default Drupal cron tasks as well as invoking the hook_cron() in all modules. Continue reading Drupal – Define Your Own Cron Job

Drupal – Add Task to the Drupal Cron Job

Drupal has a cron.php at the root directory. you can run the this cron job by either entering the http://<drupal_root>/cron.php in browser or running it directly in the Drupal status report.

The default Drupal cron job cleans up log files and checks for Drupal and modules updates. If you want this cron job to be run at a regular interval, just edit the crontab by the following command.

  • crontab -e

 

and add one of the following lines with you desired interval. (45 mins in the following example) Continue reading Drupal – Add Task to the Drupal Cron Job

梁文道 – 一個死在香港的中國人

我知道華叔司徒華的遺願是建立民主中國,這大概也是不少香港人的心願。可是坦白講,經過多年在大陸走動的經歷之後,比華叔年少一半的我已經失卻這等雄心壯志了。現在的我,最期盼的不再是一個民主中國,而是一個比較正常的中國。什麼叫做比較「正常」的中國呢?那就是讓一個家庭不要莫名其妙地發現自己住了十幾年的地方有一天忽然給人拆了。好,就算你不能保證老百姓的住所不被強拆,起碼你也該留道氣口,讓他們去上訪投訴吧。如果你連上訪都不准,可不可以不要強姦那個跑來上訪的女孩呢?如果你的人非強姦她不可,能不能至少讓那個女孩去報個案呢?就算做做樣子也行吧?萬一這女子太過害怕,找人陪同壯膽,能不能不捉那個陪她的善心人,說他是「聚眾滋事」呢?如果你真得抓這個人,至少讓他見見家人和律師好不好?又如果大陸以外有人替他申寃訴苦,我請你不要動不動就怪這批人「井水犯河水」,行嗎? Continue reading 梁文道 – 一個死在香港的中國人

子華文集 – 棟篤屁 之 我是鳥

棟篤屁之我是鳥

有些事,不是說有人教便學得來。
  
她在開車途中,遇上黑色暴雨。雨水嘩啦嘩啦發狂似的打在車頭玻璃上,任水撥如何高速擺動,她瞳孔如何擴大,視野仍然是汪洋一片,相當浩 瀚。她左支右絀,一步一驚心,冷不防對面的大貨車還卷起一片大浪迎頭罩下,她驚懼之餘,更感到的,是一股無名的恨意在暗暗浮升。她咬咬牙,控制著自己的情 緒,時速減到幾乎不動,還是無可避免地把車開進一個水深兩尺的水窪。車子停在水中,動彈不能。她欲打無線電話求救,方發覺沒帶在身。此時她的忍耐已到達極 點。她隔著玻璃看看車門外面的水深,估計斷不會淹死自己,便一腳蹬開車門,跳入水中,迎著大雨,揚長而去。
  
兩日後,雨過天青,警署致電給她認領車子。她仍餘怒未消。
  
可憐那車,門敞開,面盛滿了水,等著主人來認領。
  
這種瀟灑,學不來。 Continue reading 子華文集 – 棟篤屁 之 我是鳥

HTML – Remove Dotted Line of Transparent Button

Not only the HTML link will have a dotted outline after being clicked, if you have a transparent input button, you will find the dotted outline too.

 

The following css could help you to remove it.

/*for FireFox*/
input[type="submit"]::-moz-focus-inner, input[type="button"]::-moz-focus-inner {   
  border : 0px;
} 
/*for IE8 */
input[type="submit"]:focus, input[type="button"]:focus {     
  outline : none; 
}

Continue reading HTML – Remove Dotted Line of Transparent Button

陶傑 – 天葬

民主元老逝世,生前很受「爭議」,因為十三年來,至少有一半「輿論」,標籤這位老先生是「反中亂港」的叛國賊之首。

這位元老一死,特首即刻發出哀悼,用詞十分權威:「司徒華先生一生熱愛中華、熱愛香港,致力推動民主發展,為人剛直不阿,堅持理想。」
 

「熱愛中華、熱愛香港」,而強調「一生」,是情傾萬里的至高頌詞,如同前清謚曾國藩為「文正公」。現代的中國「政治文化」,對於一個「死」字看得極重。吃政治飯的中國人,尤對於死後的「評價」,葬禮的「規格」,視為「重中之重」。「結束×黨專政,平反×四」是司徒華生平的代表作,現在,特區的官方,高度讚揚「反中亂港」即是愛國,「平反六四」即是「理想」,官方「定音」,香港一齊照這個調子哭喪,身為納稅人,對於這個「大是大非」的問題,難免要問一句「為什麼」。 Continue reading 陶傑 – 天葬