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


PHP ap_get_displayed_user_id函数代码示例

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


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

示例1: widget

 /**
  * Output widget
  * @param  array $args     Widget arguments.
  * @param  array $instance Widget instance.
  */
 public function widget($args, $instance)
 {
     global $ap_activities;
     $ap_activities = ap_get_activities(array('per_page' => 20, 'notification' => true, 'user_id' => ap_get_displayed_user_id()));
     echo $args['before_widget'];
     ap_get_template_part('widgets/notifications');
     echo $args['after_widget'];
 }
开发者ID:Byrlyne,项目名称:anspress,代码行数:13,代码来源:user_notification.php

示例2: ap_user_fields

function ap_user_fields($args = '', $group = false)
{
    if (ap_get_displayed_user_id() != get_current_user_id()) {
        return;
    }
    if (!$group) {
        $group = !isset($_GET['group']) ? 'basic' : sanitize_text_field($_GET['group']);
    }
    echo ap_user_get_fields($args, $group);
}
开发者ID:alaershov,项目名称:anspress,代码行数:10,代码来源:user-fields.php

示例3: insert_views

 public function insert_views($template)
 {
     //Log current time as user meta, so later we can check when user was active.
     if (is_user_logged_in()) {
         update_user_meta(get_current_user_id(), '__last_active', current_time('mysql'));
     }
     if (is_question()) {
         ap_insert_views(get_question_id(), 'question');
     }
     if (is_ap_user() && ap_get_displayed_user_id() != get_current_user_id() && ap_get_displayed_user_id()) {
         ap_insert_views(ap_get_displayed_user_id(), 'profile');
     }
 }
开发者ID:kennyma603,项目名称:anspress,代码行数:13,代码来源:view.php

示例4: widget

 public function widget($args, $instance)
 {
     $title = apply_filters('widget_title', $instance['title']);
     $number = $instance['number'];
     $avatar_size = $instance['avatar_size'];
     echo $args['before_widget'];
     if (!empty($title)) {
         echo $args['before_title'] . $title . $args['after_title'];
     }
     if (is_ap_user()) {
         $followers = ap_has_users(array('user_id' => ap_get_displayed_user_id(), 'sortby' => 'followers'));
         if ($followers->has_users()) {
             include ap_get_theme_location('widgets/followers.php');
         } else {
             _e('No followers yet', 'ap');
         }
     } else {
         _e('This widget can only be used in user page.', 'ap');
     }
     echo $args['after_widget'];
 }
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:21,代码来源:followers.php

示例5: widget

 public function widget($args, $instance)
 {
     $title = apply_filters('widget_title', $instance['title']);
     echo $args['before_widget'];
     if (!empty($title)) {
         echo $args['before_title'] . $title . $args['after_title'];
     }
     global $ap_user_query;
     if (is_user_logged_in()) {
         $ap_user_query = ap_has_users(array('ID' => ap_get_displayed_user_id()));
         if ($ap_user_query->has_users()) {
             while (ap_users()) {
                 ap_the_user();
                 ap_get_template_part('widgets/user');
             }
         }
     } else {
         _e('Login to see your profile links', 'ap');
     }
     echo $args['after_widget'];
 }
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:21,代码来源:user.php

示例6: ap_user_get_registered_date

/**
 * Get users registartion date
 * @return string   Date
 */
function ap_user_get_registered_date()
{
    global $ap_user_query;
    if (!isset($ap_user_query->user)) {
        return ap_get_displayed_user_id();
    }
    $user = $ap_user_query->user;
    return $user->data->user_registered;
}
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:13,代码来源:users-loop.php

示例7: following_page

 /**
  * Register followers page in AnsPress
  */
 public function following_page()
 {
     $following = ap_has_users(array('user_id' => ap_get_displayed_user_id(), 'sortby' => 'following'));
     if ($following->has_users()) {
         include ap_get_theme_location('user/following.php');
     } else {
         esc_attr_e('You are not following anyone.', 'anspress-question-answer');
     }
 }
开发者ID:alaershov,项目名称:anspress,代码行数:12,代码来源:class-user.php

