Esempio n. 1
0
    /**
     * Member Links Dialog.
     *
     * Outputs the links used on the members area.
     *
     * @since 2.0
     *
     * @param  string $page
     * @return string $str
     */
    function wpmem_inc_memberlinks($page = 'members')
    {
        global $user_login, $wpmem;
        $link = wpmem_chk_qstr();
        /**
         * Filter the log out link.
         *
         * @since 2.8.3
         *
         * @param string $link The default logout link.
         */
        $logout = apply_filters('wpmem_logout_link', $link . 'a=logout');
        switch ($page) {
            case 'members':
                $str = '<ul><li><a href="' . $link . 'a=edit">' . __('Edit My Information', 'wp-members') . '</a></li>
				<li><a href="' . $link . 'a=pwdchange">' . __('Change Password', 'wp-members') . '</a></li>';
                if (defined('WPMEM_EXP_MODULE') && $wpmem->use_exp == 1 && function_exists('wpmem_user_page_detail')) {
                    $str .= wpmem_user_page_detail();
                }
                $str .= '</ul>';
                /**
                 * Filter the links displayed on the User Profile page (logged in state).
                 *
                 * @since 2.8.3
                 *
                 * @param string $str The default links.
                 */
                $str = apply_filters('wpmem_member_links', $str);
                break;
            case 'register':
                $str = '<p>' . sprintf(__('You are logged in as %s', 'wp-members'), $user_login) . '</p>
			<ul>
				<li><a href="' . $logout . '">' . __('Click to log out.', 'wp-members') . '</a></li>
				<li><a href="' . get_option('home') . '">' . __('Begin using the site.', 'wp-members') . '</a></li>
			</ul>';
                /**
                 * Filter the links displayed on the Register page (logged in state).
                 *
                 * @since 2.8.3
                 *
                 * @param string $str The default links.
                 */
                $str = apply_filters('wpmem_register_links', $str);
                break;
            case 'login':
                $args = array('wrapper_before' => '<p>', 'wrapper_after' => '</p>', 'user_login' => $user_login, 'welcome' => __('You are logged in as %s', 'wp-members'), 'logout_text' => __('Click to log out', 'wp-members'), 'logout_link' => '<a href="' . $logout . '">%s</a>', 'separator' => '<br />');
                /**
                 * Filter the status message parts.
                 *
                 * @since 2.9.9
                 *
                 * @param array $args.
                 */
                $args = apply_filters('wpmem_login_links_args', $args);
                // Assemble the message string.
                $str = $args['wrapper_before'] . sprintf($args['welcome'], $args['user_login']) . $args['separator'] . sprintf($args['logout_link'], $args['logout_text']) . $args['wrapper_after'];
                /**
                 * Filter the links displayed on the Log In page (logged in state).
                 *
                 * @since 2.8.3
                 *
                 * @param string $str The default links.
                 */
                $str = apply_filters('wpmem_login_links', $str);
                break;
            case 'status':
                $args = array('wrapper_before' => '<p>', 'wrapper_after' => '</p>', 'user_login' => $user_login, 'welcome' => __('You are logged in as %s', 'wp-members'), 'logout_text' => __('click to log out', 'wp-members'), 'logout_link' => '<a href="' . $logout . '">%s</a>', 'separator' => ' | ');
                /**
                 * Filter the status message parts.
                 *
                 * @since 2.9.9
                 *
                 * @param array $args.
                 */
                $args = apply_filters('wpmem_status_msg_args', $args);
                // Assemble the message string.
                $str = $args['wrapper_before'] . sprintf($args['welcome'], $args['user_login']) . $args['separator'] . sprintf($args['logout_link'], $args['logout_text']) . $args['wrapper_after'];
                break;
        }
        return $str;
    }
    /**
     * Member Links Dialog
     *
     * Outputs the links used on the members area.
     *
     * @since 2.0
     *
     * @uses apply_filters Calls 'wpmem_member_links'
     * @uses apply_filters Calls 'wpmem_register_links'
     * @uses apply_filters Calls 'wpmem_login_links'
     *
     * @param  string $page
     * @return string $str
     */
    function wpmem_inc_memberlinks($page = 'members')
    {
        global $user_login;
        $link = wpmem_chk_qstr();
        switch ($page) {
            case 'members':
                $str = '<ul><li><a href="' . $link . 'a=edit">' . __('Edit My Information', 'wp-members') . '</a></li>
				<li><a href="' . $link . 'a=pwdchange">' . __('Change Password', 'wp-members') . '</a></li>';
                if (WPMEM_USE_EXP == 1) {
                    $str .= wpmem_user_page_detail();
                }
                $str .= '</ul>';
                $str = apply_filters('wpmem_member_links', $str);
                break;
            case 'register':
                $str = '<p>' . sprintf(__('You are logged in as %s', 'wp-members'), $user_login) . '</p>
			<ul>
				<li><a href="' . $link . 'a=logout">' . __('Click here to logout.', 'wp-members') . '</a></li>
				<li><a href="' . get_option('siteurl') . '">' . __('Begin using the site.', 'wp-members') . '</a></li>
			</ul>';
                $str = apply_filters('wpmem_register_links', $str);
                break;
            case 'login':
                $str = '<p>
		  	' . sprintf(__('You are logged in as %s', 'wp-members'), $user_login) . '<br />
		  	<a href="' . $link . 'a=logout">' . __('click here to logout', 'wp-members') . '</a>
			</p>';
                $str = apply_filters('wpmem_login_links', $str);
                break;
            case 'status':
                $str = '<p>
			' . sprintf(__('You are logged in as %s', 'wp-members'), $user_login) . '  | 
			<a href="' . $link . 'a=logout">' . __('click here to logout', 'wp-members') . '</a>
			</p>';
                break;
        }
        return $str;
    }
