Drupal 7 – Render the Privatemsg send message form programmatically

Privatemsg allows Drupal users sending message to each other. It is a must-have feature of community oriented websites. The module includes all necessary features including inbox, outbox, user block list etc. In my case, i want to render the send message form on the user profile page. So i created a block which generate the send message form by PHP code and attached it to the user profile page. Here you are.
Continue reading Drupal 7 – Render the Privatemsg send message form programmatically

What is philosophy 哲學是什麼?

作者: José Ortega y Gasset

哲學就是關於宇宙的知識,或是關於所有存在物的知識,而這些知識必須建構於不可懷疑的存在之上,所以哲學家要做的第一步就是要找出不可懷疑的存在,也就是宇宙的與料。

作者在書中首先交待了哲學在人類歷史上的演變過程,為何人類需要哲學?人類的世代的交替如何推動哲學與其它知識前進? 作者相信每個世代都有一個任務,檢視過去的並創造新的知識從而更接近那哲學的對象。

在十九世紀最後的六十年,物理學的發展與實用主義的出現導致哲學心靈萎縮。但這事件未有使哲學一蹶不振,相反它使哲學朝向更廣闊、更遠的地方前進,被遺棄的過去理論使到新的理論基礎更穩健。

笛卡兒的唯心主義(我思故我在)使人類第一次接觸那不可懷疑的存在,但唯心主義的過份膨脹大大降低了人類生活上的推動力。

作者嘗試把唯心主義拉回正確的路上,提出客觀事物的存在的重要性,人類再不用把自己封閉有自我思想上,事物的存在必須依賴我的主體性但同時我的主體性同樣依賴事物的存在。

José Ortega y Gasset
荷西.奧德嘉.賈塞特

Drupal 7 – Modify the internal/system path of Taxonomy Terms

The default path of taxonomy term is taxonomy/term/[term-id]. Although we can now use term alias in Drupal 7, we may still want to change the internal path with a specific pattern. For example, i want to replace all the term page by a view which has term id as input parameter. In that case, i want to set the path of all terms to my-term-view/[term-id] instead of taxonomy/term/[term-id]. This could be done by using the Entity Path module.
Continue reading Drupal 7 – Modify the internal/system path of Taxonomy Terms

陶傑 – 「民望」何許

特首競選的國際鬧劇,由中國文化思維的角度,看出許多邏輯混亂的謬誤。

既是上面的「欽點」,不知從何時起,這場選舉,變成由「民意調查結果」,即所謂民望,來綁架的遊戲。

「民望」真的是一切?笑話。大亞灣建核電廠,當年有百萬香港市民簽名反對,民意調查的結果送去北京,理不理你?

中國人社會的「民望」,初一缺,十五圓,如果認真看,你就慘了。例如,毛澤東死的時候,你看新聞,全國一片黑壓壓的哀哭成一團,當年的外國通訊社,都驚呼「毛主席」雖然餓死了幾千萬中國人,但在中國人心中「民望」還驚人的高。
Continue reading 陶傑 – 「民望」何許

Drupal 7 – Show page not found if view argument exists

Assume we have a Views page which does not have a contextual filter setting and the view path is /eureka. If you provide an argument in the url such as /eureka/abc, the argument is ignored and the Views page will return all view rows. But sometimes we may want to show the user a page not found instead of return all rows. This can be done by adding a Global: Null argument in the contextual filter.
Continue reading Drupal 7 – Show page not found if view argument exists

Drupal 7 – Render user profile picture programmatically @ 2

Yesterday we have talked about 2 normal ways to render the user profile picture in Drupal 7.
Drupal 7 – Render user profile picture programmatically @ 1

Unfortunately you can only get the user profile picture with default size if you have enabled the Gravatar integration moddule. i.e Continue reading Drupal 7 – Render user profile picture programmatically @ 2

陶傑 – 只是一點想像力

香港特首「選舉」,層次甚低,有點國際和歷史視野的,都會當做笑話來看,笑料天天新款,很好。

做領袖,不只看民望、工作能力,或者什麼公務員支不支持,最重要是有想像力。

不但藝術家要有想像力(Imagination),一國的領袖,更需要。香港人不崇洋,但崇優,都認為前英殖民地的總督管治,比現在優越,因為英國人有中國人所欠缺想像力。

大的不必講。前港督麥理浩時代,建一條半山自動電梯,讓人可以乘手扶電梯,從皇后大道中,不費力一直登上干德道。

這就是一點小小的想像力。今天的特區政府,就做不到,即使有人有,開會 Brain-storm,想到一動工的時候,塵土飛揚,堅道、羅便臣道一帶的豪宅民居,會受到滋擾,那裏的房子,一度會賣不出去。住半山的人,一定有幾個是特區政府高官的小姨子、表弟、丈母娘,他們向特府的什麼班子一投訴,馬上就打消。
Continue reading 陶傑 – 只是一點想像力

BeansTag update

If you have no idea about BeansTag, please refer to BeansTag – The SEO tool for Drupal 7

Although BeansTag is not going to be approved as a Drupal 7 module, i still added some features to it as requested by the BeansTag users. But before i talk about the new features, i want to clarify a BeansTag concept

BeansTag depends directly on the url path.

For example, a node with nid = 1 has an url alias articles/abc, you can create 2 different BeansTags with the following paths.

  • node/1
  • articles/abc

Continue reading BeansTag update

Dream BIG and go for it =)