コード例 #1
0
ファイル: widget_in.php プロジェクト: phuthuytinhoc/Demo1
?>
"> <?php 
echo $current_user->display_name;
?>
 <i class="fa fa-caret-down"></i>
    </a>
    
    <ul class="dropdown-menu">
        <li>

            <?php 
if (class_exists('bbpress')) {
    ?>
                 
                 <a href="<?php 
    bbp_user_profile_url($current_user->ID);
    ?>
" rel="me"><?php 
    _e('My Profile', 'magzilla');
    ?>
</a>
                 <a href="<?php 
    echo get_author_posts_url($current_user->ID);
    ?>
"><?php 
    _e('My Posts', 'magzilla');
    ?>
</a>
                 <!-- <a href="<?php 
    bbp_user_topics_created_url($current_user->ID);
    ?>
コード例 #2
0
	<?php 
if (!is_user_logged_in()) {
    echo 'Register/Login';
} else {
    echo 'Your Profile';
}
?>
</a>

<div id="login-form" style="display: none;">
	<?php 
if (is_user_logged_in()) {
    ?>
    <div class="fullwidth">
			<a id="author-avatar" href="<?php 
    bbp_user_profile_url(bbp_get_current_user_id());
    ?>
">
				<?php 
    echo get_avatar(bbp_get_current_user_id(), '64');
    ?>
			</a>
			<h4>Welcome back, <?php 
    bbp_user_profile_link(bbp_get_current_user_id());
    ?>
!</h4>
				<a href="<?php 
    echo bbp_get_user_profile_url(bbp_get_current_user_id());
    ?>
">Your Profile</a>
				 | 
コード例 #3
0
			</span>

		</div><!-- #author-avatar -->

		<div id="bbp-user-navigation">
			<ul>
				<li class="<?php 
if (bbp_is_single_user_profile()) {
    ?>
current<?php 
}
?>
">
					<span class="vcard bbp-user-profile-link">
						<a class="url fn n" href="<?php 
bbp_user_profile_url();
?>
" title="<?php 
printf(esc_attr__("%s's Profile", 'bbpress'), bbp_get_displayed_user_field('display_name'));
?>
" rel="me"><?php 
_e('Profile', 'bbpress');
?>
</a>
					</span>
				</li>

				<li class="<?php 
if (bbp_is_single_user_topics()) {
    ?>
current<?php 
    /**
     * Displays the output, the login form
     *
     * @since bbPress (r2827)
     *
     * @param mixed $args Arguments
     * @param array $instance Instance
     * @uses apply_filters() Calls 'bbp_login_widget_title' with the title
     * @uses get_template_part() To get the login/logged in form
     */
    public function widget($args = array(), $instance = array())
    {
        // Get widget settings
        $settings = $this->parse_settings($instance);
        // Typical WordPress filter
        $settings['title'] = apply_filters('widget_title', $settings['title'], $instance, $this->id_base);
        // bbPress filters
        $settings['title'] = apply_filters('bbp_login_widget_title', $settings['title'], $instance, $this->id_base);
        $settings['register'] = apply_filters('bbp_login_widget_register', $settings['register'], $instance, $this->id_base);
        $settings['lostpass'] = apply_filters('bbp_login_widget_lostpass', $settings['lostpass'], $instance, $this->id_base);
        echo $args['before_widget'];
        if (!empty($settings['title'])) {
            echo $args['before_title'] . $settings['title'] . $args['after_title'];
        }
        if (!is_user_logged_in()) {
            ?>
			<form method="post" action="<?php 
            bbp_wp_login_action(array('context' => 'login_post'));
            ?>
" class="bbp-login-form">
				<fieldset>
					<legend><?php 
            _e('Log In', 'bbpress');
            ?>
</legend>

					<div class="bbp-username form-group">
						<label for="user_login" class="sr-only"><?php 
            _e('Username', 'bbpress');
            ?>
: </label>
						<div class="input-group">
							<span class="input-group-addon">
								<span class="glyphicon ipt-icomoon-user"></span>
							</span>
							<input placeholder="<?php 
            _e('Username', 'bbpress');
            ?>
" class="form-control" type="text" name="log" value="<?php 
            bbp_sanitize_val('user_login', 'text');
            ?>
" size="20" id="user_login" tabindex="<?php 
            bbp_tab_index();
            ?>
" />
						</div>
					</div>

					<div class="bbp-password form-group">
						<label for="user_pass" class="sr-only"><?php 
            _e('Password', 'bbpress');
            ?>
: </label>
						<div class="input-group">
							<span class="input-group-addon">
								<span class="glyphicon ipt-icomoon-console"></span>
							</span>
							<input placeholder="<?php 
            _e('Password', 'bbpress');
            ?>
" class="form-control" type="password" name="pwd" value="<?php 
            bbp_sanitize_val('user_pass', 'password');
            ?>
" size="20" id="user_pass" tabindex="<?php 
            bbp_tab_index();
            ?>
" />
						</div>
					</div>

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

					<div class="bbp-remember-me checkbox">
						<input type="checkbox" name="rememberme" value="forever" <?php 
            checked(bbp_get_sanitize_val('rememberme', 'checkbox'), true, true);
            ?>
 id="rememberme" tabindex="<?php 
            bbp_tab_index();
            ?>
" />
						<label for="rememberme"><?php 
            _e('Remember Me', 'bbpress');
            ?>
</label>
					</div>

					<div class="bbp-submit-wrapper btn-group">
						<?php 
            if (!empty($settings['lostpass'])) {
                ?>
							<a href="<?php 
                echo esc_url($settings['lostpass']);
                ?>
" title="<?php 
                esc_attr_e('Lost Password', 'bbpress');
                ?>
" class="bbp-lostpass-link btn btn-default"><span class="glyphicon ipt-icomoon-info"></span></a>
						<?php 
            }
            ?>
						<?php 
            if (!empty($settings['register'])) {
                ?>
							<a href="<?php 
                echo esc_url($settings['register']);
                ?>
" title="<?php 
                esc_attr_e('Register', 'bbpress');
                ?>
" class="bbp-register-link btn btn-default"><span class="glyphicon ipt-icomoon-signup"></span> <?php 
                _e('Register', 'bbpress');
                ?>
</a>
						<?php 
            }
            ?>
						<button class="btn btn-primary" type="submit" name="user-submit" id="user-submit" tabindex="<?php 
            bbp_tab_index();
            ?>
" class="button submit user-submit"><span class="glyphicon ipt-icomoon-switch"></span> <?php 
            _e('Log In', 'bbpress');
            ?>
</button>
					</div>
					<?php 
            bbp_user_login_fields();
            ?>
				</fieldset>
			</form>

		<?php 
        } else {
            ?>

			<div class="bbp-logged-in">
				<a href="<?php 
            bbp_user_profile_url(bbp_get_current_user_id());
            ?>
" class="submit user-submit thumbnail pull-left"><?php 
            echo get_avatar(bbp_get_current_user_id(), '64');
            ?>
</a>
				<h4><?php 
            bbp_user_profile_link(bbp_get_current_user_id());
            ?>
</h4>
				<div class="btn-group">
					<a class="btn btn-default btn-sm" href="<?php 
            bbp_user_profile_edit_url(bbp_get_current_user_id());
            ?>
" title="<?php 
            printf(esc_attr__("Edit Your Profile", 'ipt_kb'));
            ?>
"><span class="glyphicon glyphicon-edit"></span> <?php 
            _e('Edit', 'bbpress');
            ?>
</a>
					<?php 
            bbp_logout_link();
            ?>
				</div>

				<div class="clearfix"></div>

				<div class="list-group">
					<a href="<?php 
            bbp_user_profile_url(bbp_get_current_user_id());
            ?>
" class="list-group-item bbp-user-forum-role <?php 
            if (bbp_is_user_home() && bbp_is_single_user_profile()) {
                echo 'active';
            }
            ?>
">
						<span class="glyphicon ipt-icomoon-user4"></span> <?php 
            printf(__('%s Forum Role', 'ipt_kb'), '<span class="badge">' . bbp_get_user_display_role(bbp_get_current_user_id()) . '</span>');
            ?>
					</a>
					<a href="<?php 
            bbp_user_topics_created_url(bbp_get_current_user_id());
            ?>
" class="list-group-item bbp-user-topic-count <?php 
            if (bbp_is_user_home() && bbp_is_single_user_topics()) {
                echo 'active';
            }
            ?>
">
						<span class="glyphicon ipt-icomoon-bubbles4"></span> <?php 
            printf(__('%s Topics Started', 'ipt_kb'), '<span class="badge">' . bbp_get_user_topic_count_raw(bbp_get_current_user_id()) . '</span>');
            ?>
					</a>
					<a href="<?php 
            bbp_user_replies_created_url(bbp_get_current_user_id());
            ?>
" class="list-group-item bbp-user-reply-count <?php 
            if (bbp_is_user_home() && bbp_is_single_user_replies()) {
                echo 'active';
            }
            ?>
">
						<span class="glyphicon ipt-icomoon-reply"></span> <?php 
            printf(__('%s Replies Created', 'ipt_kb'), '<span class="badge">' . bbp_get_user_reply_count_raw(bbp_get_current_user_id()) . '</span>');
            ?>
					</a>
					<?php 
            if (bbp_is_favorites_active()) {
                ?>
					<a href="<?php 
                bbp_favorites_permalink(bbp_get_current_user_id());
                ?>
" class="list-group-item bbp-user-favorite-count <?php 
                if (bbp_is_user_home() && bbp_is_favorites()) {
                    echo 'active';
                }
                ?>
" title="<?php 
                printf(esc_attr__("Your Favorites", 'ipt_kb'));
                ?>
">
						<span class="glyphicon ipt-icomoon-heart"></span> <?php 
                printf(__('%s Favorites', 'ipt_kb'), '<span class="badge">' . count(bbp_get_user_favorites_topic_ids(bbp_get_current_user_id())) . '</span>');
                ?>
					</a>
					<?php 
            }
            ?>
					<?php 
            if (bbp_is_subscriptions_active()) {
                ?>
					<a href="<?php 
                bbp_subscriptions_permalink(bbp_get_current_user_id());
                ?>
" class="list-group-item bbp-user-subscribe-count <?php 
                if (bbp_is_user_home() && bbp_is_subscriptions()) {
                    echo 'active';
                }
                ?>
" title="<?php 
                printf(esc_attr__("Your Subscriptions", 'ipt_kb'));
                ?>
">
						<span class="glyphicon ipt-icomoon-bookmarks"></span> <?php 
                printf(__('%s Subscriptions', 'ipt_kb'), '<span class="badge">' . count(bbp_get_user_subscribed_topic_ids(bbp_get_current_user_id())) . '</span>');
                ?>
					</a>
					<?php 
            }
            ?>
				</div>
			</div>

		<?php 
        }
        echo $args['after_widget'];
    }
コード例 #5
0
ファイル: widget_in.php プロジェクト: luskyj89/mt-wordpress
                <div class="cb-close"><span class="cb-close-modal"><i class="icon-remove"></i></span></div>
        </div>
        <div class="cb-lwa-profile">

            <div class="cb-avatar">
                    <?php 
    echo get_avatar($cb_author_id, $size = '150');
    ?>
            </div>

            <div class="cb-user-data clearfix">
                
                
                <div class="cb-block"><i class="icon-user"></i>
                    <a class="url fn n" href="<?php 
    bbp_user_profile_url($cb_author_id);
    ?>
" rel="me"><?php 
    _e('Profile', 'bbpress');
    ?>
</a>
                </div>

                <div class="cb-block"><i class="icon-comment"></i>
                    <a href="<?php 
    bbp_user_topics_created_url($cb_author_id);
    ?>
"><?php 
    _e('Topics Started', 'bbpress');
    ?>
</a>
コード例 #6
0
ファイル: user.php プロジェクト: CompositeUK/clone.bbPress
 /**
  * @covers ::bbp_user_profile_url
  * @covers ::bbp_get_user_profile_url
  */
 public function test_bbp_get_user_profile_url()
 {
     // Pretty permalinks
     $this->set_permalink_structure('/%postname%/');
     $profile_url = 'http://' . WP_TESTS_DOMAIN . '/forums/users/' . $this->keymaster_userdata->user_nicename . '/';
     $user_profile_url = bbp_get_user_profile_url($this->keymaster_id);
     // String.
     $this->assertSame($profile_url, $user_profile_url);
     // Output.
     $this->expectOutputString($profile_url);
     bbp_user_profile_url($this->keymaster_id);
     ob_clean();
     // Ugly permalinks
     $this->set_permalink_structure();
     $profile_url = 'http://' . WP_TESTS_DOMAIN . '/?bbp_user=' . $this->keymaster_id;
     $user_profile_url = bbp_get_user_profile_url($this->keymaster_id);
     // String.
     $this->assertSame($profile_url, $user_profile_url);
     // Output.
     $this->expectOutputString($profile_url);
     bbp_user_profile_url($this->keymaster_id);
 }
コード例 #7
0
ファイル: bbp-core-widgets.php プロジェクト: rmccue/bbPress
    /**
     * Displays the output, the login form
     *
     * @since bbPress (r2827)
     *
     * @param mixed $args Arguments
     * @param array $instance Instance
     * @uses apply_filters() Calls 'bbp_login_widget_title' with the title
     * @uses get_template_part() To get the login/logged in form
     */
    public function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('bbp_login_widget_title', $instance['title']);
        $register = apply_filters('bbp_login_widget_register', $instance['register']);
        $lostpass = apply_filters('bbp_login_widget_lostpass', $instance['lostpass']);
        echo $before_widget;
        if (!empty($title)) {
            echo $before_title . $title . $after_title;
        }
        if (!is_user_logged_in()) {
            ?>

			<form method="post" action="<?php 
            bbp_wp_login_action(array('context' => 'login_post'));
            ?>
" class="bbp-login-form">
				<fieldset>
					<legend><?php 
            _e('Log In', 'bbpress');
            ?>
</legend>

					<div class="bbp-username">
						<label for="user_login"><?php 
            _e('Username', 'bbpress');
            ?>
: </label>
						<input type="text" name="log" value="<?php 
            bbp_sanitize_val('user_login', 'text');
            ?>
" size="20" id="user_login" tabindex="<?php 
            bbp_tab_index();
            ?>
" />
					</div>

					<div class="bbp-password">
						<label for="user_pass"><?php 
            _e('Password', 'bbpress');
            ?>
: </label>
						<input type="password" name="pwd" value="<?php 
            bbp_sanitize_val('user_pass', 'password');
            ?>
" size="20" id="user_pass" tabindex="<?php 
            bbp_tab_index();
            ?>
" />
					</div>

					<div class="bbp-remember-me">
						<input type="checkbox" name="rememberme" value="forever" <?php 
            checked(bbp_get_sanitize_val('rememberme', 'checkbox'), true, true);
            ?>
 id="rememberme" tabindex="<?php 
            bbp_tab_index();
            ?>
" />
						<label for="rememberme"><?php 
            _e('Remember Me', 'bbpress');
            ?>
</label>
					</div>

					<div class="bbp-submit-wrapper">

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

						<button type="submit" name="user-submit" id="user-submit" tabindex="<?php 
            bbp_tab_index();
            ?>
" class="button submit user-submit"><?php 
            _e('Log In', 'bbpress');
            ?>
</button>

						<?php 
            bbp_user_login_fields();
            ?>

					</div>

					<?php 
            if (!empty($register) || !empty($lostpass)) {
                ?>

						<div class="bbp-login-links">

							<?php 
                if (!empty($register)) {
                    ?>

								<a href="<?php 
                    echo esc_url($register);
                    ?>
" title="<?php 
                    _e('Register', 'bbpress');
                    ?>
" class="bbp-register-link"><?php 
                    _e('Register', 'bbpress');
                    ?>
</a>

							<?php 
                }
                ?>

							<?php 
                if (!empty($lostpass)) {
                    ?>

								<a href="<?php 
                    echo esc_url($lostpass);
                    ?>
" title="<?php 
                    _e('Lost Password', 'bbpress');
                    ?>
" class="bbp-lostpass-link"><?php 
                    _e('Lost Password', 'bbpress');
                    ?>
</a>

							<?php 
                }
                ?>

						</div>

					<?php 
            }
            ?>

				</fieldset>
			</form>

		<?php 
        } else {
            ?>

			<div class="bbp-logged-in">
				<a href="<?php 
            bbp_user_profile_url(bbp_get_current_user_id());
            ?>
" class="submit user-submit"><?php 
            echo get_avatar(bbp_get_current_user_id(), '40');
            ?>
</a>
				<h4><?php 
            bbp_user_profile_link(bbp_get_current_user_id());
            ?>
</h4>

				<?php 
            bbp_logout_link();
            ?>
			</div>

		<?php 
        }
        echo $after_widget;
    }
コード例 #8
0
    /**
     * Displays the output, the login form
     * 
     * @param mixed $args Arguments
     * @param array $instance Instance
     * @uses apply_filters() Calls 'bbp_login_widget_title' with the title
     * @uses get_template_part() To get the login/logged in form
     */
    public function widget($args = array(), $instance = array())
    {
        // Get widget settings
        $settings = $this->parse_settings($instance);
        // Typical WordPress filter
        $settings['title'] = apply_filters('widget_title', $settings['title'], $instance, $this->id_base);
        // bbPress filters
        $settings['title'] = apply_filters('bbp_login_widget_title', $settings['title'], $instance, $this->id_base);
        $settings['register'] = apply_filters('bbp_login_widget_register', $settings['register'], $instance, $this->id_base);
        $settings['lostpass'] = apply_filters('bbp_login_widget_lostpass', $settings['lostpass'], $instance, $this->id_base);
        echo $args['before_widget'];
        if (!empty($settings['title'])) {
            echo $args['before_title'] . $settings['title'] . $args['after_title'];
        }
        if (!is_user_logged_in()) {
            ?>

			<form method="post" action="<?php 
            bbp_wp_login_action(array('context' => 'login_post'));
            ?>
" class="bbp-login-form widget-login">
				<fieldset>
				
					<legend><?php 
            _e('Log In', 'bbpress');
            ?>
</legend>

					<div class="bbp-username input-group">
						<i class="fa fa-user"></i>
						<input type="text" name="log" value="<?php 
            bbp_sanitize_val('user_login', 'text');
            ?>
" size="20" id="user_login" tabindex="<?php 
            bbp_tab_index();
            ?>
" 
							placeholder="<?php 
            echo esc_attr_x('Your Username', 'bbPress', 'bunyad-widgets');
            ?>
" />
					</div>

					<div class="bbp-password input-group">
						<i class="fa fa-lock"></i>
						<input type="password" name="pwd" value="<?php 
            bbp_sanitize_val('user_pass', 'password');
            ?>
" size="20" id="user_pass" tabindex="<?php 
            bbp_tab_index();
            ?>
" 
							placeholder="<?php 
            echo esc_attr_x('Your Password', 'bbPress', 'bunyad-widgets');
            ?>
"/>
					</div>

					<div class="bbp-submit-wrapper">

						<?php 
            if (!empty($settings['lostpass'])) {
                ?>

								<a href="<?php 
                echo esc_url($settings['lostpass']);
                ?>
" title="<?php 
                esc_attr_e('Lost password?', 'bbpress');
                ?>
" class="bbp-lostpass-link lost-pass-modal"><?php 
                _e('Lost password?', 'bbpress');
                ?>
</a>

							<?php 
            }
            ?>

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

						<button type="submit" name="user-submit" id="user-submit" tabindex="<?php 
            bbp_tab_index();
            ?>
" class="button submit user-submit"><?php 
            _e('Log In', 'bbpress');
            ?>
</button>

						<?php 
            bbp_user_login_fields();
            ?>

					</div>

				</fieldset>
			</form>
			
			<?php 
            if (!empty($settings['register'])) {
                ?>
				
			<div class="bbp-register-info"><?php 
                _ex("Don't have an account?", 'bbPress', 'bunyad-widgets');
                ?>
				<a href="<?php 
                echo esc_url($settings['register']);
                ?>
" class="register-modal"><?php 
                _ex('Register Now!', 'bbPress', 'bunyad-widgets');
                ?>
</a>
			</div>
							
			<?php 
            }
            ?>
			

		<?php 
        } else {
            ?>

			<div class="bbp-logged-in">
				<a href="<?php 
            bbp_user_profile_url(bbp_get_current_user_id());
            ?>
" class="submit user-submit"><?php 
            echo get_avatar(bbp_get_current_user_id(), '60');
            ?>
</a>
				<div class="content">
				
				<?php 
            _ex('Welcome back, ', 'bbPress', 'bunyad-widgets');
            ?>
				<?php 
            bbp_user_profile_link(bbp_get_current_user_id());
            ?>
				
				<ol class="links">
					<li><a href="<?php 
            bbp_user_profile_edit_url(bbp_get_current_user_id());
            ?>
">
						<?php 
            _ex('Edit Profile', 'bbPress', 'bunyad-widgets');
            ?>
</a></li>
					<li><a href="<?php 
            bbp_subscriptions_permalink(bbp_get_current_user_id());
            ?>
">
						<?php 
            _ex('Subscriptions', 'bbPress', 'bunyad-widgets');
            ?>
</a></li>
					<li><a href="<?php 
            bbp_favorites_permalink(bbp_get_current_user_id());
            ?>
">
						<?php 
            _ex('Favorites', 'bbPress', 'bunyad-widgets');
            ?>
</a></li>
				</ol>

				<?php 
            bbp_logout_link();
            ?>
				
				</div>
			</div>

		<?php 
        }
        echo $args['after_widget'];
    }
コード例 #9
0
            ?>
                            </span>

                        </li><li class="td-forum-topics-title">
                            <div class="td-topics-title">
                                <a href="<?php 
            bbp_topic_permalink();
            ?>
"><?php 
            bbp_topic_title();
            ?>
</a>
                            </div>
                            <div class="td-topics-title-details">
                                started by <a href="<?php 
            bbp_user_profile_url($topic->post_author);
            ?>
"><?php 
            bbp_topic_author_display_name();
            ?>
</a>
                            </div>
                            <div class="td-topics-title-details">
                                <?php 
            //bbp_get_reply_author_link(array('post_id' => ));
            ?>
                                Last reply by <a href="<?php 
            bbp_reply_author_url(bbp_get_topic_last_active_id());
            ?>
"><?php 
            echo bbp_get_topic_author_display_name(bbp_get_topic_last_active_id());
コード例 #10
0
    /**
     * Prints optional dynamic login/logout with nice forms etc
     *
     * @return void
     */
    function ipt_kb_navbar_login()
    {
        global $ipt_theme_op_settings, $current_user, $wp;
        if ($ipt_theme_op_settings['navigation']['show_login'] == false) {
            return false;
        }
        get_currentuserinfo();
        $additional_items = '';
        if (function_exists('ipt_theme_op_navigation_logged_out_nav')) {
            $additional_items = ipt_theme_op_navigation_logged_out_nav(false);
        }
        ?>
<div class="collapse navbar-collapse navbar-right" id="site-navbar-user">
	<?php 
        if (!is_user_logged_in()) {
            ?>
	<ul class="nav navbar-nav navbar-right">
		<li class="dropdown<?php 
            if ($additional_items != '') {
                echo ' dropdown-split-left';
            }
            ?>
">
			<a href="#" class="dropdown-toggle" data-toggle="dropdown">
				<?php 
            _e('Login', 'ipt_kb');
            if ($additional_items == '') {
                echo ' <span class="caret"></span>';
            }
            ?>
			</a>
			<div class="dropdown-menu navmodal-login">
				<?php 
            ipt_kb_wp_login_form();
            ?>
			</div>
		</li>
		<?php 
            if ($additional_items != '') {
                ?>
		<li class="dropdown dropdown-split-right">
			<a href="#" data-toggle="dropdown" class="dropdown-toggle" aria-haspopup="true"><i class="ipticm ipt-icomoon-caret-down"></i></a>
			<ul class="dropdown-menu dropdown-menu-right" role="menu">
				<?php 
                echo $additional_items;
                ?>
			</ul>
		</li>
		<?php 
            }
            ?>
	</ul>
	<?php 
        } else {
            ?>
	<ul class="nav navbar-nav navbar-right">
		<li class="dropdown">
			<a href="#" class="dropdown-toggle" data-toggle="dropdown">
				<?php 
            printf(__('Hi %1$s', 'ipt_kb'), $current_user->user_login);
            ?>
 <span class="caret"></span>
			</a>
			<ul class="dropdown-menu">
				<?php 
            if (function_exists('bbp_user_profile_url')) {
                ?>
				<li><a href="<?php 
                bbp_user_profile_url(bbp_get_current_user_id());
                ?>
"><i class="ipticm ipt-icomoon-user3"></i> <?php 
                _e('My Profile', 'ipt_kb');
                ?>
</a></li>
				<?php 
            }
            ?>
				<?php 
            if (function_exists('ipt_theme_op_navigation_logged_in_nav')) {
                ipt_theme_op_navigation_logged_in_nav();
            }
            ?>
				<li><a href="<?php 
            echo wp_logout_url(home_url(add_query_arg(array(), $wp->request)));
            ?>
"><i class="ipticm ipt-icomoon-power-off"></i> <?php 
            _e('Signout', 'ipt_kb');
            ?>
</a></li>
			</ul>
		</li>
	</ul>
	<?php 
        }
        ?>
</div>
	<?php 
    }
コード例 #11
0
ファイル: widgets.php プロジェクト: CompositeUK/clone.bbPress
    /**
     * Displays the output, the login form
     *
     * @since 2.0.0 bbPress (r2827)
     *
     * @param array $args Arguments
     * @param array $instance Instance
     * @uses apply_filters() Calls 'bbp_login_widget_title' with the title
     * @uses get_template_part() To get the login/logged in form
     */
    public function widget($args = array(), $instance = array())
    {
        // Get widget settings
        $settings = $this->parse_settings($instance);
        // Typical WordPress filter
        $settings['title'] = apply_filters('widget_title', $settings['title'], $instance, $this->id_base);
        // bbPress filters
        $settings['title'] = apply_filters('bbp_login_widget_title', $settings['title'], $instance, $this->id_base);
        $settings['register'] = apply_filters('bbp_login_widget_register', $settings['register'], $instance, $this->id_base);
        $settings['lostpass'] = apply_filters('bbp_login_widget_lostpass', $settings['lostpass'], $instance, $this->id_base);
        echo $args['before_widget'];
        if (!empty($settings['title'])) {
            echo $args['before_title'] . $settings['title'] . $args['after_title'];
        }
        if (!is_user_logged_in()) {
            ?>

			<form method="post" action="<?php 
            bbp_wp_login_action(array('context' => 'login_post'));
            ?>
" class="bbp-login-form">
				<fieldset>
					<legend><?php 
            _e('Log In', 'bbpress');
            ?>
</legend>

					<div class="bbp-username">
						<label for="user_login"><?php 
            _e('Username', 'bbpress');
            ?>
: </label>
						<input type="text" name="log" value="<?php 
            bbp_sanitize_val('user_login', 'text');
            ?>
" size="20" id="user_login" />
					</div>

					<div class="bbp-password">
						<label for="user_pass"><?php 
            _e('Password', 'bbpress');
            ?>
: </label>
						<input type="password" name="pwd" value="<?php 
            bbp_sanitize_val('user_pass', 'password');
            ?>
" size="20" id="user_pass" autocomplete="off" />
					</div>

					<div class="bbp-remember-me">
						<input type="checkbox" name="rememberme" value="forever" <?php 
            checked(bbp_get_sanitize_val('rememberme', 'checkbox'), true, true);
            ?>
 id="rememberme" />
						<label for="rememberme"><?php 
            _e('Remember Me', 'bbpress');
            ?>
</label>
					</div>

					<div class="bbp-submit-wrapper">

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

						<button type="submit" name="user-submit" id="user-submit" class="button submit user-submit"><?php 
            _e('Log In', 'bbpress');
            ?>
</button>

						<?php 
            bbp_user_login_fields();
            ?>

					</div>

					<?php 
            if (!empty($settings['register']) || !empty($settings['lostpass'])) {
                ?>

						<div class="bbp-login-links">

							<?php 
                if (!empty($settings['register'])) {
                    ?>

								<a href="<?php 
                    echo esc_url($settings['register']);
                    ?>
" title="<?php 
                    esc_attr_e('Register', 'bbpress');
                    ?>
" class="bbp-register-link"><?php 
                    _e('Register', 'bbpress');
                    ?>
</a>

							<?php 
                }
                ?>

							<?php 
                if (!empty($settings['lostpass'])) {
                    ?>

								<a href="<?php 
                    echo esc_url($settings['lostpass']);
                    ?>
" title="<?php 
                    esc_attr_e('Lost Password', 'bbpress');
                    ?>
" class="bbp-lostpass-link"><?php 
                    _e('Lost Password', 'bbpress');
                    ?>
</a>

							<?php 
                }
                ?>

						</div>

					<?php 
            }
            ?>

				</fieldset>
			</form>

		<?php 
        } else {
            ?>

			<div class="bbp-logged-in">
				<a href="<?php 
            bbp_user_profile_url(bbp_get_current_user_id());
            ?>
" class="submit user-submit"><?php 
            echo get_avatar(bbp_get_current_user_id(), '40');
            ?>
</a>
				<h4><?php 
            bbp_user_profile_link(bbp_get_current_user_id());
            ?>
</h4>

				<?php 
            bbp_logout_link();
            ?>
			</div>

		<?php 
        }
        echo $args['after_widget'];
    }
コード例 #12
0
ファイル: user-details.php プロジェクト: ramo01/1kapp
?>

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

	<div id="bbp-single-user-details">
		<div id="bbp-user-avatar">

			<span class='vcard'>
				<a class="url fn n" href="<?php bbp_user_profile_url(); ?>" title="<?php bbp_displayed_user_field( 'display_name' ); ?>" rel="me">
					<?php echo get_avatar( bbp_get_displayed_user_field( 'user_email' ), apply_filters( 'bbp_single_user_details_avatar_size', 150 ) ); ?>
				</a>
			</span>

		</div><!-- #author-avatar -->

		<div id="bbp-user-navigation">
			<ul>
				<li class="<?php if ( bbp_is_single_user_profile() ) :?>current<?php endif; ?>">
					<span class="vcard bbp-user-profile-link">
						<a class="url fn n" href="<?php bbp_user_profile_url(); ?>" title="<?php printf( __( "%s's Profile", 'bbpress' ), esc_attr( bbp_get_displayed_user_field( 'display_name' ) ) ); ?>" rel="me"><?php _e( 'Profile', 'bbpress' ); ?></a>
					</span>
				</li>

				<li class="<?php if ( bbp_is_single_user_topics() ) :?>current<?php endif; ?>">
					<span class='bbp-user-topics-created-link'>
						<a href="<?php bbp_user_topics_created_url(); ?>" title="<?php printf( __( "%s's Topics Started", 'bbpress' ), esc_attr( bbp_get_displayed_user_field( 'display_name' ) ) ); ?>"><?php _e( 'Topics Started', 'bbpress' ); ?></a>
					</span>
				</li>

				<li class="<?php if ( bbp_is_single_user_replies() ) :?>current<?php endif;
コード例 #13
0
        /**
         * Displays the output, the login form
         *
         * @param mixed $args Arguments
         * @param array $instance Instance
         * @uses function_exists() to check if bbpress installed
         * @uses apply_filters() Calls 'bbp_login_widget_title' with the title
         * @uses get_template_part() To get the login/logged in form
         */
        function widget($args, $instance)
        {
            if (!function_exists('bbp_logout_link')) {
                // no bbress detected then forum login widget is not required
                return false;
            }
            extract($args);
            $title = $instance['title'];
            $css_class_logout = $instance['css_class_logout'];
            $css_class_login = $this->get_css_class_login($instance);
            echo $before_widget;
            if (!empty($title)) {
                echo $before_title . $title . $after_title;
            }
            // get curretn url to redirect back
            $redirect_to = esc_url($_SERVER["REQUEST_URI"]);
            if (!is_user_logged_in()) {
                // get login url
                ob_start();
                bbp_wp_login_action(array('context' => 'login_post'));
                $login_url = ob_get_clean();
                echo '<div class="' . $css_class_login . '">
					<a href="' . $login_url . '?redirect_to=' . $redirect_to . '" rel="nofollow">' . __('Log in', 'bbpress') . '</a>
					- or - 
					<a href="' . $login_url . '?action=register" rel="nofollow">' . __('Register', 'bbpress') . '</a>
				</div>';
            } else {
                ?>
				<div class="bbp-logged-in<?php 
                echo ' ' . $css_class_logout;
                ?>
">
					<a href="<?php 
                bbp_user_profile_url(bbp_get_current_user_id());
                ?>
" class="submit user-submit"><?php 
                echo get_avatar(bbp_get_current_user_id(), '40');
                ?>
</a>
					<h4><?php 
                bbp_user_profile_link(bbp_get_current_user_id());
                ?>
</h4>
				<?php 
                bbp_logout_link($redirect_to);
                ?>
				</div>
					<?php 
            }
            echo $after_widget;
        }
コード例 #14
0
?>
">
							<span data-icon="home"></span>
						</a>
					</li>
					<li class="bbp-forums">
						<a href="<?php 
bbp_forums_url();
?>
">
							<span data-icon="chat"></span>
						</a>
					</li>
					<li>
						<a href="<?php 
bbp_user_profile_url(wp_get_current_user()->ID);
?>
">
							<span data-icon="user"></span>
						</a>
						<!-- <?php 
//echo wp_get_current_user()->user_firstname;
?>
 -->
					</li>
					<?php 
if (bbp_allow_search()) {
    ?>
						<li class="bbp-search">
							<a href="#">
								<span data-icon="search"></span>