コード例 #1
0
 function widget($args, $instance)
 {
     extract($args, EXTR_SKIP);
     echo $before_widget;
     // set widget title when logged out
     if (!is_user_logged_in()) {
         $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
         if (!empty($title)) {
             echo $before_title . $title . $after_title;
         }
     }
     // start widget display code
     if (function_exists('bp_is_active')) {
         // check is user is logged in
         if (is_user_logged_in()) {
             echo "<div id='sidebarme'>";
             echo "<a href='" . bp_loggedin_user_domain() . "'>";
             echo bp_loggedin_user_avatar('type=thumb');
             echo "</a>";
             echo "<ul class='sidebarme-quicklinks'>";
             echo "<li class='sidebarme-username'>" . bp_core_get_userlink(bp_loggedin_user_id()) . "</li>";
             echo "<li class='sidebarme-profile'>";
             echo "<a href='" . bp_loggedin_user_domain() . "profile/edit'>" . __('Edit Profile', 'boss') . "</a>";
             echo " &middot; ";
             echo wp_loginout();
             echo "</li>";
             echo "</ul>";
             echo "</div>";
             // check if user is logged out
         } else {
             echo "<form name='login-form' id='sidebar-login-form' class='standard-form' action='" . site_url('wp-login.php', 'login_post') . "' method='post'>";
             echo "<label>" . __('Username', 'boss') . "</label>";
             $return = isset($_POST['value']) ? $_POST['value'] : '';
             $return .= "<input type='text' name='log' id='sidebar-user-login' class='input' value='";
             if (isset($user_login)) {
                 $return .= esc_attr(stripslashes($user_login));
             }
             $return .= "' tabindex='97' />";
             echo $return;
             echo "<label>" . __('Password', 'boss') . "</label>";
             echo "<input type='password' name='pwd' id='sidebar-user-pass' class='input' value='' tabindex='98' />";
             echo "<p class='forgetmenot'><input name='rememberme' type='checkbox' id='sidebar-rememberme' value='forever' tabindex='99' /> " . __('Remember Me', 'boss') . "</p>";
             echo do_action('bp_sidebar_login_form');
             echo "<input type='submit' name='wp-submit' id='sidebar-wp-submit' value='" . __('Log In', 'boss') . "' tabindex='100' />";
             if (bp_get_signup_allowed()) {
                 echo " <a class='sidebar-wp-register' href='" . bp_get_signup_page() . "'>" . __('Register', 'boss') . "</a>";
             }
             echo "</form>";
         }
     }
     // end widget display code
     echo $after_widget;
 }
コード例 #2
0
ファイル: class.front.php プロジェクト: hscale/webento
    function sidebar()
    {
        if (preg_match('|^([^\\?]+)|', $_SERVER['REQUEST_URI'], $match)) {
            $url = $match[0];
        } else {
            $url = get_option('siteurl');
        }
        $url = apply_filters('gconnect_login_redirect', $url);
        ?>
	<div class="widget gc-login-widget"><div class="padder">

	<?php 
        if ($this->theme->is_home()) {
            do_action('bp_inside_before_sidebar');
        }
        ?>

	<?php 
        if (is_user_logged_in()) {
            ?>
		<?php 
            do_action('bp_before_sidebar_me');
            ?>

			<div id="sidebar-me">
				<?php 
            bp_loggedin_user_avatar('type=thumb&width=40&height=40');
            ?>
				<h3><?php 
            echo bp_core_get_userlink(bp_loggedin_user_id());
            ?>
</h3>
				<a class="button" href="<?php 
            echo wp_logout_url(bp_get_root_domain());
            ?>
"><?php 
            _e('Log Out', 'buddypress');
            ?>
</a>
			<?php 
            do_action('bp_sidebar_me');
            ?>
			</div>
		<?php 
            do_action('bp_after_sidebar_me');
            ?>
	<?php 
        } else {
            ?>
		<?php 
            do_action('bp_before_sidebar_login_form');
            ?>

			<form name="login-form" id="login-form" class="standard-form" action="<?php 
            echo site_url('wp-login.php', 'login');
            ?>
" method="post">
				<label><?php 
            _e('Username', 'buddypress');
            ?>
<br />
				<input type="text" name="log" id="userbar_user_login" class="input" tabindex="97" /></label>

				<label><?php 
            _e('Password', 'buddypress');
            ?>
<br />
				<input type="password" name="pwd" id="userbar_user_pass" class="input" tabindex="98" /></label>

				<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="userbar_rememberme" value="forever" tabindex="99" /> <?php 
            _e('Remember Me', 'buddypress');
            ?>
</label></p>

				<input type="submit" name="wp-submit" id="userbar_wp-submit" value="<?php 
            _e('Log In', 'genesis-connect');
            ?>
" tabindex="100" />
				<input type="hidden" name="redirect_to" value="<?php 
            echo $url;
            ?>
" />
				<input type="hidden" name="testcookie" value="1" />
			</form>
		<?php 
            do_action('bp_after_sidebar_login_form');
            ?>

	<?php 
        }
        ?>

	<?php 
        if ($this->theme->is_home()) {
            do_action('bp_inside_after_sidebar');
        }
        ?>

	    </div></div><!-- .padder --><?php 
    }
コード例 #3
0
ファイル: ajax.php プロジェクト: hscale/webento
function bp_dtheme_ajax_messages_send_reply()
{
    global $bp;
    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 
        echo $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>';
    }
}
コード例 #4
0
/**
 *  buddypress login widget
 *
 * @package Custom Community
 * @since 1.8.3
 */
