Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of module_invoke_all(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /home/.megatoes/geniusy/geniusy/drupal/modules/fuzzysearch/fuzzysearch.module on line 324
函数 | Geniusy's Blog

函数

Drupal常用API函数列表

comment_num_all($nid):调用评论数,$nid为node的ID,当前node可用$node->nid。

taxonomy_get_tree($vid):显示分类(item),vid为category的ID,必须是category,不能是item,也就是说只能显示父层下面的item。

taxonomy_get_children($tid):显示Item下面的item,$tid为父item的id。

menu_get_menu():Return the menu data structure.不带参数,显示系统所有的menu。

menu_primary_links($start_level = 1, $pid = 0):pid可以指定起始层数,start_level貌似意思也差不多,还没实验过,有时间试试再说,下面是英文说明:
$start_level This optional parameter can be used to retrieve a context-sensitive array of links at $start_level levels deep into the Primary links menu. The default is to return the top-level links.

$pid The parent menu ID from which to search for children. Defaults to the menu_primary_menu setting.

menu_overview_tree:Present the menu tree, rendered along with links to edit menu items.

menu_get_item($mid, $path = NULL):Retrieves the menu item specified by $mid, or by $path if $mid is not given.

node_last_viewed:Retrieves the timestamp at which the current user last viewed the specified node.放在首页可以返回用户上次访问网站的时间。

referer_uri:Return the URI of the referring page.可以用来统计来源页面。

request_uri:Since $_SERVER['REQUEST_URI'] is only available on Apache, we generate an equivalent using other environment variables.任何服务器系统下面都可以使用。

sess_count($timestamp = 0, $anonymous = true):Counts how many users have sessions. Can count either anonymous sessions, authenticated sessions, or both.貌似可以分别统计在线会员与游客数了。可以通过指定$timestam来实现15分钟内在线人数效果。

statistics_title_list($dbfield, $dbrows):
Description

Returns all time or today top or last viewed node(s).

Parameters

$dbfield one of

Tags: api, drupal, function, 函数, 功能