示例8: ap_get_breadcrumbs

function ap_get_breadcrumbs()
{
    $current_page = get_query_var('ap_page');
    $title = ap_page_title();
    $a = array();
    $a['base'] = array('title' => ap_opt('base_page_title'), 'link' => ap_base_page_link(), 'order' => 0);
    if (is_question_tag()) {
        $a['tag'] = array('title' => __('Tags', 'ap'), 'link' => '', 'order' => 10);
    } elseif (is_question()) {
        $a['page'] = array('title' => substr($title, 0, 30) . (strlen($title) > 30 ? __('..', 'ap') : ''), 'link' => get_permalink(get_question_id()), 'order' => 10);
    } elseif ($current_page != 'base' && $current_page != '') {
        if ($current_page == 'user') {
            $a['page'] = array('title' => __('User', 'ap'), 'link' => ap_user_link(ap_get_displayed_user_id()), 'order' => 10);
            $a['user_page'] = array('title' => substr($title, 0, 30) . (strlen($title) > 30 ? __('..', 'ap') : ''), 'link' => ap_user_link(ap_get_displayed_user_id(), get_query_var('user_page')), 'order' => 10);
        } else {
            $a['page'] = array('title' => substr($title, 0, 30) . (strlen($title) > 30 ? __('..', 'ap') : ''), 'link' => ap_get_link_to($current_page), 'order' => 10);
        }
    }
    $a = apply_filters('ap_breadcrumbs', $a);
    return ap_sort_array_by_order($a);
}
开发者ID:haythameyd,项目名称:powrly,代码行数:21,代码来源:theme.php

示例9: __construct

 public function __construct($args = '')
 {
     // grab the current page number and set to 1 if no page number is set
     $this->paged = get_query_var('paged') ? get_query_var('paged') : 1;
     $this->offset = $this->per_page * ($this->paged - 1);
     $this->args = wp_parse_args($args, array('user_id' => ap_get_displayed_user_id(), 'number' => $this->per_page, 'offset' => $this->offset));
     $this->per_page = $this->args['number'];
     $this->query();
 }
开发者ID:Byrlyne,项目名称:anspress,代码行数:9,代码来源:reputation.php

示例10: ap_icon

            ?>

							</div>
						</div>
						<a href="#" data-action="ap_expand" data-expand="#user-summery"><?php 
            echo ap_icon('ellipsis', true);
            ?>
</a>
					</div>
				<?php 
        }
        ?>

				<div class="ap-user-buttons clearfix">
					<?php 
        ap_follow_button(ap_get_displayed_user_id());
        ?>

				</div>
			</div>
		<?php 
    }
    ?>

		<!-- Start  ap-profile-lr -->
		<div class="ap-user-lr">				
			<?php 
    ap_user_page();
    ?>

		</div>
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:31,代码来源:user.php

