跳至主要內容
WordPress.org

Taiwan 正體中文

  • 佈景主題目錄
  • 外掛目錄
  • 最新消息
  • 技術支援
  • 關於我們
  • 團隊
  • 取得 WordPress
取得 WordPress
WordPress.org

Plugin Directory

User Object Framework

  • 提交外掛
  • 我的最愛
  • 登入
  • 提交外掛
  • 我的最愛
  • 登入

這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

User Object Framework

由 Jennifer M. Dodd 開發
下載
  • 詳細資料
  • 使用者評論
  • 安裝方式
  • 開發資訊
技術支援

外掛說明

This plugin creates a user-object relationship table and a user-object relationship metadata
table. Relationships between a user (logged-in or IP) are created and added to the relationship
table; metadata (ex. votes, flags, and ratings) is attached to that particular relationship
via the metadata table. This is a framework; it is intended for use in voting, flagging,
and similar user applications where a user-affiliated metadata is attached to an object.
Supported object tables include wp_posts, wp_comments, wp_users, and wp_bp_activity.

Functions are provided to add/get/delete relationships; metadata is added via the native WordPress
metadata-handling functions.
Functions provided by this framework include:

  • ucc_uof_object_reference() returns an array of object-integer assignments. Use this to look up the
    appropriate value for $object_ref based on the object table (wp_posts, wp_comments, wp_users,
    wp_bp_activity are currently supported) to which you are attaching a user relationship.
  • ucc_uof_add_relationship( $user_id = 0, $user_ip = 0, $object_id, $object_ref ) adds a relationship
    to the relationship table if none exists and returns the relationship id for that user/object pairing.
  • ucc_uof_delete_relationship( $user_id = 0, $user_ip = 0, $object_id, $object_ref ) will delete a
    relationship if there are no metadata entries left for that relationship.
  • ucc_uof_get_relationship() returns the relationship id for that user/object pairing.
  • ucc_uof_get_user_id() returns the current user id or 0 if not logged in.
  • ucc_uof_get_user_ip() returns 0 if the current user is logged in, or an ip2long() if anonymous.

Example code:

// Create or get the user-object relationship.
$relationship = ucc_uof_get_relationship( $user_id, $user_ip, $object_id, $object_ref );
if ( empty( $relationship ) )
    $relationship = ucc_uof_add_relationship( $user_id, $user_ip, $object_id, $object_ref );

// Add user_object_meta.
if ( $mode == 'delete' )
    delete_metadata( 'uof_user_object', $relationship, '_your_meta_key' );
else
    update_metadata( 'uof_user_object', $relationship, '_your_meta_key', 'your meta key value' );

安裝方式

  1. Upload the directory user-object-framework and its contents to the /wp-content/plugins/ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈User Object Framework〉的開發相關工作。

參與者
  • Jennifer M. Dodd

將〈User Object Framework〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄。

變更記錄

0.1

  • Initial release.

中繼資料

  • 版本 0.1
  • 最後更新 13 年前
  • 啟用安裝數 少於 10 次
  • WordPress 版本需求 3.4 或更新版本
  • 已測試相容的 WordPress 版本 3.4.2
  • 語言
    English (US)
  • 標籤
    frameworkmetadataobjectrelationshipuser
  • 進階檢視

評分

這個項目尚無任何評論記錄。

新增使用者評論

查看全部使用者評論

參與者

  • Jennifer M. Dodd

技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

檢視技術支援論壇

  • 關於我們
  • 最新消息
  • 主機代管
  • 隱私權
  • 展示網站
  • 佈景主題目錄
  • 外掛目錄
  • 區塊版面配置目錄
  • Learn
  • 技術支援
  • 開發者資源
  • WordPress.tv ↗
  • 共同參與
  • 活動
  • 贊助基金會 ↗
  • Five for the Future
  • WordPress.com ↗
  • Matt ↗
  • bbPress ↗
  • BuddyPress ↗
WordPress.org
WordPress.org

Taiwan 正體中文

  • 查看我們的 X (之前的 Twitter) 帳號
  • 造訪我們的 Bluesky 帳號
  • 造訪我們的 Mastodon 帳號
  • 造訪我們的 Threads 帳號
  • 造訪我們的 Facebook 粉絲專頁
  • Visit our Instagram account
  • Visit our LinkedIn account
  • 造訪我們的 TikTok 帳號
  • Visit our YouTube channel
  • 造訪我們的 Tumblr 帳號
程式碼,如詩
The WordPress® trademark is the intellectual property of the WordPress Foundation.