/**
  * Displays the user's login status
  *
  * @since 2.0
  *
  * @uses wpmem_inc_memberlinks()
  */
 function wpmem_login_status()
 {
     include_once 'wp-members-dialogs.php';
     if (is_user_logged_in()) {
         echo wpmem_inc_memberlinks('status');
     }
 }
예제 #2
0
파일: core.php 프로젝트: koopmant/Mens-site
 /**
  * Displays the user's login status.
  *
  * @since 2.0
  *
  * @uses   wpmem_inc_memberlinks()
  * @param  boolean $echo           Determines whether function should print result or not (default: true).
  * @return string  $status         The user status string produced by wpmem_inc_memberlinks().
  */
 function wpmem_login_status($echo = true)
 {
     include_once WPMEM_PATH . 'inc/dialogs.php';
     if (is_user_logged_in()) {
         $status = wpmem_inc_memberlinks('status');
         if ($echo) {
             echo $status;
         }
         return $status;
     }
 }
예제 #3
0
 /**
  * Builds the shortcode pages (login, register, user-profile, user-edit, password).
  *
  * Some of the logic here is similar to the wpmem_securify() function. 
  * But where that function handles general content, this function 
  * handles building specific pages generated by shortcodes.
  *
  * @since 2.6.0
  *
  * @global object $wpmem        The WP_Members object.
  * @global string $wpmem_themsg The WP-Members message container.
  * @global object $post         The WordPress post object.
  *
  * @param  string $page
  * @param  string $redirect_to
  * @return string $content
  */
 function wpmem_do_sc_pages($page, $redirect_to = null)
 {
     global $wpmem, $wpmem_themsg, $post;
     include_once WPMEM_PATH . 'inc/dialogs.php';
     $content = '';
     // Deprecating members-area parameter to be replaced by user-profile.
     $page = $page == 'user-profile' ? 'members-area' : $page;
     if ($page == 'members-area' || $page == 'register') {
         if ($wpmem->regchk == "captcha") {
             global $wpmem_captcha_err;
             $wpmem_themsg = __('There was an error with the CAPTCHA form.') . '<br /><br />' . $wpmem_captcha_err;
         }
         if ($wpmem->regchk == "loginfailed") {
             return wpmem_inc_loginfailed();
         }
         if (!is_user_logged_in()) {
             if ($wpmem->action == 'register') {
                 switch ($wpmem->regchk) {
                     case "success":
                         $content = wpmem_inc_regmessage($wpmem->regchk, $wpmem_themsg);
                         $content = $content . wpmem_inc_login();
                         break;
                     default:
                         $content = wpmem_inc_regmessage($wpmem->regchk, $wpmem_themsg);
                         $content = $content . wpmem_inc_registration();
                         break;
                 }
             } elseif ($wpmem->action == 'pwdreset') {
                 $content = wpmem_page_pwd_reset($wpmem->regchk, $content);
             } elseif ($wpmem->action == 'getusername') {
                 $content = wpmem_page_forgot_username($wpmem->regchk, $content);
             } else {
                 $content = $page == 'members-area' ? $content . wpmem_inc_login('members') : $content;
                 $content = $page == 'register' || $wpmem->show_reg[$post->post_type] != 0 ? $content . wpmem_inc_registration() : $content;
             }
         } elseif (is_user_logged_in() && $page == 'members-area') {
             /**
              * Filter the default heading in User Profile edit mode.
              *
              * @since 2.7.5
              *
              * @param string The default edit mode heading.
              */
             $heading = apply_filters('wpmem_user_edit_heading', __('Edit Your Information', 'wp-members'));
             switch ($wpmem->action) {
                 case "edit":
                     $content = $content . wpmem_inc_registration('edit', $heading);
                     break;
                 case "update":
                     // Determine if there are any errors/empty fields.
                     if ($wpmem->regchk == "updaterr" || $wpmem->regchk == "email") {
                         $content = $content . wpmem_inc_regmessage($wpmem->regchk, $wpmem_themsg);
                         $content = $content . wpmem_inc_registration('edit', $heading);
                     } else {
                         //Case "editsuccess".
                         $content = $content . wpmem_inc_regmessage($wpmem->regchk, $wpmem_themsg);
                         $content = $content . wpmem_inc_memberlinks();
                     }
                     break;
                 case "pwdchange":
                     $content = wpmem_page_pwd_reset($wpmem->regchk, $content);
                     break;
                 case "renew":
                     $content = wpmem_renew();
                     break;
                 default:
                     $content = wpmem_inc_memberlinks();
                     break;
             }
         } elseif (is_user_logged_in() && $page == 'register') {
             $content = $content . wpmem_inc_memberlinks('register');
         }
     }
     if ($page == 'login') {
         $content = $wpmem->regchk == "loginfailed" ? wpmem_inc_loginfailed() : $content;
         $content = !is_user_logged_in() ? $content . wpmem_inc_login('login', $redirect_to) : wpmem_inc_memberlinks('login');
     }
     if ($page == 'password') {
         $content = wpmem_page_pwd_reset($wpmem->regchk, $content);
     }
     if ($page == 'user-edit') {
         $content = wpmem_page_user_edit($wpmem->regchk, $content);
     }
     return $content;
 }
예제 #4
0
파일: core.php 프로젝트: scottnkerr/eeco
 /**
  * Returns or displays the user's login status.
  *
  * @since 2.0.0
  *
  * @param  boolean $echo   Determines whether function should print result or not (default: true).
  * @return string  $status The user status string produced by wpmem_inc_memberlinks().
  */
 function wpmem_login_status($echo = true)
 {
     /**
      * Load the dialogs functions.
      */
     require_once WPMEM_PATH . 'inc/dialogs.php';
     if (is_user_logged_in()) {
         $status = wpmem_inc_memberlinks('status');
         if ($echo) {
             echo $status;
         }
         return $status;
     }
 }