function cc_login_widget()
{
    ?>
	<?php 
    global $cap;
    ?>
		<?php 
    do_action('bp_inside_before_sidebar');
    ?>
	
		<?php 
    if (is_user_logged_in()) {
        ?>
	
			<?php 
        do_action('bp_before_sidebar_me');
        ?>
			<div class="widget">
			<div id="sidebar-me">
				<a href="<?php 
        echo bp_loggedin_user_domain();
        ?>
">
					<?php 
        bp_loggedin_user_avatar('type=thumb&width=40&height=40');
        ?>
				</a>
	
				<h4><?php 
        echo bp_core_get_userlink(bp_loggedin_user_id());
        ?>
</h4>
				<a class="button logout" href="<?php 
        echo wp_logout_url(bp_get_root_domain());
        ?>
"><?php 
        _e('Log Out', 'cc');
        ?>
</a>
	
				<?php 
        do_action('bp_sidebar_me');
        ?>
			</div>
			</div>
			<?php 
        do_action('bp_after_sidebar_me');
        ?>
	
			<?php 
        if (function_exists('bp_message_get_notices')) {
            ?>
				<?php 
            bp_message_get_notices();
            /* Site wide notices to all users */
            ?>
			<?php 
        }
        ?>
	
		<?php 
    } else {
        ?>
	
			<?php 
        do_action('bp_before_sidebar_login_form');
        ?>
			<div class="widget">
			<p id="login-text">
			<?php 
        if (!$cap->bp_login_sidebar_text) {
            ?>
				<?php 
            _e('To start connecting please log in first.', 'cc');
            ?>
			<?php 
        } else {
            ?>
				<?php 
            echo $cap->bp_login_sidebar_text;
            ?>
			<?php 
        }
        ?>
				<?php 
        if (bp_get_signup_allowed()) {
            ?>
					<?php 
            printf(__(' You can also <a href="%s" title="Create an account">create an account</a>.', 'cc'), site_url(BP_REGISTER_SLUG . '/'));
            ?>
				<?php 
        }
        ?>
			</p>
	
			<form name="login-form" id="sidebar-login-form" class="standard-form" action="<?php 
        echo site_url('wp-login.php', 'login_post');
        ?>
" method="post">
				<label><?php 
        _e('Username', 'cc');
        ?>
<br />
				<input type="text" name="log" id="sidebar-user-login" class="input" value="" /></label>
	
				<label><?php 
        _e('Password', 'cc');
        ?>
<br />
				<input type="password" name="pwd" id="sidebar-user-pass" class="input" value="" /></label>
	
				<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="sidebar-rememberme" value="forever" /> <?php 
        _e('Remember Me', 'cc');
        ?>
</label></p>
	
				<?php 
        do_action('bp_sidebar_login_form');
        ?>
				<input type="submit" name="wp-submit" id="sidebar-wp-submit" value="<?php 
        _e('Log In', 'cc');
        ?>
" tabindex="100" />
				<input type="hidden" name="testcookie" value="1" />
			</form>
			</div>
			<?php 
        do_action('bp_after_sidebar_login_form');
        ?>
		<?php 
    }
}
コード例 #5
0
wp_nav_menu($args);
?>
                    </div>
                    <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>' : '';
        ?>
