• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP bp_core_current_time函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: record_activity

 private static function record_activity($args = array())
 {
     // Default activity args
     $activity = array_merge(array('id' => null, 'user_id' => get_current_user_id(), 'type' => '', 'action' => '', 'item_id' => '', 'secondary_item_id' => '', 'content' => '', 'primary_link' => '', 'component' => 'dln-product-component', 'recorded_time' => bp_core_current_time(), 'hide_sitewide' => false), $args);
     // Add the activity
     return bp_activity_add($activity);
 }
开发者ID:httvncoder,项目名称:151722441,代码行数:7,代码来源:dln-buddypress-loader.php


示例2: create_item

 /**
  * Create a single message
  *
  * @param WP_REST_Request $request Full details about the request.
  * @return WP_Error|WP_REST_Response
  */
 public function create_item($request)
 {
     if (!empty($request['id'])) {
         return new WP_Error('bp_json_message_exists', __('Cannot create existing message.', BP_API_PLUGIN_SLUG), array('status' => 400));
     }
     $message = $this->prepare_item_for_database($request);
     $message_id = messages_new_message(array('sender_id' => $message->sender_id ? $message->sender_id : bp_loggedin_user_id(), 'thread_id' => $message->thread_id, 'recipients' => $message->recipients, 'subject' => $message->subject, 'content' => $message->content, 'date_sent' => $message->date_sent ? $message->date_sent : bp_core_current_time()));
     if (!$message_id) {
         return new WP_Error('bp_json_message_create', __('Error creating new message.', BP_API_PLUGIN_SLUG), array('status' => 500));
     }
     $this->update_additional_fields_for_object($message, $request);
     /**
      * Fires after a message is created via the REST API
      *
      * @param object $message Data used to create message
      * @param WP_REST_Request $request Request object.
      * @param bool $bool A boolean that is false.
      */
     do_action('bp_json_insert_message', $message, $request, false);
     $response = $this->get_item(array('id' => $message_id, 'context' => 'view'));
     $response = rest_ensure_response($response);
     $response->set_status(201);
     $response->header('Location', rest_url('/users/' . $message_id));
     return $response;
 }
开发者ID:buddyboss,项目名称:BP-API,代码行数:31,代码来源:bp-api-messages.php


示例3: friends_add_friend

