本文整理汇总了PHP中bp_loggedin_user_fullname函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_loggedin_user_fullname函数的具体用法?PHP bp_loggedin_user_fullname怎么用?PHP bp_loggedin_user_fullname使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_loggedin_user_fullname函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bp_legacy_theme_ajax_messages_send_reply
/**
* Send a private message reply to a thread via a POST request.
*
* @return string HTML
* @since BuddyPress (1.2)
*/
function bp_legacy_theme_ajax_messages_send_reply()
{
// Bail if not a POST action
if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
return;
}
check_ajax_referer('messages_send_message');
$result = messages_new_message(array('thread_id' => (int) $_REQUEST['thread_id'], 'content' => $_REQUEST['content']));
if (!empty($result)) {
// pretend we're in the message loop
global $thread_template;
bp_thread_has_messages(array('thread_id' => (int) $_REQUEST['thread_id']));
// set the current message to the 2nd last
$thread_template->message = end($thread_template->thread->messages);
$thread_template->message = prev($thread_template->thread->messages);
// set current message to current key
$thread_template->current_message = key($thread_template->thread->messages);
// now manually iterate message like we're in the loop
bp_thread_the_message();
// manually call oEmbed
// this is needed because we're not at the beginning of the loop
bp_messages_embed();
?>
<div class="message-box new-message <?php
bp_the_thread_message_css_class();
?>
">
<div class="message-metadata">
<?php
/**
* Fires before the single message header is displayed.
*
* @since BuddyPress (1.1.0)
*/
do_action('bp_before_message_meta');
?>
<?php
echo bp_loggedin_user_avatar('type=thumb&width=30&height=30');
?>
<strong><a href="<?php
echo bp_loggedin_user_domain();
?>
"><?php
bp_loggedin_user_fullname();
?>
</a> <span class="activity"><?php
printf(__('Sent %s', 'buddypress'), bp_core_time_since(bp_core_current_time()));
?>
</span></strong>
<?php
/**
* Fires after the single message header is displayed.
*
* @since BuddyPress (1.1.0)
*/
do_action('bp_after_message_meta');
?>
</div>
<?php
/**
* Fires before the message content for a private message.
*
* @since BuddyPress (1.1.0)
*/
do_action('bp_before_message_content');
?>
<div class="message-content">
<?php
bp_the_thread_message_content();
?>
</div>
<?php
/**
* Fires after the message content for a private message.
*
* @since BuddyPress (1.1.0)
*/
do_action('bp_after_message_content');
?>
<div class="clear"></div>
</div>
<?php
// clean up the loop
bp_thread_messages();
} else {
echo "-1<div id='message' class='error'><p>" . __('There was a problem sending that reply. Please try again.', 'buddypress') . '</p></div>';
}
//.........这里部分代码省略.........
示例2: bp_loggedin_user_link
<div class="col-md-3 col-sm-6 col-xs-8">
<div id="searchicon"><i class="icon-search-2"></i></div>
<?php
if (function_exists('bp_loggedin_user_link') && is_user_logged_in()) {
?>
<ul class="topmenu">
<li><a href="<?php
bp_loggedin_user_link();
?>
" class="smallimg vbplogin"><?php
$n = vbp_current_user_notification_count();
echo isset($n) && $n ? '<em></em>' : '';
bp_loggedin_user_avatar('type=full');
?>
<span><?php
bp_loggedin_user_fullname();
?>
</span></a></li>
<?php
do_action('wplms_header_top_login');
?>
<?php
if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins'))) || function_exists('is_plugin_active_for_network') && is_plugin_active_for_network('woocommerce/woocommerce.php')) {
global $woocommerce;
?>
<li><a class="smallimg vbpcart"><span class="fa fa-shopping-cart"><?php
echo $woocommerce->cart->cart_contents_count ? '<em>' . $woocommerce->cart->cart_contents_count . '</em>' : '';
?>
</span></a>
<div class="woocart"><?php
woocommerce_mini_cart();
示例3: bp_dtheme_ajax_messages_send_reply
/**
* Send a private message reply to a thread via a POST request.
*
* @return string HTML
* @since BuddyPress (1.2)
*/
function bp_dtheme_ajax_messages_send_reply()
{
// Bail if not a POST action
if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
return;
}
check_ajax_referer('messages_send_message');
$result = messages_new_message(array('thread_id' => $_REQUEST['thread_id'], 'content' => $_REQUEST['content']));
if ($result) {
?>
<div class="message-box new-message">
<div class="message-metadata">
<?php
do_action('bp_before_message_meta');
?>
<?php
echo bp_loggedin_user_avatar('type=thumb&width=30&height=30');
?>
<strong><a href="<?php
echo bp_loggedin_user_domain();
?>
"><?php
bp_loggedin_user_fullname();
?>
</a> <span class="activity"><?php
printf(__('Sent %s', 'logicalboneshug'), bp_core_time_since(bp_core_current_time()));
?>
</span></strong>
<?php
do_action('bp_after_message_meta');
?>
</div>
<?php
do_action('bp_before_message_content');
?>
<div class="message-content">
<?php
echo stripslashes(apply_filters('bp_get_the_thread_message_content', $_REQUEST['content']));
?>
</div>
<?php
do_action('bp_after_message_content');
?>
<div class="clear"></div>
</div>
<?php
} else {
echo "-1<div id='message' class='error'><p>" . __('There was a problem sending that reply. Please try again.', 'logicalboneshug') . '</p></div>';
}
exit;
}
示例4: bp_legacy_theme_ajax_messages_send_reply
/**
* Send a private message reply to a thread via a POST request.
*
* @return string HTML
* @since BuddyPress (1.2)
*/
function bp_legacy_theme_ajax_messages_send_reply()
{
// Bail if not a POST action
if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
return;
}
check_ajax_referer('messages_send_message');
$result = messages_new_message(array('thread_id' => (int) $_REQUEST['thread_id'], 'content' => $_REQUEST['content']));
if (!empty($result)) {
// Get the zebra line classes correct on ajax requests
global $thread_template;
bp_thread_has_messages(array('thread_id' => (int) $_REQUEST['thread_id']));
if ($thread_template->message_count % 2 == 1) {
$class = 'odd';
} else {
$class = 'even alt';
}
?>
<div class="message-box new-message <?php
echo $class;
?>
">
<div class="message-metadata">
<?php
do_action('bp_before_message_meta');
?>
<?php
echo bp_loggedin_user_avatar('type=thumb&width=30&height=30');
?>
<strong><a href="<?php
echo bp_loggedin_user_domain();
?>
"><?php
bp_loggedin_user_fullname();
?>
</a> <span class="activity"><?php
printf(__('Sent %s', 'buddypress'), bp_core_time_since(bp_core_current_time()));
?>
</span></strong>
<?php
do_action('bp_after_message_meta');
?>
</div>
<?php
do_action('bp_before_message_content');
?>
<div class="message-content">
<?php
echo stripslashes(apply_filters('bp_get_the_thread_message_content', $_REQUEST['content']));
?>
</div>
<?php
do_action('bp_after_message_content');
?>
<div class="clear"></div>
</div>
<?php
} else {
echo "-1<div id='message' class='error'><p>" . __('There was a problem sending that reply. Please try again.', 'buddypress') . '</p></div>';
}
exit;
}
示例5: widget
function widget($args, $instance)
{
extract($args);
echo $before_widget;
if (is_user_logged_in()) {
do_action('bp_before_sidebar_me');
?>
<div id="sidebar-me">
<div id="bpavatar">
<?php
bp_loggedin_user_avatar('type=full');
?>
</div>
<ul>
<li id="username"><a
href="<?php
bp_loggedin_user_link();
?>
"><?php
bp_loggedin_user_fullname();
?>
</a></li>
<li><a href="<?php
echo bp_loggedin_user_domain() . BP_XPROFILE_SLUG;
?>
/"
title="<?php
_e('View profile', 'vibe');
?>
"><?php
_e('View profile', 'vibe');
?>
</a>
</li>
<li id="vbplogout"><a href="<?php
echo wp_logout_url(get_permalink());
?>
"
id="destroy-sessions" rel="nofollow" class="logout"
title="<?php
_e('Log Out', 'vibe');
?>
"><i
class="icon-close-off-2"></i> <?php
_e('LOGOUT', 'vibe');
?>
</a></li>
<li id="admin_panel_icon"><?php
if (current_user_can("edit_posts")) {
echo '<a href="' . vibe_site_url() . 'wp-admin/" title="' . __('Access admin panel', 'vibe') . '"><i class="icon-settings-1"></i></a>';
}
?>
</li>
</ul>
<ul>
<?php
$loggedin_menu = array('courses' => array('icon' => 'icon-book-open-1', 'label' => __('Courses', 'vibe'), 'link' => bp_loggedin_user_domain() . BP_COURSE_SLUG), 'stats' => array('icon' => 'icon-analytics-chart-graph', 'label' => __('Stats', 'vibe'), 'link' => bp_loggedin_user_domain() . BP_COURSE_SLUG . '/' . BP_COURSE_STATS_SLUG));
if (bp_is_active('messages')) {
$loggedin_menu['messages'] = array('icon' => 'icon-letter-mail-1', 'label' => __('Inbox', 'vibe') . (messages_get_unread_count() ? ' <span>' . messages_get_unread_count() . '</span>' : ''), 'link' => bp_loggedin_user_domain() . BP_MESSAGES_SLUG);
$n = vbp_current_user_notification_count();
$loggedin_menu['notifications'] = array('icon' => 'icon-exclamation', 'label' => __('Notifications', 'vibe') . ($n ? ' <span>' . $n . '</span>' : ''), 'link' => bp_loggedin_user_domain() . BP_NOTIFICATIONS_SLUG);
}
if (bp_is_active('groups')) {
$loggedin_menu['groups'] = array('icon' => 'icon-myspace-alt', 'label' => __('Groups', 'vibe'), 'link' => bp_loggedin_user_domain() . BP_GROUPS_SLUG);
}
$loggedin_menu['settings'] = array('icon' => 'icon-settings', 'label' => __('Settings', 'vibe'), 'link' => bp_loggedin_user_domain() . BP_SETTINGS_SLUG);
$loggedin_menu = apply_filters('wplms_logged_in_top_menu', $loggedin_menu);
foreach ($loggedin_menu as $item) {
echo '<li><a href="' . $item['link'] . '"><i class="' . $item['icon'] . '"></i>' . $item['label'] . '</a></li>';
}
?>
</ul>
<?php
do_action('bp_sidebar_me');
?>
</div>
<?php
do_action('bp_after_sidebar_me');
/***** If the user is not logged in, show the log form and account creation link *****/
} else {
if (!isset($user_login)) {
$user_login = '';
}
do_action('bp_before_sidebar_login_form');
?>
<form name="login-form" id="vbp-login-form" class="standard-form"
action="<?php
echo apply_filters('wplms_login_widget_action', vibe_site_url('wp-login.php', 'login-post'));
?>
" method="post">
<label><?php
_e('Username', 'vibe');
?>
<br/>
<input type="text" name="log" id="side-user-login" class="input" tabindex="1"
value="<?php
echo esc_attr(stripslashes($user_login));
//.........这里部分代码省略.........
示例6: widget
function widget($args, $instance)
{
extract($args);
echo $before_widget;
if (is_user_logged_in()) {
do_action('bp_before_sidebar_me');
?>
<div id="sidebar-me">
<div id="bpavatar">
<a href="<?php
echo bp_loggedin_user_domain() . BP_XPROFILE_SLUG;
?>
/" title="<?php
_e('Thông tin cá nhân', 'vibe');
?>
"><?php
bp_loggedin_user_avatar('type=full');
?>
</a>
</div>
<ul style="width: 145px">
<li id="username"><a href="<?php
bp_loggedin_user_link();
?>
"><?php
bp_loggedin_user_fullname();
?>
</a></li>
<li><a href="<?php
echo bp_loggedin_user_domain() . BP_XPROFILE_SLUG;
?>
/" title="<?php
_e('Thông tin cá nhân', 'vibe');
?>
"><?php
_e('Thông tin cá nhân', 'vibe');
?>
</a></li>
<li id="vbplogout"><a href="<?php
echo wp_logout_url(get_permalink());
?>
" id="destroy-sessions" rel="nofollow" class="logout" title="<?php
_e('Đăng xuất', 'vibe');
?>
"><?php
_e('Đăng xuất', 'vibe');
?>
</a></li>
<li id="admin_panel_icon"><?php
if (current_user_can("edit_posts")) {
echo '<a href="' . vibe_site_url() . 'wp-admin/" title="' . __('Access admin panel', 'vibe') . '"><i class="icon-settings-1"></i></a>';
}
?>
</li>
</ul>
<ul>
<?php
function child_wplms_get_mycred_link()
{
$mycred = get_option('mycred_pref_core');
if (isset($mycred['buddypress']) && isset($mycred['buddypress']['history_url']) && isset($mycred['buddypress']['history_location']) && $mycred['buddypress']['history_location']) {
$link = bp_get_loggedin_user_link() . $mycred['buddypress']['history_url'];
} else {
$link = '#';
}
return $link;
}
$loggedin_menu = array('taikhoan' => array('icon' => 'icon-book-open-1', 'label' => __('Tài khoản: ' . apply_filters('get_point_user', ''), 'vibe'), 'link' => child_wplms_get_mycred_link()), 'naptientaokhoan' => array('icon' => 'icon-book-open-1', 'label' => __('Nạp tiền tài khoản', 'vibe'), 'link' => get_home_url() . '/thanh-toan-khoa-hoc/'), 'courses' => array('icon' => 'icon-book-open-1', 'label' => __('Khóa học của tôi', 'vibe'), 'link' => bp_loggedin_user_domain() . BP_COURSE_SLUG));
if (bp_is_active('messages')) {
$loggedin_menu['messages'] = array('icon' => 'icon-letter-mail-1', 'label' => __('Hộp thư đến', 'vibe') . (messages_get_unread_count() ? ' <span>' . messages_get_unread_count() . '</span>' : ''), 'link' => bp_loggedin_user_domain() . BP_MESSAGES_SLUG);
$n = vbp_current_user_notification_count();
// $loggedin_menu['notifications']=array(
// 'icon' => 'icon-exclamation',
// 'label' => __('Thông báo','vibe').(($n)?' <span>'.$n.'</span>':''),
// 'link' => bp_loggedin_user_domain().BP_NOTIFICATIONS_SLUG
// );
}
if (bp_is_active('groups')) {
$loggedin_menu['groups'] = array('icon' => 'icon-myspace-alt', 'label' => __('Nhóm', 'vibe'), 'link' => bp_loggedin_user_domain() . BP_GROUPS_SLUG);
}
$loggedin_menu = apply_filters('wplms_logged_in_top_menu', $loggedin_menu);
foreach ($loggedin_menu as $item) {
echo '<li><a href="' . $item['link'] . '"><i class="' . $item['icon'] . '"></i>' . $item['label'] . '</a></li>';
}
?>
</ul>
<?php
do_action('bp_sidebar_me');
?>
</div>
<?php
do_action('bp_after_sidebar_me');
/***** If the user is not logged in, show the log form and account creation link *****/
} else {
if (!isset($user_login)) {
$user_login = '';
}
do_action('bp_before_sidebar_login_form');
?>
//.........这里部分代码省略.........
示例7: mpp_add_comment
/**
* Adds a new comment to the database.
* A copy of wp_new_comment()
* @see wp_new_comment()
*/
function mpp_add_comment($commentdata)
{
//basic fields
//set to default
if (!isset($commentdata['comment_author'])) {
$commentdata['comment_author'] = bp_loggedin_user_fullname();
}
if (!isset($commentdata['comment_author_email'])) {
$commentdata['comment_author_email'] = bp_core_get_user_email(get_current_user_id());
}
if (!isset($commentdata['comment_author_url'])) {
$commentdata['comment_author_url'] = bp_loggedin_user_domain();
}
/**
* Filter a comment's data before it is sanitized and inserted into the database.
*
* @since 1.5.0
*
* @param array $commentdata Comment data.
*/
$commentdata = apply_filters('preprocess_comment', $commentdata);
$commentdata['comment_post_ID'] = (int) $commentdata['post_id'];
//media Id or Gallery ID
if (isset($commentdata['user_ID'])) {
$commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_ID'];
} elseif (isset($commentdata['user_id'])) {
$commentdata['user_id'] = (int) $commentdata['user_id'];
}
$commentdata['comment_parent'] = isset($commentdata['comment_parent']) ? absint($commentdata['comment_parent']) : 0;
//$parent_status = ( 0 < $commentdata['comment_parent'] ) ? wp_get_comment_status($commentdata['comment_parent']) : '';
$commentdata['comment_parent'] = $commentdata['comment_parent'] > 0 ? $commentdata['comment_parent'] : 0;
$commentdata['comment_author_IP'] = preg_replace('/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR']);
$commentdata['comment_agent'] = isset($_SERVER['HTTP_USER_AGENT']) ? substr($_SERVER['HTTP_USER_AGENT'], 0, 254) : '';
$commentdata['comment_date'] = current_time('mysql');
$commentdata['comment_date_gmt'] = current_time('mysql', 1);
$commentdata = wp_filter_comment($commentdata);
$commentdata['comment_approved'] = 1;
//make approved by default wp_allow_comment($commentdata);
$comment_ID = wp_insert_comment($commentdata);
do_action('mpp_comment_added', $comment_ID, $commentdata['comment_approved']);
return $comment_ID;
}