コード例 #6
0
ファイル: ajax.php プロジェクト: raminjan/logicalbones_hug
/**
 * 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;
}
コード例 #7
0
ファイル: entry.php プロジェクト: angelmoratilla/digressit
			<?php 
    if (is_user_logged_in()) {
        ?>
			<form action="<?php 
        bp_activity_comment_form_action();
        ?>
" method="post" id="ac-form-<?php 
        bp_activity_id();
        ?>
" class="ac-form"<?php 
        bp_activity_comment_form_nojs_display();
        ?>
>
				<div class="ac-reply-avatar"><?php 
        bp_loggedin_user_avatar('width=25&height=25');
        ?>
</div>
				<div class="ac-reply-content">
					<div class="ac-textarea">
						<textarea id="ac-input-<?php 
        bp_activity_id();
        ?>
" class="ac-input" name="ac_input_<?php 
        bp_activity_id();
        ?>
"></textarea>
					</div>
					<input type="submit" name="ac_form_submit" value="<?php 
        _e('Post', 'buddypress');
        ?>
コード例 #8
0
ファイル: post-form.php プロジェクト: adisonc/MaineLearning
<form action="<?php 
bp_activity_post_form_action();
?>
" method="post" id="whats-new-form" name="whats-new-form">

	<?php 
do_action('bp_before_activity_post_form');
?>

	<div id="whats-new-avatar">
		<a href="<?php 
echo bp_loggedin_user_domain();
?>
">
			<?php 
bp_loggedin_user_avatar('width=60&height=60');
?>
		</a>
	</div>

	<h5>
		<?php 
printf(__("Comment on this link, %s?", 'buddypress-links'), bp_get_user_firstname());
?>
	</h5>

	<div id="whats-new-content">
		<div id="whats-new-textarea">
			<textarea name="whats-new" id="whats-new" value="" /><?php 
if (isset($_GET['r'])) {
    ?>
コード例 #9
0
    function widget($args, $instance)
    {
        extract($args);
        global $user_ID;
        $title = apply_filters('widget_title', empty($instance['title']) ? 'Entrar' : $instance['title']);
        if (empty($user_ID)) {
            echo $before_widget . $before_title . $title . $after_title;
            ?>
        <form name="loginform" id="loginform" action="<?php 
            print wp_login_url($_SERVER['REQUEST_URI']);
            ?>
" method="post">
            <fieldset>
                <label for="userLogin" class="login">Entrar:</label>
                <div class="formfield">
                    <div class="login inputDefault">
                    	<input type="text" name="log" id="userLogin" placeholder="Nome de usuário" tabindex="10" /></div>
                    <div class="pw inputDefault"><input type="password" name="pwd" class="userPass" placeholder="Senha" tabindex="20" /></div>
                    <div class="clearfix"></div>
                    <div class="forever">
                        <a  href="<?php 
            print wp_lostpassword_url();
            ?>
" title="Esqueci minha senha">Recuperar senha</a>
                        <div class="clearfix"></div>
                        <a href="<?php 
            print get_bloginfo('url');
            ?>
/cadastro" title="Esqueci minha senha">Não sou cadastrado</a>
                    </div>
                    <div class="clearfix"></div>
                    
                    <input name="submit" type="submit" id="submit" class="userSubmit submitDefault submit" value="Entrar">
                </div>
            </fieldset>
        </form>
        <?php 
            echo $after_widget;
            $before_widget_ = strstr('#', $before_widget);
            $before_pos = strpos('"', $before_widget_);
            $before_widget_ = substr($before_widget_, 0, $before_pos - 1);
        } else {
            echo $before_widget . $before_title . 'Minha conta' . $after_title;
            global $bp;
            ?>
	        <div class="panel">
		        <div class="bp-login-widget-user-link">Olá <?php 
            echo bp_core_get_userlink(bp_loggedin_user_id());
            ?>
</div>
		        <div class="clearfix"></div>
		        
		        <div class="bp-login-widget-user-avatar">
					<a href="<?php 
            echo bp_loggedin_user_domain();
            ?>
">
						<?php 
            bp_loggedin_user_avatar('type=thumb&width=50&height=50');
            ?>
					</a>
				</div>

				<div class="bp-login-widget-user-links">
					<div class="bp-login-widget-user-logout"><a class="logout" href="<?php 
            echo wp_logout_url(bp_get_requested_url());
            ?>
"><?php 
            _e('Log Out', 'buddypress');
            ?>
</a></div>
				</div>
			</div>

	        <?php 
            echo $after_widget;
        }
    }
コード例 #10
0
function swa_activity_entry($show_avatar = false)
{
    ?>
 <?php 
    do_action('bp_before_activity_entry');
    ?>
    <li class="<?php 
    bp_activity_css_class();
    ?>
" id="activity-<?php 
    bp_activity_id();
    ?>
">
            <?php 
    if ($show_avatar == "yes") {
        ?>
                      <div class="swa-activity-avatar">
                            <a href="<?php 
        bp_activity_user_link();
        ?>
">
                                    <?php 
        bp_activity_avatar('type=thumb&width=50&height=50');
        ?>
                            </a>

                    </div>
           <?php 
    }
    ?>
          <div class="swa-activity-content">
		<div class="swa-activity-header">
			<?php 
    bp_activity_action();
    ?>
		</div>

		<?php 
    if (bp_activity_has_content()) {
        ?>
			<div class="swa-activity-inner">
				<?php 
        bp_activity_content_body();
        ?>
			</div>
		<?php 
    }
    ?>

	<?php 
    do_action('bp_activity_entry_content');
    ?>
	<div class="swa-activity-meta">
            <?php 
    if (is_user_logged_in() && bp_activity_can_comment()) {
        ?>
				<a href="<?php 
        bp_activity_comment_link();
        ?>
" class="acomment-reply" id="acomment-comment-<?php 
        bp_activity_id();
        ?>
"><?php 
        _e('Reply', 'buddypress');
        ?>
 (<span><?php 
        bp_activity_comment_count();
        ?>
</span>)</a>
			<?php 
    }
    ?>
            <?php 
    if (is_user_logged_in()) {
        ?>
		<?php 
        if (!bp_get_activity_is_favorite()) {
            ?>
                    <a href="<?php 
            bp_activity_favorite_link();
            ?>
" class="fav" title="<?php 
            _e('Mark as Favorite', 'swa');
            ?>
"><?php 
            _e('Favorite', 'swa');
            ?>
</a>
		<?php 
        } else {
            ?>
                    <a href="<?php 
            bp_activity_unfavorite_link();
            ?>
" class="unfav" title="<?php 
            _e('Remove Favorite', 'swa');
            ?>
"><?php 
            _e('Remove Favorite', 'swa');
            ?>
</a>
		<?php 
        }
        ?>
            <?php 
    }
    ?>
            <?php 
    do_action('bp_activity_entry_meta');
    ?>
        </div>
	<div class="clear" ></div>
    </div>
    <?php 
    if ('activity_comment' == bp_get_activity_type()) {
        ?>
	<div class="swa-activity-inreplyto">
            <strong><?php 
        _e('In reply to', 'swa');
        ?>
</strong> - <?php 
        bp_activity_parent_content();
        ?>
 &middot;
            <a href="<?php 
        bp_activity_thread_permalink();
        ?>
" class="view" title="<?php 
        _e('View Thread / Permalink', 'swa');
        ?>
"><?php 
        _e('View', 'swa');
        ?>
</a>
	</div>
    <?php 
    }
    ?>
    <?php 
    if (bp_activity_can_comment()) {
        ?>
        <div class="swa-activity-comments">
        	<?php 
        bp_activity_comments();
        ?>
            <?php 
        if (is_user_logged_in()) {
            ?>
			<form action="<?php 
            bp_activity_comment_form_action();
            ?>
" method="post" id="swa-ac-form-<?php 
            bp_activity_id();
            ?>
" class="swa-ac-form"<?php 
            bp_activity_comment_form_nojs_display();
            ?>
>
				<div class="ac-reply-avatar"><?php 
            bp_loggedin_user_avatar('width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT);
            ?>
</div>
				<div class="ac-reply-content">
					<div class="ac-textarea">
						<textarea id="swa-ac-input-<?php 
            bp_activity_id();
            ?>
" class="ac-input" name="ac_input_<?php 
            bp_activity_id();
            ?>
"></textarea>
					</div>
					<input type="submit" name="swa_ac_form_submit" value="<?php 
            _e('Post', 'buddypress');
            ?>
 &rarr;" /> &nbsp; <?php 
            _e('or press esc to cancel.', 'buddypress');
            ?>
					<input type="hidden" name="comment_form_id" value="<?php 
            bp_activity_id();
            ?>
" />
				</div>
				<?php 
            wp_nonce_field('new_activity_comment', '_wpnonce_new_activity_comment');
            ?>
			</form>
			<?php 
        }
        ?>
	</div>
    <?php 
    }
    ?>
</li>
<?php 
    do_action('bp_after_swa_activity_entry');
    ?>

<?php 
}
コード例 #11
0
 * BuddyPress - Activity Post Form
 *
 * @package     myfossil
 * @subpackage  theme
 */
?>
<div id="user-left" name="user-left" class="sidebar sidebar-left">

    <div id="user-info" class="row section hidden-xs hidden-sm">
        <div class="col-xs-12 col-sm-12 col-lg-12">
            <a href="<?php 
echo bp_loggedin_user_domain();
?>
">
                <?php 
bp_loggedin_user_avatar('width=150&height=150');
?>
            </a>
        </div>
        <div class="col-xs-12 col-sm-12 col-lg-12" style="text-align: center">
            <h4 style="font-size: 1.4em"><?php 