function friends_add_friend($initiator_userid, $friend_userid, $force_accept = false)
{
    global $bp;
    $friendship = new BP_Friends_Friendship();
    if ((int) $friendship->is_confirmed) {
        return true;
    }
    $friendship->initiator_user_id = $initiator_userid;
    $friendship->friend_user_id = $friend_userid;
    $friendship->is_confirmed = 0;
    $friendship->is_limited = 0;
    $friendship->date_created = bp_core_current_time();
    if ($force_accept) {
        $friendship->is_confirmed = 1;
    }
    if ($friendship->save()) {
        if (!$force_accept) {
            // Add the on screen notification
            bp_core_add_notification($friendship->initiator_user_id, $friendship->friend_user_id, $bp->friends->id, 'friendship_request');
            // Send the email notification
            friends_notification_new_request($friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id);
            do_action('friends_friendship_requested', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id);
        } else {
            do_action('friends_friendship_accepted', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id);
        }
        return true;
    }
    return false;
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:29,代码来源:bp-friends-functions.php


示例4: __construct

 /**
  * Constructor.
  *
  * @param int $id Optional. ID of the message.
  */
 public function __construct($id = null)
 {
     $this->date_sent = bp_core_current_time();
     $this->sender_id = bp_loggedin_user_id();
     if (!empty($id)) {
         $this->populate($id);
     }
 }
开发者ID:jasonmcalpin,项目名称:BuddyPress,代码行数:13,代码来源:class-bp-messages-message.php


示例5: friends_record_activity

/**
 * Record an activity item related to the Friends component.
 *
 * A wrapper for {@link bp_activity_add()} that provides some Friends-specific
 * defaults.
 *
 * @since 1.0.0
 *
 * @see bp_activity_add() for more detailed description of parameters and
 *      return values.
 *
 * @param array|string $args {
 *     An array of arguments for the new activity item. Accepts all parameters
 *     of {@link bp_activity_add()}. The one difference is the following
 *     argument, which has a different default here:
 *     @type string $component Default: the id of your Friends component
 *                             (usually 'friends').
 * }
 * @return bool See {@link bp_activity_add()}.
 */
function friends_record_activity($args = '')
{
    if (!bp_is_active('activity')) {
        return false;
    }
    $r = wp_parse_args($args, array('user_id' => bp_loggedin_user_id(), 'action' => '', 'content' => '', 'primary_link' => '', 'component' => buddypress()->friends->id, 'type' => false, 'item_id' => false, 'secondary_item_id' => false, 'recorded_time' => bp_core_current_time(), 'hide_sitewide' => false));
    return bp_activity_add($r);
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:28,代码来源:bp-friends-activity.php


示例6: add_notification

 /**
  *
  * @param int $post_id
  * @param int $post_author_id
  * @param int $user_id
  *
  * @return int|bool  notification id on success or false
  */
 function add_notification($post_id, $post_author_id, $user_id)
 {
     global $rtmedia;
     $args_add_noification = array('item_id' => $post_id, 'user_id' => $post_author_id, 'component_name' => $this->component_id, 'component_action' => $this->component_action . $post_id, 'secondary_item_id' => $user_id, 'date_notified' => bp_core_current_time());
     if (isset($rtmedia->options['buddypress_enableNotification']) && 0 !== intval($rtmedia->options['buddypress_enableNotification'])) {
         return bp_notifications_add_notification($args_add_noification);
     }
     return false;
 }
开发者ID:rtCamp,项目名称:rtMedia,代码行数:17,代码来源:RTMediaNotification.php


示例7: create_object

 function create_object($args)
 {
     if (!isset($args['creator_id'])) {
         $args['creator_id'] = get_current_user_id();
     }
     $group_id = groups_create_group($args);
     groups_update_groupmeta($group_id, 'total_member_count', 1);
     groups_update_groupmeta($group_id, 'last_activity', bp_core_current_time());
     return $this->get_object_by_id($group_id);
 }
开发者ID:adisonc,项目名称:MaineLearning,代码行数:10,代码来源:bp-factory.php


示例8: EnrolledCourse

 public static function EnrolledCourse($student_id, $course_id, $status)
 {
     global $wpdb;
     $group_id = get_post_meta($course_id, 'buddypress_id', true);
     // Get BuddyPress
     $bp = buddypress();
     $group = $wpdb->get_row($wpdb->prepare("SELECT g.* FROM {$bp->groups->table_name} g WHERE g.id = %d", $group_id));
     groups_invite_user(array('user_id' => $student_id, 'group_id' => $group_id, 'inviter_id' => $group->creator_id, 'date_modified' => bp_core_current_time(), 'is_confirmed' => 1));
     $forums = bbp_get_group_forum_ids($group_id);
     bbp_add_user_forum_subscription(bbp_get_current_user_id(), $forums[0]);
 }
开发者ID:Bnei-Baruch,项目名称:mailchimpNamasteIntegration,代码行数:11,代码来源:CreateGroupAndForumForCourse.php


示例9: populate

 /**
  * Populate necessary variables.
  *
  * @since 1.0.0
  * @access protected
  *
  * @param int $muted_id The ID of the user to be muted.
  * @param int $user_id The ID of the user initiating the mute request.
  */
 protected function populate($muted_id, $user_id)
 {
     $this->muted_id = (int) $muted_id;
     $this->user_id = (int) $user_id;
     $this->date_recorded = bp_core_current_time();
     global $bp, $wpdb;
     $id = $wpdb->get_var($wpdb->prepare("SELECT id FROM {$bp->mute->table_name} WHERE muted_id = %d AND user_id = %d", $this->muted_id, $this->user_id));
     if ($id) {
         $this->id = $id;
     }
 }
开发者ID:sbrajesh,项目名称:buddypress-mute,代码行数:20,代码来源:class-mute.php


示例10: groups_update_last_activity

function groups_update_last_activity($group_id = 0)
{
    global $bp;
    if (empty($group_id)) {
        $group_id = $bp->groups->current_group->id;
    }
    if (empty($group_id)) {
        return false;
    }
    groups_update_groupmeta($group_id, 'last_activity', bp_core_current_time());
}
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:11,代码来源:bp-groups-activity.php


示例11: bp_course_add_notification

function bp_course_add_notification($args = '')
{
    global $bp;
    if (!bp_is_active('notifications') || !function_exists('bp_notifications_add_notification')) {
        return;
    }
    $defaults = array('user_id' => $bp->loggedin_user->id, 'item_id' => false, 'secondary_item_id' => false, 'component_name' => 'course', 'component_action' => '', 'date_notified' => bp_core_current_time(), 'is_new' => 1);
    $r = wp_parse_args($args, $defaults);
    extract($r);
    return bp_notifications_add_notification(array('user_id' => $user_id, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'component_name' => $component_name, 'component_action' => $component_action, 'date_notified' => $date_notified, 'is_new' => $is_new));
}
开发者ID:Nguyenkain,项目名称:Elearning,代码行数:11,代码来源:bp-course-activity.php


示例12: friends_record_activity

function friends_record_activity($args = '')
{
    global $bp;
    if (!bp_is_active('activity')) {
        return false;
    }
    $defaults = array('user_id' => $bp->loggedin_user->id, 'action' => '', 'content' => '', 'primary_link' => '', 'component' => $bp->friends->id, 'type' => false, 'item_id' => false, 'secondary_item_id' => false, 'recorded_time' => bp_core_current_time(), 'hide_sitewide' => false);
    $r = wp_parse_args($args, $defaults);
    extract($r, EXTR_SKIP);
    return bp_activity_add(array('user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide));
}
开发者ID:hornetalcala,项目名称:trunk,代码行数:11,代码来源:bp-friends-activity.php


示例13: groups_left_group

function groups_left_group($group_id, $user_id = 0)
{
    global $bp;
    if (empty($user_id)) {
        $user_id = bp_loggedin_user_id();
    }
    // Record this in activity streams
    groups_record_activity(array('type' => 'left_group', 'item_id' => $group_id, 'user_id' => $user_id));
    // Modify group meta
    groups_update_groupmeta($group_id, 'last_activity', bp_core_current_time());
    return true;
}
开发者ID:rpi-virtuell,项目名称:rw-social-learner,代码行数:12,代码来源:rw_functions.php


示例14: test_add

 /**
  * @group add
  */
 public function test_add()
 {
     $time = bp_core_current_time();
     $args = array('domain' => 'foo', 'path' => 'bar', 'title' => 'Foo bar', 'user_login' => 'user1', 'user_email' => '[email protected]', 'registered' => $time, 'activation_key' => '12345', 'meta' => array('field_1' => 'Foo Bar', 'meta1' => 'meta2'));
     $signup = BP_Signup::add($args);
     $this->assertNotEmpty($signup);
     $s = new BP_Signup($signup);
     // spot check
     $this->assertSame($signup, $s->id);
     $this->assertSame('user1', $s->user_login);
     $this->assertSame('12345', $s->activation_key);
 }
开发者ID:JeroenNouws,项目名称:BuddyPress,代码行数:15,代码来源:class-bp-signup.php


示例15: bp_media_record_activity

function bp_media_record_activity($args = '')
{
    global $bp;
    if (!function_exists('bp_activity_add')) {
        return false;
    }
    $defaults = array('id' => false, 'action' => '', 'content' => '', 'component' => BP_MEDIA_SLUG, 'type' => false, 'primary_link' => '', 'user_id' => $bp->loggedin_user->id, 'item_id' => false, 'secondary_item_id' => false, 'recorded_time' => bp_core_current_time(), 'hide_sitewide' => false);
    add_filter('bp_activity_allowed_tags', 'bp_media_override_allowed_tags');
    $r = wp_parse_args($args, $defaults);
    extract($r);
    $activity_id = bp_activity_add(array('id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide));
    return $activity_id;
}
开发者ID:rolandinsh,项目名称:buddypress-media,代码行数:13,代码来源:bp-media-functions.php


示例16: test_bp_xprofile_updated_profile_activity_outside_of_throttle

 /**
  * @group bp_xprofile_updated_profile_activity
  */
 public function test_bp_xprofile_updated_profile_activity_outside_of_throttle()
 {
     $d = $this->setup_updated_profile_data();
     $time = strtotime(bp_core_current_time());
     $prev_time = date('Y-m-d H:i:s', $time - 121 * 60);
     $now_time = date('Y-m-d H:i:s', $time);
     $this->factory->activity->create(array('user_id' => $d['u'], 'component' => buddypress()->profile->id, 'type' => 'updated_profile', 'recorded_time' => $prev_time));
     // Fake new/old values to ensure a change
     $old_values = array($this->updated_profile_data['f'] => array('value' => 'foo', 'visibility' => 'public'));
     $new_values = array($this->updated_profile_data['f'] => array('value' => 'foo2', 'visibility' => 'public'));
     $this->assertTrue(bp_xprofile_updated_profile_activity($d['u'], array($d['f']), false, $old_values, $new_values));
     $existing = bp_activity_get(array('max' => 1, 'filter' => array('user_id' => $d['u'], 'object' => buddypress()->profile->id, 'action' => 'updated_profile'), 'count_total' => 'count_query'));
     $this->assertEquals(1, $existing['total']);
 }
开发者ID:jasonmcalpin,项目名称:BuddyPress,代码行数:17,代码来源:activity.php


示例17: addUserFromCourseToGroup

 public static function addUserFromCourseToGroup($courseId, $groupId)
 {
     global $wpdb;
     if (get_current_user_id() != 30) {
         return;
     }
     $bp = buddypress();
     $group = $wpdb->get_row($wpdb->prepare("SELECT g.* FROM {$bp->groups->table_name} g WHERE g.id = %d", $groupId));
     $userIdList = $wpdb->get_results($wpdb->prepare("SELECT user_id FROM `wp_namaste_student_courses` WHERE course_id=%d", $courseId));
     foreach ($userIdList as $userId) {
         groups_invite_user(array('user_id' => $userId->user_id, 'group_id' => $groupId, 'inviter_id' => $group->creator_id, 'date_modified' => bp_core_current_time(), 'is_confirmed' => 1));
         $forums = bbp_get_group_forum_ids($groupId);
         bbp_add_user_forum_subscription($userId, $forums[0]);
     }
 }
开发者ID:Bnei-Baruch,项目名称:mailchimpNamasteIntegration,代码行数:15,代码来源:MailchimpIntegrationUtilities.php


示例18: bp_core_add_notification

/**
 * Add a notification for a specific user, from a specific component
 *
 * @deprecated Deprecated since BuddyPress 1.9.0. Use
 *  bp_notifications_add_notification() instead.
 *
 * @since BuddyPress (1.0)
 * @param string $item_id
 * @param int $user_id
 * @param string $component_name
 * @param string $component_action
 * @param string $secondary_item_id
 * @param string $date_notified
 * @param int $is_new
 * @return boolean True on success, false on fail
 */
function bp_core_add_notification($item_id, $user_id, $component_name, $component_action, $secondary_item_id = 0, $date_notified = false, $is_new = 1)
{
    // Bail if notifications is not active
    if (!bp_is_active('notifications')) {
        return false;
    }
    // Trigger the deprecated function notice
    _deprecated_function(__FUNCTION__, '1.9', 'bp_notifications_add_notification()');
    // Notifications must always have a time
    if (false === $date_notified) {
        $date_notified = bp_core_current_time();
    }
    // Add the notification
    return bp_notifications_add_notification(array('item_id' => $item_id, 'user_id' => $user_id, 'component_name' => $component_name, 'component_action' => $component_action, 'secondary_item_id' => $secondary_item_id, 'date_notified' => $date_notified, 'is_new' => $is_new));
}
开发者ID:danielcoats,项目名称:schoolpress,代码行数:31,代码来源:bp-members-notifications.php


示例19: friends_add_friend

/**
 * Create a new friendship.
 *
 * @since 1.0.0
 *
 * @param int  $initiator_userid ID of the "initiator" user (the user who is
 *                               sending the friendship request).
 * @param int  $friend_userid    ID of the "friend" user (the user whose friendship
 *                               is being requested).
 * @param bool $force_accept     Optional. Whether to force acceptance. When false,
 *                               running friends_add_friend() will result in a friendship request.
 *                               When true, running friends_add_friend() will result in an accepted
 *                               friendship, with no notifications being sent. Default: false.
 * @return bool True on success, false on failure.
 */
function friends_add_friend($initiator_userid, $friend_userid, $force_accept = false)
{
    // You cannot be friends with yourself!
    if ($initiator_userid == $friend_userid) {
        return false;
    }
    // Check if already friends, and bail if so.
    if (friends_check_friendship($initiator_userid, $friend_userid)) {
        return true;
    }
    // Setup the friendship data.
    $friendship = new BP_Friends_Friendship();
    $friendship->initiator_user_id = $initiator_userid;
    $friendship->friend_user_id = $friend_userid;
    $friendship->is_confirmed = 0;
    $friendship->is_limited = 0;
    $friendship->date_created = bp_core_current_time();
    if (!empty($force_accept)) {
        $friendship->is_confirmed = 1;
    }
    // Bail if friendship could not be saved (how sad!).
    if (!$friendship->save()) {
        return false;
    }
    // Send notifications.
    if (empty($force_accept)) {
        $action = 'requested';
        // Update friend totals.
    } else {
        $action = 'accepted';
        friends_update_friend_totals($friendship->initiator_user_id, $friendship->friend_user_id, 'add');
    }
    /**
     * Fires at the end of initiating a new friendship connection.
     *
     * This is a variable hook, depending on context.
     * The two potential hooks are: friends_friendship_requested, friends_friendship_accepted.
     *
     * @since 1.0.0
     *
     * @param int    $id                ID of the pending friendship connection.
     * @param int    $initiator_user_id ID of the friendship initiator.
     * @param int    $friend_user_id    ID of the friend user.
     * @param object $friendship        BuddyPress Friendship Object.
     */
    do_action('friends_friendship_' . $action, $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id, $friendship);
    return true;
}
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:63,代码来源:bp-friends-functions.php


示例20: _likebtn_bp_notifications_add_notification

function _likebtn_bp_notifications_add_notification($entity_name, $entity_id, $voter_id, $action)
{
    if (!in_array($action, array('like', 'dislike'))) {
        $action = 'like';
    }
    // No notifications from Anonymous
    if (!$voter_id) {
        return false;
    }
    $author_id = _likebtn_get_author_id($entity_name, $entity_id);
    if (!$author_id || $author_id == $voter_id) {
        return false;
    }
    bp_notifications_add_notification(array('user_id' => $author_id, 'item_id' => $entity_id, 'secondary_item_id' => $voter_id, 'component_name' => LIKEBTN_BP_COMPONENT_NAME, 'component_action' => 'likebtn_' . $entity_name . '_' . $action, 'date_notified' => bp_core_current_time(), 'is_new' => 1));
    // bp_notifications_add_meta($notification_id, 'entity_name', $entity_name, true)
}
开发者ID:pslorus,项目名称:WebsiteTinTuc,代码行数:16,代码来源:buddypress.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP bp_core_delete_account函数代码示例发布时间:2022-05-24
下一篇:
PHP bp_core_can_edit_settings函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap