內容簡介
這個外掛會以UNIX時間戳記的格式記錄每個已登入的使用者最後一次造訪網站的時間,記錄將直接顯示在管理員面板的使用者清單表中。此外,外掛還提供了一些實用工具函式和挂鉤。
函式說明
user_last_visit( $user_id = "current", $verbose = TRUE );
參數:
混合型別的 $user_id,使用者 ID 或 "current" 代表當前使用者 (已登入的使用者)。預設值為 "current"。
布林型別的 $verbose,如果該值為 TRUE,返回的結果會是最後造訪時間的文字表示。預設值為 TRUE。
回傳值:
如果 $verbose 為 TRUE,則會返回一個字串。如果 $verbose 為 FALSE,則會返回最後一次造訪的UNIX時間戳記。當使用者未登入或尚未有任何紀錄時,該函式將會回傳 FALSE(如果 $verbose 為 FALSE),或是一個字串(如果 $verbose 為 TRUE)。
過濾器挂鉤
"ulv-can-record":位於 " ./includes/user-last-visit.class.php"中的第24行左右。
有些使用者或某些頁面可能會被排除在最後造訪的紀錄之外。有一個管理頁面可以做到這一點。但是你也可以透過這個掛鉤添加一些額外的過濾器。這個過濾器挂鉤是在wp_loaded操作內應用的,因此你必須在之前附加你的函式 (通常是在使用者驗證後,例如在init上)。
此外,你可以在你的主題/外掛中單獨使用 User_Last_Visit 類別。
可用的翻譯
法文
外掛標籤
開發者團隊
原文外掛簡介
The plugin keeps record in UNIX timstamp format of the last time each logged in user visits the site. Record for each user is directly
visible on the users list table in the admin panel. The plugin also provides some utility function and hook.
Function Description
user_last_visit( $user_id = "current", $verbose = TRUE );
Parameters :
mixed $user_id, the user ID or “current” for the current user (logged in user). default: “current”.
bool $verbose, if TRUE the result returned is a literal expression of the last visit time. default: TRUE.
Returned value :
If $verbose is TRUE a string is returned. If $verbose is FALSE the UNIX timestamp of last visit is returned. When the user is not logged in, or when there is no record yet, the function return FALSE if $verbose is set to FALSE, a string if $verbose is TRUE.
Filter Hook
"ulv-can-record" : located in "./includes/user-last-visit.class.php" around line #24
Some users or some pages can be excluded for last visit recording. There is an admin page for that. But you can also add some additional filtering via this hook. This filter hook is applied within a wp_loaded action. So you must attach your functions before that (typically on init, once the user is authenticated).
You can eventually use the User_Last_Visit class separately in your theme/plugin.
Available Translations
Français