echo bp_get_loggedin_user_fullname();
?>
</h4>
            <span class="username">@<?php 
echo bp_get_loggedin_user_username();
?>
</span>
        </div>
    </div>
    
コード例 #12
0
ファイル: navigation-menu.php プロジェクト: WeFoster/wefoster
		<?php 
    if (is_user_logged_in()) {
        ?>

			<?php 
        wff_bp_notifications_menu();
        ?>

			<li id="bp-profile-menu" class="dropdown menu-groups">

				<a href="<?php 
        echo bp_get_loggedin_user_link();
        ?>
" data-target="#" data-toggle="dropdown"
				   class="dropdown-toggle"><?php 
        echo bp_loggedin_user_avatar('type=thumb&width=70&height=70');
        ?>
					<?php 
        if (get_theme_mod('wf_plus_bp_menu_user_name', 'no') == 'yes') {
            ?>
						<span class="bp-profile-menu-name">
						 <?php 
            echo bp_core_get_user_displayname(bp_loggedin_user_id());
            ?>
						</span>
					<?php 
        } else {
            ?>
						<span class="visible-xs bp-profile-menu-name">
						<?php 
            echo bp_core_get_user_displayname(bp_loggedin_user_id());
コード例 #13
0
    /**
     * Display the login widget.
     *
     * @see WP_Widget::widget() for description of parameters.
     *
     * @param array $args     Widget arguments.
     * @param array $instance Widget settings, as saved by the user.
     */
    public function widget($args, $instance)
    {
        $title = isset($instance['title']) ? $instance['title'] : '';
        /**
         * Filters the title of the Login widget.
         *
         * @since 1.9.0
         * @since 2.3.0 Added 'instance' and 'id_base' to arguments passed to filter.
         *
         * @param string $title    The widget title.
         * @param array  $instance The settings for the particular instance of the widget.
         * @param string $id_base  Root ID for all widgets of this type.
         */
        $title = apply_filters('widget_title', $title, $instance, $this->id_base);
        echo $args['before_widget'];
        echo $args['before_title'] . esc_html($title) . $args['after_title'];
        ?>

		<?php 
        if (is_user_logged_in()) {
            ?>

			<?php 
            /**
             * Fires before the display of widget content if logged in.
             *
             * @since 1.9.0
             */
            do_action('bp_before_login_widget_loggedin');
            ?>

			<div class="bp-login-widget-user-avatar">
				<a href="<?php 
            echo bp_loggedin_user_domain();
            ?>
">
					<?php 
            bp_loggedin_user_avatar('type=thumb&width=50&height=50');
            ?>
				</a>
			</div>

			<div class="bp-login-widget-user-links">
				<div class="bp-login-widget-user-link"><?php 
            echo bp_core_get_userlink(bp_loggedin_user_id());
            ?>
</div>
				<div class="bp-login-widget-user-logout"><a class="logout" href="<?php 
            echo wp_logout_url(bp_get_requested_url());
            ?>
"><?php 
            _e('Log Out', 'buddypress');
            ?>
</a></div>
			</div>

			<?php 
            /**
             * Fires after the display of widget content if logged in.
             *
             * @since 1.9.0
             */
            do_action('bp_after_login_widget_loggedin');
            ?>

		<?php 
        } else {
            ?>

			<?php 
            /**
             * Fires before the display of widget content if logged out.
             *
             * @since 1.9.0
             */
            do_action('bp_before_login_widget_loggedout');
            ?>

			<form name="bp-login-form" id="bp-login-widget-form" class="standard-form" action="<?php 
            echo esc_url(site_url('wp-login.php', 'login_post'));
            ?>
" method="post">
				<label for="bp-login-widget-user-login"><?php 
            _e('Username', 'buddypress');
            ?>
</label>
				<input type="text" name="log" id="bp-login-widget-user-login" class="input" value="" />

				<label for="bp-login-widget-user-pass"><?php 
            _e('Password', 'buddypress');
            ?>
</label>
				<input type="password" name="pwd" id="bp-login-widget-user-pass" class="input" value="" <?php 
            bp_form_field_attributes('password');
            ?>
 />

				<div class="forgetmenot"><label for="bp-login-widget-rememberme"><input name="rememberme" type="checkbox" id="bp-login-widget-rememberme" value="forever" /> <?php 
            _e('Remember Me', 'buddypress');
            ?>
</label></div>

				<input type="submit" name="wp-submit" id="bp-login-widget-submit" value="<?php 
            esc_attr_e('Log In', 'buddypress');
            ?>
" />

				<?php 
            if (bp_get_signup_allowed()) {
                ?>

					<span class="bp-login-widget-register-link"><?php 
                printf(__('<a href="%s" title="Register for a new account">Register</a>', 'buddypress'), bp_get_signup_page());
                ?>
</span>

				<?php 
            }
            ?>

				<?php 
            /**
             * Fires inside the display of the login widget form.
             *
             * @since 2.4.0
             */
            do_action('bp_login_widget_form');
            ?>

			</form>

			<?php 
            /**
             * Fires after the display of widget content if logged out.
             *
             * @since 1.9.0
             */
            do_action('bp_after_login_widget_loggedout');
            ?>

		<?php 
        }
        echo $args['after_widget'];
    }
コード例 #14
0
ファイル: entry.php プロジェクト: n-sane/zaroka
	<?php if ( 'activity_comment' == bp_get_activity_type() ) : ?>
		<div class="activity-inreplyto">
			<strong><?php _e( 'In reply to', 'buddypress' ) ?></strong> - <?php bp_activity_parent_content() ?> &middot;
			<a href="<?php bp_activity_thread_permalink() ?>" class="view" title="<?php _e( 'View Thread / Permalink', 'buddypress' ) ?>"><?php _e( 'View', 'buddypress' ) ?></a>
		</div>
	<?php endif; ?>

	<?php do_action( 'bp_before_activity_entry_comments' ) ?>

	<?php if ( bp_activity_can_comment() ) : ?>
		<div class="activity-comments">
			<?php bp_activity_comments() ?>

			<?php if ( is_user_logged_in() ) : ?>
			<form action="<?php bp_activity_comment_form_action() ?>" method="post" id="ac-form-<?php bp_activity_id() ?>" class="ac-form"<?php bp_activity_comment_form_nojs_display() ?>>
				<div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ) ?></div>
				<div class="ac-reply-content">
					<div class="ac-textarea">
						<textarea id="ac-input-<?php bp_activity_id() ?>" class="ac-input" name="ac_input_<?php bp_activity_id() ?>"></textarea>
					</div>
					<input type="submit" name="ac_form_submit" value="<?php _e( 'Post', 'buddypress' ) ?> &rarr;" /> &nbsp; <?php _e( 'or press esc to cancel.', 'buddypress' ) ?>
					<input type="hidden" name="comment_form_id" value="<?php bp_activity_id() ?>" />
				</div>
				<?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ) ?>
			</form>
			<?php endif; ?>
		</div>
	<?php endif; ?>

	<?php do_action( 'bp_after_activity_entry_comments' ) ?>
