09 2009 档案
摘要:function ago($timestamp){ $difference = time() - $timestamp; $text = format_interval($difference, 2) . " 前"; return $text; }=--------------------------调用-----------ago($test->node_created) 例;1小时30分...
阅读全文
摘要:theme_image例;theme_image(($test->users_picture),'user/'.$test->uid)
阅读全文
摘要:drupal_substr($text, $start, $length = NULL)Drupal API 截取一段字符串例:l(drupal_substr($test->node_title, 0, 15).'...','node/'.$test->nid).
阅读全文
摘要:drupal 的views确很强大~但用起来很麻烦。所以我们可以自定义输出内容。<?phpecho '<h2>最新story</h2>';$result = db_query_range("SELECT n.nid, n.title FROM {node} n WHERE n.type = 'story' ORDER BY n.created DESC", 10);$...
阅读全文
摘要:format_date($timestamp, $type = 'medium', $format = '', $timezone = NULL, $langcode = NULL)$timestamp 确切的日期格式 要格式化的日期变量$type 要使用的格式(samll large medium custom)例 format_date($test->node_created,'cust...
阅读全文

浙公网安备 33010602011771号