當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BP_Activity_Activity::total_favorite_count方法代碼示例

本文整理匯總了PHP中BP_Activity_Activity::total_favorite_count方法的典型用法代碼示例。如果您正苦於以下問題:PHP BP_Activity_Activity::total_favorite_count方法的具體用法?PHP BP_Activity_Activity::total_favorite_count怎麽用?PHP BP_Activity_Activity::total_favorite_count使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BP_Activity_Activity的用法示例。


在下文中一共展示了BP_Activity_Activity::total_favorite_count方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: bp_activity_total_favorites_for_user

/**
 * Retrieve the number of favorite activity stream items a user has
 *
 * @since 1.2.0
 *
 * @param int $user_id
 *
 * @global object $bp BuddyPress global settings
 * @uses BP_Activity_Activity::total_favorite_count() {@link BP_Activity_Activity}
 *
 * @return int Total favorite count
 */
function bp_activity_total_favorites_for_user($user_id = 0)
{
    global $bp;
    // Fallback on displayed user, and then logged in user
    if (empty($user_id)) {
        $user_id = $bp->displayed_user->id ? $bp->displayed_user->id : $bp->loggedin_user->id;
    }
    return BP_Activity_Activity::total_favorite_count($user_id);
}
開發者ID:nxtclass,項目名稱:NXTClass,代碼行數:21,代碼來源:bp-activity-functions.php

示例2: bp_activity_total_favorites_for_user

/**
 * Retrieve the number of favorite activity stream items a user has.
 *
 * @since BuddyPress (1.2.0)
 *
 * @uses BP_Activity_Activity::total_favorite_count() {@link BP_Activity_Activity}
 *
 * @param int $user_id ID of the user whose favorite count is being requested.
 * @return int Total favorite count for the user.
 */
function bp_activity_total_favorites_for_user($user_id = 0)
{
    // Fallback on displayed user, and then logged in user
    if (empty($user_id)) {
        $user_id = bp_displayed_user_id() ? bp_displayed_user_id() : bp_loggedin_user_id();
    }
    return BP_Activity_Activity::total_favorite_count($user_id);
}
開發者ID:eresyyl,項目名稱:mk,代碼行數:18,代碼來源:bp-activity-functions.php

示例3: bp_activity_total_favorites_for_user

function bp_activity_total_favorites_for_user( $user_id = false ) {
	global $bp;

	if ( !$user_id )
		$user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;

	return BP_Activity_Activity::total_favorite_count( $user_id );
}
開發者ID:n-sane,項目名稱:zaroka,代碼行數:8,代碼來源:bp-activity.php


注:本文中的BP_Activity_Activity::total_favorite_count方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。