</li>
コード例 #15
0
    function widget($args, $instance)
    {
        if (!parent::widget($args, $instance)) {
            return;
        }
        extract($args);
        echo $before_widget;
        $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : false);
        if ($title) {
            echo $before_title, $title, $after_title;
        }
        ?>

<?php 
        if (is_user_logged_in()) {
            ?>

	<?php 
            do_action('bp_before_sidebar_me');
            ?>

	<div id="sidebar-me" class="widget clearfix">
		<h3 class="widget-title">Welcome <?php 
            echo bp_core_get_userlink(bp_loggedin_user_id());
            ?>
</h3>
		<a href="<?php 
            echo bp_loggedin_user_domain();
            ?>
">
			<?php 
            bp_loggedin_user_avatar('type=thumb&width=40&height=40');
            ?>
		</a>

		<a class="button logout" href="<?php 
            echo wp_logout_url(wp_guess_url());
            ?>
"><?php 
            _e('Log Out', 'buddypress');
            ?>
</a>

		<?php 
            do_action('bp_sidebar_me');
            ?>
	</div>

	<?php 
            do_action('bp_after_sidebar_me');
            ?>

	<?php 
            if (bp_is_active('messages')) {
                ?>
		<?php 
                bp_message_get_notices();
                /* Site wide notices to all users */
                ?>
	<?php 
            }
            ?>

<?php 
        } else {
            ?>

	<?php 
            do_action('bp_before_sidebar_login_form');
            ?>

	<?php 
            if (bp_get_signup_allowed()) {
                ?>
	
		<p id="login-text">

			<?php 
                printf(__('<a href="%s" title="Create account" class="btn btn-primary btn-large">Create account to join community</a>', 'buddypress'), bp_get_signup_page());
                ?>

		</p>

	<?php 
            }
            ?>

	<form name="login-form" id="sidebar-login-form" class="standard-form widget" action="<?php 
            echo site_url('wp-login.php', 'login_post');
            ?>
" method="post">
		<h3 class="widget-title"><?php 
            _e('Login', 'bre-bootstrap-ecommerce');
            ?>
</h3>
		<label><?php 
            _e('Username', 'buddypress');
            ?>
<br />
		<input type="text" name="log" id="sidebar-user-login" class="input" value="<?php 
            if (isset($user_login)) {
                echo esc_attr(stripslashes($user_login));
            }
            ?>
" tabindex="97" /></label>

		<label><?php 
            _e('Password', 'buddypress');
            ?>
<br />
		<input type="password" name="pwd" id="sidebar-user-pass" class="input" value="" tabindex="98" /></label>

		<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="sidebar-rememberme" value="forever" tabindex="99" /> <?php 
            _e('Remember Me', 'buddypress');
            ?>
</label></p>

		<?php 
            do_action('bp_sidebar_login_form');
            ?>
		<input type="submit" name="wp-submit" id="sidebar-wp-submit" value="<?php 
            _e('Log In', 'buddypress');
            ?>
" tabindex="100" />
		<input type="hidden" name="redirect_to" value="<?php 
            echo $_SERVER['REQUEST_URI'];
            ?>
" />
		<input type="hidden" name="testcookie" value="1" />
	</form>

	<?php 
            do_action('bp_after_sidebar_login_form');
            ?>

<?php 
        }
        ?>

<?php 
        echo $after_widget;
    }
コード例 #16
0
ファイル: bp-core-widgets.php プロジェクト: eresyyl/mk
    /**
     * Display the login widget.
     *
     * @see WP_Widget::widget() for description of parameters.
     *
     * @param array $args Widget arguments.
     * @param array $instance Widget settings, as saved by the user.
     */
    public function widget($args, $instance)
    {
        $title = isset($instance['title']) ? $instance['title'] : '';
        $title = apply_filters('widget_title', $title);
        echo $args['before_widget'];
        echo $args['before_title'] . esc_html($title) . $args['after_title'];
        ?>

		<?php 
        if (is_user_logged_in()) {
            ?>

			<?php 
            do_action('bp_before_login_widget_loggedin');
            ?>

			<div class="bp-login-widget-user-avatar">
				<a href="<?php 
            echo bp_loggedin_user_domain();
            ?>
">
					<?php 
            bp_loggedin_user_avatar('type=thumb&width=50&height=50');
            ?>
				</a>
			</div>

			<div class="bp-login-widget-user-links">
				<div class="bp-login-widget-user-link"><?php 
            echo bp_core_get_userlink(bp_loggedin_user_id());
            ?>
</div>
				<div class="bp-login-widget-user-logout"><a class="logout" href="<?php 
            echo wp_logout_url(bp_get_requested_url());
            ?>
"><?php 
            _e('Log Out', 'buddypress');
            ?>
</a></div>
			</div>

			<?php 
            do_action('bp_after_login_widget_loggedin');
            ?>

		<?php 
        } else {
            ?>

			<?php 
            do_action('bp_before_login_widget_loggedout');
            ?>

			<form name="bp-login-form" id="bp-login-widget-form" class="standard-form" action="<?php 
            echo esc_url(site_url('wp-login.php', 'login_post'));
            ?>
" method="post">
				<label for="bp-login-widget-user-login"><?php 
            _e('Username', 'buddypress');
            ?>
</label>
				<input type="text" name="log" id="bp-login-widget-user-login" class="input" value="" />

				<label for="bp-login-widget-user-pass"><?php 
            _e('Password', 'buddypress');
            ?>
</label>
				<input type="password" name="pwd" id="bp-login-widget-user-pass" class="input" value=""  />

				<div class="forgetmenot"><label><input name="rememberme" type="checkbox" id="bp-login-widget-rememberme" value="forever" /> <?php 
            _e('Remember Me', 'buddypress');
            ?>
</label></div>

				<input type="submit" name="wp-submit" id="bp-login-widget-submit" value="<?php 
            esc_attr_e('Log In', 'buddypress');
            ?>
" />

				<?php 
            if (bp_get_signup_allowed()) {
                ?>

					<span class="bp-login-widget-register-link"><?php 
                printf(__('<a href="%s" title="Register for a new account">Register</a>', 'buddypress'), bp_get_signup_page());
                ?>
</span>

				<?php 
            }
            ?>

			</form>

			<?php 
            do_action('bp_after_login_widget_loggedout');
            ?>

		<?php 
        }
        echo $args['after_widget'];
    }
