作者: 九把刀
其實係上年就已經睇完這本書,這亦是我看的第一部九把刀作品。係全城都對電影版瘋狂的時候,我還是比較想看看原著。
好熱血的一本書,一拿上手就不願放下,所以兩天就看完了。回想自己的青春,好像從沒做過一件熱血的事,最最最熱血應該是大學時的五人足球反敗為勝打進四強,哈哈。除了熱血,不得不提的是柯景騰的堅持,對夢想的執著,真真正正做到了一個很厲害的人…

I want to show the submitted exposed filter data in the Views header/footer. This can be done by retrieving the $view object in PHP. The following code will printed the exposed filter data. Apply it to the Views header/footer with PHP enabled.
Continue reading Drupal – Show exposed filter value in Views header/footer
I found a excellent article about creating a drop down menu using jQuery written by Abhishek Bhardwaj. For simplicity, i merge the .js file and the .html into one file.
Continue reading jQuery – Simple Dropdown Menu
In Drupal 6, you can get the term object using the following function
taxonomy_get_term($tid);
About 2 months ago i published a post on how to get the number of nodes of a specific taxonomy term by term ID.
Drupal – Get number of nodes of Taxonomy Term by Term ID
Unfortunately, the taxonomy_term_count_nodes() no longer works in Drupal 7 but you can get the count by Views in D7.
Continue reading Drupal 7 – Get number of nodes of Taxonomy Term in Views
Yesterday we have talked about converting URL into clickable link by Regular Expression.
PHP – Convert URL into clickable link by Regular Expression
If you want a more complete and robust solution, you can try the UrlLinker written by Søren Løvborg.
Continue reading PHP – Convert URL into clickable link with UrlLinker
I want to convert the all URLs in a string into clickable links. I found a solution in StackOverflow but probably it only works in PHP 5.2 since it uses eregi_replace() which is deprecated in PHP 5.3. So use it with cares.
Continue reading PHP – Convert URL into clickable link by Regular Expression
You can get the product picture by the product node id using the following function
print uc_product_get_picture(<product node id>, 'cart');
you can use any other ImageCache settings by replacing the ‘cart’ parameter.
Done =)
The following piece of codes check if the Drupal visitor is logged in or not.
...
if (user_is_logged_in()) {
// user is logged in
} else {
// anonymous user
{
...
Done =)
Reference: Drupal API – user_is_logged_in
Now we have OAuth 2.0 working with the Facebook Javascript SDK as mentioned in the last article.
Facebook Javascript SDK – A Simple Login Page with OAuth 2.0
The above example is incomplete as there is no logout link. Replace the fb-login-oauth2.php as follow. Continue reading Facebook Javascript SDK – Logout with OAuth 2.0