Esempio n. 3
0
 /**
  * Member Links Dialog.
  *
  * Outputs the links used on the members area.
  *
  * @since 2.0
  *
  * @gloabl        $user_login
  * @global object $wpmem
  * @param  string $page
  * @return string $str
  */
 function wpmem_inc_memberlinks($page = 'member')
 {
     global $user_login, $wpmem;
     /**
      * Filter the log out link.
      *
      * @since 2.8.3
      *
      * @param string The default logout link.
      */
     $logout = apply_filters('wpmem_logout_link', add_query_arg('a', 'logout'));
     switch ($page) {
         case 'member':
             $arr = array('before_wrapper' => '', 'wrapper_before' => '<ul>', 'wrapper_after' => '</ul>', 'rows' => array('<li><a href="' . add_query_arg('a', 'edit') . '">' . $wpmem->get_text('profile_edit') . '</a></li>', '<li><a href="' . add_query_arg('a', 'pwdchange') . '">' . $wpmem->get_text('profile_password') . '</a></li>'), 'after_wrapper' => '');
             if (defined('WPMEM_EXP_MODULE') && $wpmem->use_exp == 1 && function_exists('wpmem_user_page_detail')) {
                 $arr['rows'][] = wpmem_user_page_detail();
             }
             /**
              * Filter the member links array.
              *
              * @since 3.0.9
              * @since 3.1.0 Added after_wrapper
              *
              * @param array $arr {
              *      The components of the links.
              *
              *      @type string $before_wrapper Anything that comes before the wrapper.
              *      @type string $wrapper_before The wrapper opening tag (default: <ul>).
              *      @type string $wrapper_after  The wrapper closing tag (default: </ul>).
              *      @type array  $rows           Row items HTML.
              *      @type string $after_wrapper  Anything that comes after the wrapper.
              * }
              */
             $arr = apply_filters("wpmem_{$page}_links_args", $arr);
             $str = $arr['before_wrapper'];
             $str .= $arr['wrapper_before'];
             foreach ($arr['rows'] as $row) {
                 $str .= $row;
             }
             $str .= $arr['wrapper_after'];
             $str .= $arr['after_wrapper'];
             /**
              * Filter the links displayed on the User Profile page (logged in state).
              *
              * @since 2.8.3
              *
              * @param string $str The default links.
              */
             $str = apply_filters("wpmem_{$page}_links", $str);
             break;
         case 'register':
             $arr = array('before_wrapper' => '<p>' . sprintf($wpmem->get_text('register_status'), $user_login) . '</p>', 'wrapper_before' => '<ul>', 'wrapper_after' => '</ul>', 'rows' => array('<li><a href="' . $logout . '">' . $wpmem->get_text('register_logout') . '</a></li>', '<li><a href="' . get_option('home') . '">' . $wpmem->get_text('register_continue') . '</a></li>'), 'after_wrapper' => '');
             /**
              * Filter the register links array.
              *
              * @since 3.0.9
              * @since 3.1.0 Added after_wrapper
              *
              * @param array $arr {
              *      The components of the links.
              *
              *      @type string $before_wrapper HTML before the wrapper (default: login status).
              *      @type string $wrapper_before The wrapper opening tag (default: <ul>).
              *      @type string $wrapper_after  The wrapper closing tag (default: </ul>).
              *      @type array  $rows           Row items HTML.
              *      @type string $after_wrapper  Anything that comes after the wrapper.
              * }
              */
             $arr = apply_filters("wpmem_{$page}_links_args", $arr);
             $str = $arr['before_wrapper'];
             $str .= $arr['wrapper_before'];
             foreach ($arr['rows'] as $row) {
                 $str .= $row;
             }
             $str .= $arr['wrapper_after'];
             $str .= $arr['after_wrapper'];
             /**
              * Filter the links displayed on the Register page (logged in state).
              *
              * @since 2.8.3
              *
              * @param string $str The default links.
              */
             $str = apply_filters("wpmem_{$page}_links", $str);
             break;
         case 'login':
             $args = array('wrapper_before' => '<p>', 'wrapper_after' => '</p>', 'user_login' => $user_login, 'welcome' => $wpmem->get_text('login_welcome'), 'logout_text' => $wpmem->get_text('login_logout'), 'logout_link' => '<a href="' . $logout . '">%s</a>', 'separator' => '<br />');
             /**
              * Filter the status message parts.
              *
              * @since 2.9.9
              *
              * @param array $args.
              */
             $args = apply_filters("wpmem_{$page}_links_args", $args);
             // Assemble the message string.
             $str = $args['wrapper_before'] . sprintf($args['welcome'], $args['user_login']) . $args['separator'] . sprintf($args['logout_link'], $args['logout_text']) . $args['wrapper_after'];
             /**
              * Filter the links displayed on the Log In page (logged in state).
              *
              * @since 2.8.3
              *
              * @param string $str The default links.
              */
             $str = apply_filters("wpmem_{$page}_links", $str);
             break;
         case 'status':
             $args = array('wrapper_before' => '<p>', 'wrapper_after' => '</p>', 'user_login' => $user_login, 'welcome' => $wpmem->get_text('status_welcome'), 'logout_text' => $wpmem->get_text('status_logout'), 'logout_link' => '<a href="' . $logout . '">%s</a>', 'separator' => ' | ');
             /**
              * Filter the status message parts.
              *
              * @since 2.9.9
              *
              * @param array $args.
              */
             $args = apply_filters('wpmem_status_msg_args', $args);
             // Assemble the message string.
             $str = $args['wrapper_before'] . sprintf($args['welcome'], $args['user_login']) . $args['separator'] . sprintf($args['logout_link'], $args['logout_text']) . $args['wrapper_after'];
             break;
     }
     return $str;
 }
    /**
     * Member Links Dialog
     *
     * Outputs the links used on the members area.
     *
     * @since 2.0
     *
     * @param  string $page
     * @return string $str
     */
    function wpmem_inc_memberlinks($page = 'members')
    {
        global $user_login;
        $link = wpmem_chk_qstr();
        /**
         * Filter the log out link.
         *
         * @since 2.8.3
         *
         * @param string $link The default logout link.
         */
        $logout = apply_filters('wpmem_logout_link', $link . 'a=logout');
        switch ($page) {
            case 'members':
                $str = '<ul><li><a href="' . $link . 'a=edit">' . __('Edit My Information', 'wp-members') . '</a></li>
				<li><a href="' . $link . 'a=pwdchange">' . __('Change Password', 'wp-members') . '</a></li>';
                if (WPMEM_USE_EXP == 1 && function_exists('wpmem_user_page_detail')) {
                    $str .= wpmem_user_page_detail();
                }
                $str .= '</ul>';
                /**
                 * Filter the links displayed on the User Profile page (logged in state).
                 *
                 * @since 2.8.3
                 *
                 * @param string $str The default links.
                 */
                $str = apply_filters('wpmem_member_links', $str);
                break;
            case 'register':
                $str = '<p>' . sprintf(__('You are logged in as %s', 'wp-members'), $user_login) . '</p>
			<ul>
				<li><a href="' . $logout . '">' . __('Click to log out.', 'wp-members') . '</a></li>
				<li><a href="' . get_option('home') . '">' . __('Begin using the site.', 'wp-members') . '</a></li>
			</ul>';
                /**
                 * Filter the links displayed on the Register page (logged in state).
                 *
                 * @since 2.8.3
                 *
                 * @param string $str The default links.
                 */
                $str = apply_filters('wpmem_register_links', $str);
                break;
            case 'login':
                $str = '<p>
		  	' . sprintf(__('You are logged in as %s', 'wp-members'), $user_login) . '<br />
		  	<a href="' . $logout . '">' . __('Click to log out', 'wp-members') . '</a>
			</p>';
                /**
                 * Filter the links displayed on the Log In page (logged in state).
                 *
                 * @since 2.8.3
                 *
                 * @param string $str The default links.
                 */
                $str = apply_filters('wpmem_login_links', $str);
                break;
            case 'status':
                $str = '<p>
			' . sprintf(__('You are logged in as %s', 'wp-members'), $user_login) . '  | 
			<a href="' . $logout . '">' . __('click to log out', 'wp-members') . '</a>
			</p>';
                break;
        }
        return $str;
    }