コード例 #17
0
/**
 * 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;
}
コード例 #18
0
ファイル: functions.php プロジェクト: songlequang/myclass
        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');
                ?>


                <h2 class="box-heading">Đăng nhập ITClass !</h2>

                <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">
                    <div class="col-md-6" style="padding: 0px 20px 10px">
                        <label><?php 
                _e('Đăng nhập với tài khoản ItClass', 'dangnhapitclass');
                ?>
</label>
                        <label><?php 
                _e('Tên đăng nhập', 'vibe');
                ?>
<br />
                            <input type="text" name="log" id="side-user-login" class="input" tabindex="1" value="<?php 
                echo esc_attr(stripslashes($user_login));
                ?>
" /></label>

                        <label><?php 
                _e('Mật khẩu', 'vibe');
                ?>
 <a href="<?php 
                echo wp_lostpassword_url(get_permalink());
                ?>
" tabindex="5" class="tip" title="<?php 
                _e('Forgot Password', 'vibe');
                ?>
"><i class="icon-question"></i></a><br />
                            <input type="password" tabindex="2" name="pwd" id="sidebar-user-pass" class="input" value="" /></label>

                        <p class="quenmatkhau"><label><input name="rememberme" tabindex="3" type="checkbox" id="sidebar-rememberme" value="forever" /><?php 
                _e('Ghi nhớ', 'vibe');
                ?>
   <a href="<?php 
                echo wp_lostpassword_url();
                ?>
"> Quên mật khẩu </a></label>

                        </p>

                        <?php 
                do_action('bp_sidebar_login_form');
                ?>
                        <!--                        <input type="submit" name="wp-submit" id="sidebar-wp-submit" tabindex="4" value="--><?php 
                //_e( 'Đăng nhập','vibe' );
                ?>
<!--" tabindex="100" /><p></p>-->
                        <span class="error-login">Tài khoản hoặc mật khẩu không đúng !</span>
                        <span class="btn btn-danger" id="id-dangnhap-it"><i style="display: none" class="noidungthongbaoloading icon-refresh glyphicon-refresh-animate"></i><?php 
                _e('Đăng nhập', 'vibe');
                ?>
</span><br/>
                        <input type="hidden" name="testcookie" value="1" />
                        <?php 
                if (bp_get_signup_allowed()) {
                    _e('Bạn chưa có tài khoản ? ', 'vibe');
                    printf(__('<a href="%s" class="vbpregister" title="' . __('Create an account', 'vibe') . '" tabindex="5" >' . __('Đăng ký', 'vibe') . '</a> ', 'vibe'), site_url(BP_REGISTER_SLUG . '/'));
                }
                ?>
                    </div>
                    <div class="box-separator"></div>
                    <div class="box-right">
                        <?php 
                //do_action( 'login_form' ); //BruteProtect FIX
                ?>
			<p class="comment-form-social-connect">
                           <label>Đăng nhập với mạng xã hội</label>
                        </p>
			<a href="http://it.myclass.vn/wp-login.php?loginFacebook=1&redirect=http://it.myclass.vn" onclick="window.location = 'http://it.myclass.vn/wp-login.php?loginFacebook=1&redirect='+window.location.href; return false;"><div class="social-btn"><i class="icon-facebook social-icon"></i><span class="btn-text">Đăng nhập bằng Facebook</span></div></a>
                    </div>

                </form>


                <?php 
                do_action('bp_after_sidebar_login_form');
            }
            echo $after_widget;
        }
コード例 #19
0
ファイル: entry.php プロジェクト: kosir/thatcamp-org
			<?php 
    if (is_user_logged_in() && bp_activity_can_comment()) {
        ?>

				<form action="<?php 
        bp_activity_comment_form_action();
        ?>
" method="post" id="ac-form-<?php 
        bp_activity_id();
        ?>
" class="ac-form"<?php 
        bp_activity_comment_form_nojs_display();
        ?>
>
					<div class="ac-reply-avatar"><?php 
        bp_loggedin_user_avatar('width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT);
        ?>
</div>
					<div class="ac-reply-content">
						<div class="ac-textarea">
							<textarea id="ac-input-<?php 
        bp_activity_id();
        ?>
" class="ac-input bp-suggestions" name="ac_input_<?php 
        bp_activity_id();
        ?>
"></textarea>
						</div>
						<input type="submit" name="ac_form_submit" value="<?php 
        esc_attr_e('Post', 'buddypress');
        ?>
コード例 #20
0
ファイル: post-form.php プロジェクト: justinwool/vortago
<form action="<?php 
bp_activity_post_form_action();
?>
" method="post" id="whats-new-form" name="whats-new-form" role="complementary">

	<?php 
do_action('bp_before_activity_post_form');
?>

	<div id="whats-new-avatar">
		<a href="<?php 
echo bp_loggedin_user_domain();
?>
">
			<?php 
bp_loggedin_user_avatar('width=65&height=65');
?>
		</a>
	</div>
	
	<p class="activity-greeting mom-main-font"><?php 
if (bp_is_group()) {
    printf(__("What's new in %s, %s?", 'buddypress'), bp_get_group_name(), bp_get_user_firstname());
} else {
    printf(__("What's new, %s?", 'buddypress'), bp_get_user_firstname());
}
?>
</p>

	<div id="whats-new-content">
		<div id="whats-new-textarea">
コード例 #21
0
ファイル: page-home-feed.php プロジェクト: phasstw/GaryClan
			<?php 
/**
 * Fires before the activity post form.
 *
 * @since 1.2.0
 */