示例11: walker_nav_menu_start_el

 /**
  * Add user dropdown and notification menu
  * @param  string  $o        		   Menu html.
  * @param  object  $item               Menu item object.
  * @param  integer $depth              Menu depth.
  * @param  object  $args 			   Menu args.
  * @return string
  */
 public function walker_nav_menu_start_el($o, $item, $depth, $args)
 {
     if (!is_user_logged_in() && (ap_is_notification_menu($item) || ap_is_profile_menu($item))) {
         $o = '';
     }
     if (!ap_is_profile_active() && (ap_is_notification_menu($item) || ap_is_profile_menu($item))) {
         return '';
     }
     if (in_array('anspress-page-profile', $item->classes) && is_user_logged_in()) {
         $menus = ap_get_user_menu(get_current_user_id());
         $active_user_page = get_query_var('user_page') ? esc_attr(get_query_var('user_page')) : 'about';
         $o = '<a id="ap-user-menu-anchor" class="ap-dropdown-toggle" href="#">';
         $o .= get_avatar(get_current_user_id(), 80);
         $o .= '<span class="name">' . ap_user_display_name(get_current_user_id()) . '</span>';
         $o .= ap_icon('chevron-down', true);
         $o .= '</a>';
         $o .= '<ul id="ap-user-menu-link" class="ap-dropdown-menu ap-user-dropdown-menu">';
         foreach ($menus as $m) {
             $class = !empty($m['class']) ? ' ' . $m['class'] : '';
             $o .= '<li' . ($active_user_page == $m['slug'] ? ' class="active"' : '') . '>';
             $o .= '<a href="' . $m['link'] . '" class="ap-user-link-' . $m['slug'] . $class . '">';
             $o .= $m['title'] . '</a>';
             $o .= '</li>';
         }
         $o .= '</ul>';
     } elseif (in_array('anspress-page-notification', $item->classes) && is_user_logged_in()) {
         $o = '<a id="ap-user-notification-anchor" class="ap-dropdown-toggle ap-sidetoggle ' . ap_icon('globe') . '" href="#">' . ap_get_the_total_unread_notification(false, false) . '</a>';
         global $ap_activities;
         $ap_activities = ap_get_activities(array('per_page' => 20, 'notification' => true, 'user_id' => ap_get_displayed_user_id()));
         ob_start();
         ap_get_template_part('user/notification-dropdown');
         $o .= ob_get_clean();
     }
     return $o;
 }
开发者ID:deepakd92,项目名称:anspress,代码行数:43,代码来源:hooks.php

示例12: while

    while (ap_questions()) {
        ap_the_question();
        ?>
					<?php 
        ap_get_template_part('user/list-question');
        ?>
				<?php 
    }
    ?>

				<div class="ap-user-posts-footer">
					<?php 
    printf(__('More questions by %s', 'ap'), ap_user_get_the_display_name());
    ?>
					<a href="<?php 
    echo ap_user_link(ap_get_displayed_user_id(), 'questions');
    ?>
"><?php 
    _e('view', 'ap');
    ?>
&rarr;</a>
				</div>
			<?php 
} else {
    ?>

				<?php 
    _e('No question asked yet!', 'ap');
    ?>

			<?php 
开发者ID:kevinfodness,项目名称:anspress,代码行数:31,代码来源:about.php

示例13: while

	<ul class="ap-ul-inline clearfix">
		<?php 
while ($followers->users()) {
    $followers->the_user();
    ?>
			<li>
				<a class="ap-users-avatar" href="<?php 
    ap_user_the_link();
    ?>
" title="<?php 
    ap_user_the_display_name();
    ?>
">
					<?php 
    ap_user_the_avatar($avatar_size);
    ?>
				</a>
			</li>
		<?php 
}
?>
		
	</ul>
	<a class="ap-widget-all-link" href="<?php 
echo ap_user_link(ap_get_displayed_user_id(), 'followers');
?>
"><?php 
_e('View all followers &rarr;', 'ap');
?>
</a>
</div>
开发者ID:haythameyd,项目名称:powrly,代码行数:31,代码来源:followers.php

示例14: ap_hover_card_ajax_query

function ap_hover_card_ajax_query($user_id = false)
{
    if ($user_id === false) {
        $user_id = ap_get_displayed_user_id();
    }
    return 'action=ap_ajax&ap_ajax_action=user_cover&user_id=' . $user_id;
}
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:7,代码来源:user.php

示例15: ap_page_title

?>

<div id="ap-users" class="ap-users ap-user-activity">
	<h3 class="ap-user-page-title clearfix">
		<?php 
echo ap_page_title();
?>
	</h3>
	<?php 
if (ap_has_activities()) {
    ?>
		<div class="ap-activities">
			<?php 
    /* Start the Loop */
    while (ap_activities()) {
        ap_the_activity();
        ap_get_template_part('activity/item');
    }
    ?>
		</div>
	<?php 
    ap_activity_pagination(ap_user_link(ap_get_displayed_user_id(), 'activity-feed'));
    ?>
	<?php 
} else {
    ap_get_template_part('content-none');
}
?>
</div>

开发者ID:Byrlyne,项目名称:anspress,代码行数:29,代码来源:activity-feed.php


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