当前位置: 首页>>代码示例>>PHP>>正文


PHP ap_meta_user_done函数代码示例

本文整理汇总了PHP中ap_meta_user_done函数的典型用法代码示例。如果您正苦于以下问题:PHP ap_meta_user_done函数的具体用法?PHP ap_meta_user_done怎么用?PHP ap_meta_user_done使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ap_meta_user_done函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ap_is_user_following

function ap_is_user_following($user_to_follow, $current_user_id = false)
{
    if ($current_user_id === false) {
        $user_id = get_current_user_id();
    }
    if ($current_user_id > 0) {
        $row = ap_meta_user_done('follower', $current_user_id, $user_to_follow);
        return $row > 0 ? true : false;
    }
    return false;
}
开发者ID:CasteyDaSilva,项目名称:anspress,代码行数:11,代码来源:follow.php

示例2: ap_is_user_subscribed

/**
 * Check if user is subscribed to question or term
 * @param  integer $action_id Question id or term id
 * @param  integer $user_id User id, default is current user id
 * @param  string|boolean $type Type of subscription, default is question
 * @return boolean
 * @since unknown
 */
function ap_is_user_subscribed($action_id, $user_id = false, $type = false)
{
    if ($user_id === false) {
        $user_id = get_current_user_id();
    }
    if ($user_id > 0) {
        if ($type === 'category') {
            $subscribe_type = 'category';
        } elseif ($type === 'tag') {
            $subscribe_type = 'tag';
        } else {
            $subscribe_type = false;
        }
        $row = ap_meta_user_done('subscriber', $user_id, $action_id, $subscribe_type);
        return $row > 0 ? true : false;
    }
    return false;
}
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:26,代码来源:subscriber.php

示例3: ap_get_total_unread_notification

/**
 * Count total numbers of unread notification
 * @param  boolean|integer 		$user_id
 * @return integer
 * @since  2.3
 */
function ap_get_total_unread_notification($user_id = false)
{
    if ($user_id === false) {
        $user_id = get_current_user_id();
    }
    return ap_meta_user_done('unread_notification', false, $user_id);
}
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:13,代码来源:notification.php

示例4: ap_is_already_viewed

function ap_is_already_viewed($user_id, $data_id, $type = 'post_view')
{
    $ip = sanitize_text_field($_SERVER['REMOTE_ADDR']);
    $done = ap_meta_user_done($type, $user_id, $data_id, false, $ip);
    return $done > 0 ? true : false;
}
开发者ID:kennyma603,项目名称:anspress,代码行数:6,代码来源:view.php

示例5: ap_is_user_flagged_comment

/**
 * Check if user flagged comment.
 *
 * @param bool|int $comment_id
 * @param bool|int $user_id
 *
 * @since  2.4
 *
 * @return bool
 */
function ap_is_user_flagged_comment($comment_id = false, $user_id = false)
{
    if (!is_user_logged_in()) {
        return false;
    }
    if (false === $comment_id) {
        $comment_id = get_comment_ID();
    }
    if (false === $user_id) {
        $user_id = get_current_user_id();
    }
    $done = ap_meta_user_done('comment_flag', $user_id, $comment_id);
    return $done > 0 ? true : false;
}
开发者ID:Byrlyne,项目名称:anspress,代码行数:24,代码来源:flag.php

示例6: ap_is_user_voted_closed

function ap_is_user_voted_closed($postid = false)
{
    if (is_user_logged_in()) {
        global $post;
        $postid = $postid ? $postid : $post->ID;
        $userid = get_current_user_id();
        $done = ap_meta_user_done('close', $userid, $postid);
        return $done > 0 ? true : false;
    }
    return false;
}
开发者ID:kennyma603,项目名称:anspress,代码行数:11,代码来源:vote.php

示例7: ap_is_already_viewed

function ap_is_already_viewed($user_id, $data_id, $type = 'question')
{
    $done = ap_meta_user_done('post_view', $user_id, $data_id);
    return $done > 0 ? true : false;
}
开发者ID:jessor,项目名称:anspress,代码行数:5,代码来源:anspress-view.php


注:本文中的ap_meta_user_done函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。