do_action('bp_before_activity_post_form');
?>

			<div id="whats-new-avatar">
				<a href="<?php 
echo bp_loggedin_user_domain();
?>
">
					<?php 
bp_loggedin_user_avatar('type=full&width=' . bp_core_avatar_full_width() . '&height=' . bp_core_avatar_full_height());
?>
				</a>
			</div>

			<p class="activity-greeting">
				<?php 
printf(__("Welcome back, %s", 'buddypress'), bp_get_user_firstname(bp_get_loggedin_user_fullname()));
?>
			</p>
			

			<?php 
wp_nonce_field('post_update', '_wpnonce_post_update');
?>
			<?php 
コード例 #22
0
		    <div class="top-menu">
		    	<ul class="nav pull-right top-menu">

		    		<li>
		    			<span>
			    			<?php 
$current_user = wp_get_current_user();
printf("Hello, %s ", $current_user->user_firstname);
?>
							<a href="<?php 
echo bp_loggedin_user_domain();
?>
" title="View Profile">
			    			<?php 
bp_loggedin_user_avatar();
?>
			    			</a>
						</span>
					</li>
		    	</ul>
		    </div>
	    </header>
	    <!-- header end -->

	    <?php 
get_template_part('partials/side', 'nav');
?>

		<!-- ********************************************************
		MAIN CONTENT
コード例 #23
0
/**
 * 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>';
    }
    exit;
}
コード例 #24
0
function slider_avatar()
{
    ob_start();
    ?>
        <?php 
    if (is_user_logged_in()) {
        ?>

<div class="row">
    <div class="col-md-6 col-sm-6 col-xs-6">
                    <?php 
        bp_loggedin_user_avatar('type=thumb&width=50&height=50');
        ?>
    </div>

    <div class="col-md-6 col-sm-6 col-xs-6">

                    <p class="lead">Hello <?php 
        echo bp_core_get_userlink(bp_loggedin_user_id());
        ?>
, we have some new episodes! Make sure you go to your profile and <a href="<?php 
        echo bp_loggedin_user_domain();
        ?>
profile/change-avatar/">create your avatar!</a> Click <a href="<?php 
        echo esc_url(home_url(''));
        ?>
/shows">here</a> to watch episodes.</p>

    </div>
</div>


        <?php 
    } else {
        ?>


<div class="row">
    <div class="col-md-6 col-sm-6 col-xs-6">
                        <img src="<?php 
        echo plugin_dir_url(__FILE__) . 'images/placeholder.png';
        ?>
">
    </div>

    <div class="col-md-6 col-sm-6 col-xs-6">

            <p class="lead">Welcome to RainbowMe. Please login or join to enjoy the newest entertainment destination for every child.</p>

    </div>
</div>

        <?php 
    }
    ?>
  <?php 
    $myvariable = ob_get_clean();
    return $myvariable;
}
コード例 #25
0
ファイル: single.php プロジェクト: hakkens/davehakkens
    bp_messages_form_action();
    ?>
" method="post" class="standard-form">

      <div class="message-box">

        <div class="message-metadata">

          <?php 
    /** This action is documented in bp-templates/bp-legacy/buddypress-functions.php */
    do_action('bp_before_message_meta');
    ?>

          <div class="avatar-box">
            <?php 
    bp_loggedin_user_avatar('type=thumb&height=30&width=30');
    ?>

            <strong><?php 
    _e('Send a Reply', 'buddypress');
    ?>
</strong>
          </div>

          <?php 
    /** This action is documented in bp-templates/bp-legacy/buddypress-functions.php */
    do_action('bp_after_message_meta');
    ?>

        </div><!-- .message-metadata -->
コード例 #26
0
ファイル: bp-login-panel.php プロジェクト: hscale/webento
    ?>
<input type="hidden" name="redirect_to" value="<?php 
    echo bp_root_domain();
    ?>
" />
<input type="hidden" name="testcookie" value="1" />
<?php 
    do_action('bp_login_bar_logged_out');
    ?>
</form>
<?php 
} else {
    ?>
<div id="logout-link">
<?php 
    bp_loggedin_user_avatar('width=30&height=30');
    ?>
 &nbsp; <?php 
    bp_loggedinuser_link();
    ?>
 / <a href="<?php 
    echo wp_logout_url(bp_get_root_domain());
    ?>
"><?php 
    _e('Log Out', TEMPLATE_DOMAIN);
    ?>
</a>
<?php 
    do_action('bp_login_bar_logged_in');
    ?>
</div>
コード例 #27
0
			<div id="userInfo">
			<?php 
if (is_user_logged_in()) {
    ?>

		<?php 
    do_action('bp_before_sidebar_me');
    ?>

		
			<a href="<?php 
    echo bp_loggedin_user_domain();
    ?>
">
				<?php 
    bp_loggedin_user_avatar('type=thumb&width=40&height=40');
    ?>
			</a>

			<h4><?php 
    echo bp_core_get_userlink(bp_loggedin_user_id());
    ?>
</h4>
			<a class="button logout" href="<?php 
    echo wp_logout_url(bp_get_root_domain());
    ?>
"><?php 
    _e('Log Out', 'buddypress');
    ?>
</a>
コード例 #28
0
        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));
                ?>
"/></label>

					<label><?php 
                _e('Password', 'vibe');
                ?>
 <a
							href="<?php 
                echo wp_lostpassword_url(get_permalink());
                ?>
" tabindex="5" class="tip"
							title="<?php 
                _e('Forgot Password', 'vibe');
                ?>
