Skip to Content

Drupal

Drupal文章發佈日期圖形化

每每看到他站文章開頭都有著一本日曆來顯示發佈的日期,心中總是口水流不停,而在 Drupal 官網找版型時,通常只要有類似的畫面,不用說,馬上下載回來觀模,然而時至今日,才終於弄懂那是怎麼來的,所以趕緊寫下來,以免日後又忘了 哭泣

原來很簡單,只需要先查看網頁的原始碼,然後找到發佈日期在版型檔案 node.tpl.php 中的位置,在其之前,加入如下字碼︰

<?php
$year
= format_date($node->created, 'custom', 'Y');
$month = format_date($node->created, 'custom', 'M');
$day = format_date($node->created, 'custom', 'd');
?>

<div class="post-date">
<span class="post-month"><?php print $month; ?></span>
<span class="post-day"><?php print $day; ?></span>
<span class="post-year"><?php print $year; ?></span></div>

HTTP request status --> Fails

近來使用 Drupal 查看狀態報告時,常會看見如下訊息︰

HTTP request status	Fails
Your system or network configuration does not allow Drupal to access web pages, resulting in 
reduced functionality. This could be due to your webserver configuration or PHP settings, 
and should be resolved in order to download information about available updates, fetch 
aggregator feeds, sign in via OpenID, or use other network-dependent services.

中文語系則如下︰

HTTP 請求狀態	失敗
你的系統或網路設定,不允許 Drupal 存取這些網頁,導致功能減損。這可能是因為你的網站伺服器設定
或是 PHP 設定,你應該處理這些問題,才能下載可用的更新程式、取得聯播資訊源、透過 OpenID 登入、
或是使用其他依賴網路的服務。

原來我是個豬頭

改採用 Drupal 6.x 版本之後,一直感到很奇怪,怎麼 referres 的功能沒作用?
拜 Google 大神,沒找到相關的訊息,找 Drupal 官網,也是找不到有用的訊息 Sick

最後,不死心的,一個個的設置逐一查看,這才發現,自己是個豬頭 Tongue
原來我一直沒有啟用日誌記錄這個選項,難怪總是不會記錄 referres 了 Tongue

現在,總算啟用了,referres 記錄功能也正常操作了,終於不用再三跑到 google 查看那看不太懂的流量記錄了 大聲笑

訂閱文章