Drupal – Create a Garland Subtheme

I would like to edit some PHP and PHP template files but i dun want to modify those files in the default Garland theme. So i’d better create a Garland Subtheme which inherits those files from the Garland theme as well as i could create my own PHP and PHP template files under the subtheme folder for overriding the default.

Actually i am not very familiar with the theme architecture of Drupal, but the following example works as i expected. Continue reading Drupal – Create a Garland Subtheme

Drupal – Create a Customized View

You can create you own customized view in Drupal with the help of the Drupal Views module. The Views module not only help you creating your own designed Pages but also the customized Blocks, Feed and Attachments. The following example shows you how to make use of the Views module to create a table view for all the Listed Item content type which i created a few days ago. You can refer to the following posts about for creating new content type.

 

Here comes the Views module. Continue reading Drupal – Create a Customized View

Linux – Get The Latest LAMP Package

Recently, i was working on setting up a Ubuntu 8.04 LTS (Handy Heron) server. i found that the PHP installed by apt-get is 5.2.4-2ubuntu5.12 and the PHP GD Library is not up-to-date and caused a warning in the Drupal report. I have to download the latest and stable packages in order to solve the problem.

Luckily, i found a very useful and up-to-date Debian repositories for my Ubuntu server. You could find the latest stable LAMP packages there. It is called Dotdeb. Just complete the following steps then you can connect to the Dotdeb repositories. Continue reading Linux – Get The Latest LAMP Package

Drupal – Field Modules for CCK

Yesterday, we have talked about how to create and customized a new content type with CCK. As i have mentioned, there are some CCK field modules such as Email and Date. This article will show you how to add a Email Field in the content type.

First, download the Email Field module to extract it to your modules folder. You will find the There is a Email option under the CCK module selection. Continue reading Drupal – Field Modules for CCK

Drupal – Create New Custom Content Type with CCK

By default, there are 3 content types bundled with a new Drupal Installation. They are Blog, Page and Story. But the Blog content type is not available until you have enabled the Blog module in Drupal Core. So if you want to create your own content type, what you need is the Content Construction Kit module (CCK).

The CCK module is a very common module in the Drupal community. With CCK, you could add more fields in any content type rather than just having Title and Body in the node. Moreover, there are some field modules which provide a standard and ready-to-use field types such as Link, Email, Date… etc. You could find more information in the references at the end of this post. Continue reading Drupal – Create New Custom Content Type with CCK

Apache – Setup the VirtualHost

Usually, people got more than one website in the Apache web server and sometimes they want to separate them into different domain names. This can be done by the Apache VirtualHost.

The following example is done in Mac MAMP, i guess the configuration on Linux and Windows should be similar. Let’s start now.

1. I have 2 folders in the Apache webroot folder

  • drupal-6.19 – The Drupal Application
  • HelloWorld – Folder contains simple HTML

Continue reading Apache – Setup the VirtualHost

MAMP – Introduction

MAMP is Apache, MySQL and PHP runs on Mac. For Mac users, it is very convenient to use the MAMP package such that they don’t need to install the those application one by one. Moreover, MAMP package also bundled with some other useful programs as well as libraries such as phpMyAdmin and the PHP GD library. For more information, you can refer to the MAMP website.

During the installation, you can include the MAMP control panel into you Mac Dashboard. This is quite helpful for you to start and stop the server. you can also pick either PHP4 or PHP5 by switching to the back panel by clicking the i button which is located under the Apache label on the front panel.

Continue reading MAMP – Introduction

富人移民潮與中國社會的無恥

    小時候我們院子裡有個掃廁所的老頭,看上去傻乎乎的,大家都看不起他。後來有一天,他突然成了新聞人物,因為他的兒子為了搶救國家財產被燒死了,成了革命烈士。開追悼會的時候,單位裡卻不准他這個父親去參加,因為他是“外國特務”。大人們私下裡議論,說這也太不像話了。我們那時候小,也不知道為什麼他就是個特務,但從此對他更加加強了革命警惕性。
 

    改革開放以後,這個老頭走了,回省城了,後來又到美國去了。我們這才陸陸續續聽到關於他的一些事情,原來他是解放初跟著錢學森一起回來的科學家,建國之初,一腔熱血,放棄美國舒適的生活條件,回到祖國,一心要為建設強大的祖國做貢獻。回來的時候,受到過周恩來總理的接見。可是回來不久就被打成了右派,下放勞動,天天掃廁所,最後不知怎麼又成了“外國特務”。文革中,他的夫人給整死了,唯一的兒子又成了革命烈士。而他卻連兒子的追悼會都不能參加。
 

    他後來回了美國,再也沒有回來。據說他走的時候,對朋友說:“這個國家、這個民族不值得愛。”不知道他是不是真的說了這個話,但我相信很可能他確實說了這樣的話。 Continue reading 富人移民潮與中國社會的無恥

Dream BIG and go for it =)