"><i class="icon-question"></i></a><br/>
						<input type="password" tabindex="2" name="pwd" id="sidebar-user-pass" class="input"
						       value=""/></label>

					<p class=""><label><input name="rememberme" tabindex="3" type="checkbox" id="sidebar-rememberme"
					                          value="forever"/><?php 
                _e('Remember Me', 'vibe');
                ?>
</label></p>

					<?php 
                do_action('bp_sidebar_login_form');
                ?>
					<input type="submit" name="user-submit" id="sidebar-wp-submit"
					       value="<?php 
                _e('Log In', 'vibe');
                ?>
" tabindex="100"/>
					<input type="hidden" name="user-cookie" value="1"/>
					<?php 
                if (bp_get_signup_allowed()) {
                    printf(__('<a href="%s" class="vbpregister" title="' . __('Create an account', 'vibe') . '" tabindex="5" >' . __('Sign Up', 'vibe') . '</a> ', 'vibe'), site_url(BP_REGISTER_SLUG . '/'));
                }
                ?>
					<?php 
                do_action('login_form');
                //BruteProtect FIX
                ?>
				</form>


				<?php 
                do_action('bp_after_sidebar_login_form');
            }
            echo $after_widget;
        }
コード例 #29
0
ファイル: post-form.php プロジェクト: kosir/thatcamp-org
<form action="<?php 
bp_activity_post_form_action();
?>
" method="post" id="whats-new-form" name="whats-new-form" role="complementary">

	<?php 
do_action('bp_before_activity_post_form');
?>

	<div id="whats-new-avatar">
		<a href="<?php 
echo bp_loggedin_user_domain();
?>
">
			<?php 
bp_loggedin_user_avatar('width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height());
?>
		</a>
	</div>

	<h5><?php 
if (bp_is_group()) {
    printf(__("What's new in %s, %s?", 'buddypress'), bp_get_group_name(), bp_get_user_firstname());
} else {
    printf(__("What's new, %s?", 'buddypress'), bp_get_user_firstname());
}
?>
</h5>

	<div id="whats-new-content">
		<div id="whats-new-textarea">
コード例 #30
0
	function show_comment_form() {
		$activity_id = get_post_meta($this->id, 'bp_media_child_activity', true);
		if (bp_has_activities(array(
				'display_comments' => 'stream',
				'include' => $activity_id,
				'max' => 1
			))) :
			while (bp_activities()) : bp_the_activity();
				do_action('bp_before_activity_entry');
				?>
				<div class="activity">
					<ul id="activity-stream" class="activity-list item-list">
						<li class="activity activity_update" id="activity-<?php echo $activity_id; ?>">
							<div class="activity-content">
								<?php do_action('bp_activity_entry_content'); ?>
								<?php if (is_user_logged_in()) : ?>
									<div class="activity-meta no-ajax">
										<?php if (bp_activity_can_comment()) : ?>
											<a href="<?php bp_get_activity_comment_link(); ?>" class="button acomment-reply bp-primary-action" id="acomment-comment-<?php bp_activity_id(); ?>"><?php printf(__('Comment <span>%s</span>', 'buddypress'), bp_activity_get_comment_count()); ?></a>
										<?php endif; ?>
										<?php if (bp_activity_can_favorite()) : ?>
											<?php if (!bp_get_activity_is_favorite()) : ?>
												<a href="<?php bp_activity_favorite_link(); ?>" class="button fav bp-secondary-action" title="<?php esc_attr_e('Mark as Favorite', 'buddypress'); ?>"><?php _e('Favorite', 'buddypress') ?></a>
											<?php else : ?>
												<a href="<?php bp_activity_unfavorite_link(); ?>" class="button unfav bp-secondary-action" title="<?php esc_attr_e('Remove Favorite', 'buddypress'); ?>"><?php _e('Remove Favorite', 'buddypress') ?></a>
											<?php endif; ?>
										<?php endif; ?>
										<?php if (bp_activity_user_can_delete()) bp_activity_delete_link(); ?>
										<?php do_action('bp_activity_entry_meta'); ?>
									</div>
								<?php endif; ?>
							</div>
							<?php do_action('bp_before_activity_entry_comments'); ?>
							<?php if (( is_user_logged_in() && bp_activity_can_comment() ) || bp_activity_get_comment_count()) : ?>
								<div class="activity-comments">
									<?php bp_activity_comments(); ?>
									<?php if (is_user_logged_in()) : ?>
										<form action="<?php bp_activity_comment_form_action(); ?>" method="post" id="ac-form-<?php bp_activity_id(); ?>" class="ac-form"<?php bp_activity_comment_form_nojs_display(); ?>>
											<div class="ac-reply-avatar"><?php bp_loggedin_user_avatar('width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT); ?></div>
											<div class="ac-reply-content">
												<div class="ac-textarea">
													<textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input" name="ac_input_<?php bp_activity_id(); ?>"></textarea>
												</div>
												<input type="submit" name="ac_form_submit" value="<?php _e('Post', 'buddypress'); ?>" /> &nbsp; <?php _e('or press esc to cancel.', 'buddypress'); ?>
												<input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
											</div>
											<?php do_action('bp_activity_entry_comments'); ?>
											<?php wp_nonce_field('new_activity_comment', '_wpnonce_new_activity_comment'); ?>
										</form>
									<?php endif; ?>
								</div>
							<?php endif; ?>
							<?php do_action('bp_after_activity_entry_comments'); ?>
						</li>
					</ul>
				</div>
				<?php
			endwhile;
		else: ?>
			<div class="activity">
					<ul id="activity-stream" class="activity-list item-list">
						<li class="activity activity_update" id="activity-<?php echo $activity_id; ?>">
							<div class="activity-content">
								<?php do_action('bp_activity_entry_content'); ?>
								<?php if (is_user_logged_in()) : ?>
									<div class="activity-meta no-ajax">
																				
										<a href="<?php echo $this->get_delete_url(); ?>" class="button item-button bp-secondary-action delete-activity-single confirm" rel="nofollow">Delete</a>
									</div>
								<?php endif; ?>
							</div>
						</li>
					</ul>
				</div>
			<?
		endif;
	}