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

PHP bp_activity_clear_new_mentions函数代码示例

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

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



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

示例1: bp_dtheme_activity_template_loader

function bp_dtheme_activity_template_loader()
{
    global $bp;
    $scope = '';
    if (!empty($_POST['scope'])) {
        $scope = $_POST['scope'];
    }
    // We need to calculate and return the feed URL for each scope
    switch ($scope) {
        case 'friends':
            $feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/friends/feed/';
            break;
        case 'groups':
            $feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/groups/feed/';
            break;
        case 'favorites':
            $feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/favorites/feed/';
            break;
        case 'mentions':
            $feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/mentions/feed/';
            bp_activity_clear_new_mentions($bp->loggedin_user->id);
            break;
        default:
            $feed_url = home_url(bp_get_activity_root_slug() . '/feed/');
            break;
    }
    /* Buffer the loop in the template to a var for JS to spit out. */
    ob_start();
    gconnect_locate_template(array('activity/activity-loop.php'), true);
    $result['contents'] = ob_get_contents();
    $result['feed_url'] = apply_filters('bp_dtheme_activity_feed_url', $feed_url, $scope);
    ob_end_clean();
    echo json_encode($result);
}
开发者ID:hscale,项目名称:webento,代码行数:34,代码来源:ajax.php


示例2: bp_legacy_theme_activity_template_loader

/**
 * Load the activity loop template when activity is requested via AJAX,
 *
 * @return string JSON object containing 'contents' (output of the template loop
 * for the Activity component) and 'feed_url' (URL to the relevant RSS feed).
 *
 * @since BuddyPress (1.2)
 */
function bp_legacy_theme_activity_template_loader()
{
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    $scope = '';
    if (!empty($_POST['scope'])) {
        $scope = $_POST['scope'];
    }
    // We need to calculate and return the feed URL for each scope
    switch ($scope) {
        case 'friends':
            $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/friends/feed/';
            break;
        case 'groups':
            $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/groups/feed/';
            break;
        case 'favorites':
            $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/favorites/feed/';
            break;
        case 'mentions':
            $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/feed/';
            bp_activity_clear_new_mentions(bp_loggedin_user_id());
            break;
        default:
            $feed_url = home_url(bp_get_activity_root_slug() . '/feed/');
            break;
    }
    // Buffer the loop in the template to a var for JS to spit out.
    ob_start();
    bp_get_template_part('activity/activity-loop');
    $result['contents'] = ob_get_contents();
    /**
     * Filters the feed URL for when activity is requested via AJAX.
     *
     * @since BuddyPress (1.7.0)
     *
     * @param string $feed_url URL for the feed to be used.
     * @param string $scope    Scope for the activity request.
     */
    $result['feed_url'] = apply_filters('bp_legacy_theme_activity_feed_url', $feed_url, $scope);
    ob_end_clean();
    exit(json_encode($result));
}
开发者ID:kosir,项目名称:thatcamp-org,代码行数:53,代码来源:buddypress-functions.php


示例3: bp_activity_reset_my_new_mentions

/**
 * Reset the logged-in user's new mentions data when he visits his mentions screen.
 *
 * @since 1.5.0
 *
 * @uses bp_is_my_profile()
 * @uses bp_activity_clear_new_mentions()
 * @uses bp_loggedin_user_id()
 */
function bp_activity_reset_my_new_mentions()
{
    if (bp_is_my_profile()) {
        bp_activity_clear_new_mentions(bp_loggedin_user_id());
    }
}
开发者ID:dcavins,项目名称:buddypress-svn,代码行数:15,代码来源:bp-activity-screens.php


示例4: bp_dtheme_activity_template_loader

/**
 * Load the activity loop template when activity is requested via AJAX,
 *
 * @return string JSON object containing 'contents' (output of the template loop for the Activity component) and 'feed_url' (URL to the relevant RSS feed).
 * @since BuddyPress (1.2)
 */
function bp_dtheme_activity_template_loader()
{
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    $scope = '';
    if (!empty($_POST['scope'])) {
        $scope = $_POST['scope'];
    }
    // We need to calculate and return the feed URL for each scope
    switch ($scope) {
        case 'friends':
            $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/friends/feed/';
            break;
        case 'groups':
            $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/groups/feed/';
            break;
        case 'favorites':
            $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/favorites/feed/';
            break;
        case 'mentions':
            $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/feed/';
            bp_activity_clear_new_mentions(bp_loggedin_user_id());
            break;
        default:
            $feed_url = home_url(bp_get_activity_root_slug() . '/feed/');
            break;
    }
    // Buffer the loop in the template to a var for JS to spit out.
    ob_start();
    locate_template(array('activity/activity-loop.php'), true);
    $result['contents'] = ob_get_contents();
    $result['feed_url'] = apply_filters('bp_dtheme_activity_feed_url', $feed_url, $scope);
    ob_end_clean();
    exit(json_encode($result));
}
开发者ID:raminjan,项目名称:logicalbones_hug,代码行数:43,代码来源:ajax.php


示例5: bpcustom_activity_template_loader

function bpcustom_activity_template_loader()
{
    global $bp;
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    bpcustom_setup_components();
    $action = bpcustom_get_current_action();
    $scope = $action;
    // We need to calculate and return the feed URL for each scope
    switch ($scope) {
        case 'friends':
            $feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/friends/feed/';
            break;
        case 'groups':
            $feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/groups/feed/';
            break;
        case 'favorites':
            $feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/favorites/feed/';
            break;
        case 'mentions':
            $feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/mentions/feed/';
            bp_activity_clear_new_mentions($bp->loggedin_user->id);
            break;
        default:
            $feed_url = home_url(bp_get_activity_root_slug() . '/feed/');
            break;
    }
    /* Buffer the loop in the template to a var for JS to spit out. */
    ob_start();
    locate_template(array('members/single/activity.php'), true);
    $result = array();
    $result['contents'] = ob_get_contents();
    $result['feed_url'] = apply_filters('bp_dtheme_activity_feed_url', $feed_url, $scope);
    ob_end_clean();
    echo json_encode($result);
}
开发者ID:wesavetheworld,项目名称:bp-default-ajaxed-profile-tab,代码行数:38,代码来源:functions.php


示例6: test_bp_activity_remove_screen_notifications_on_new_mentions_cleared

 /**
  * @group bp_activity_remove_screen_notifications
  * @group mentions
  * @ticket BP6687
  */
 public function test_bp_activity_remove_screen_notifications_on_new_mentions_cleared()
 {
     $this->create_notifications();
     $notifications = BP_Notifications_Notification::get(array('item_id' => $this->a1));
     // Double check it's there
     $this->assertEquals(array($this->a1), wp_list_pluck($notifications, 'item_id'));
     $this->assertEquals(1, bp_get_total_mention_count_for_user($this->u1));
     // Clear notifications for $this->u1
     bp_activity_clear_new_mentions($this->u1);
     $notifications = BP_Notifications_Notification::get(array('item_id' => $this->a1));
     $this->assertEmpty($notifications, 'Notifications should be cleared when new mention metas are removed');
     $this->assertEmpty(bp_get_total_mention_count_for_user($this->u1));
 }
开发者ID:dcavins,项目名称:buddypress-svn,代码行数:18,代码来源:notifications.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP bp_activity_comment_form_action函数代码示例发布时间:2022-05-24
下一篇:
PHP bp_activity_can_favorite函数代码示例发布时间: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