当前位置: 首页>>代码示例>>PHP>>正文


PHP FEUPRedirect函数代码示例

本文整理汇总了PHP中FEUPRedirect函数的典型用法代码示例。如果您正苦于以下问题:PHP FEUPRedirect函数的具体用法?PHP FEUPRedirect怎么用?PHP FEUPRedirect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了FEUPRedirect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Insert_Forgot_Password_Form

function Insert_Forgot_Password_Form($atts)
{
    global $wpdb, $user_message, $feup_success;
    global $ewd_feup_user_table_name;
    $Custom_CSS = get_option("EWD_FEUP_Custom_CSS");
    // Get the attributes passed by the shortcode, and store them in new variables for processing
    extract(shortcode_atts(array('redirect_page' => '#', 'loggedin_page' => '/', 'reset_email_url' => '', 'submit_text' => __('Reset password', 'EWD_FEUP')), $atts));
    if ($feup_success and $redirect_page != '#') {
        FEUPRedirect($redirect_page);
    }
    $User = new FEUP_User();
    if ($User->Is_Logged_In()) {
        FEUPRedirect($loggedin_page);
    }
    $ReturnString = "";
    $ReturnString .= "<style type='text/css'>";
    $ReturnString .= $Custom_CSS;
    $ReturnString .= "</style>";
    $ReturnString .= "<div id='ewd-feup-forgot-password-form-div'>";
    if (isset($user_message['Message'])) {
        $ReturnString .= $user_message['Message'];
    }
    $ReturnString .= "<form action='#' method='post' id='ewd-feup-forgot-password-form' class='pure-form pure-form-aligned'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-check' value='" . sha1(md5($Time . $Salt)) . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-time' value='" . $Time . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-reset-email-url' value='" . $reset_email_url . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-action' value='forgot-password'>";
    $ReturnString .= "<div class='pure-control-group'>";
    $ReturnString .= "<label for='Email' id='ewd-feup-reset-password' class='ewd-feup-field-label'>" . __('Email', 'EWD_FEUP') . ": </label>";
    $ReturnString .= "<input type='email' class='ewd-feup-text-input pure-input-1-3' name='Email' value='' />";
    $ReturnString .= "</div>";
    $ReturnString .= "<div class='pure-control-group'><label for='submit'></label><input type='submit' class='ewd-feup-submit pure-button pure-button-primary' name='Reset_Password_Submit' value='" . $submit_text . "'></div>";
    $ReturnString .= "</div>";
    return $ReturnString;
}
开发者ID:katekbg,项目名称:2thinkers_cebu,代码行数:35,代码来源:Insert_Forgot_Password.php

示例2: Insert_Logout

function Insert_Logout($atts)
{
    // Include the required global variables, and create a few new ones
    $Salt = get_option("EWD_FEUP_Hash_Salt");
    $Custom_CSS = get_option("EWD_FEUP_Custom_CSS");
    $CookieName = urlencode("EWD_FEUP_Login" . "%" . sha1(md5(get_site_url() . $Salt)));
    $feup_Label_Successful_Logout_Message = get_option("EWD_FEUP_Label_Successful_Logout_Message");
    if ($feup_Label_Successful_Logout_Message == "") {
        $feup_Label_Successful_Logout_Message = __("You have been successfully logged out.", "EWD_FEUP");
    }
    $ReturnString = "";
    // Get the attributes passed by the shortcode, and store them in new variables for processing
    extract(shortcode_atts(array('no_message' => '', 'redirect_page' => '#', 'no_redirect' => 'No', 'submit_text' => 'Logout'), $atts));
    if ($no_redirect != "Yes" and isset($_COOKIE[$CookieName])) {
        $redirect_page = get_the_permalink();
    }
    setcookie($CookieName, "", time() - 3600, "/");
    $_COOKIE[urldecode($CookieName)] = "";
    if ($redirect_page != "#") {
        FEUPRedirect($redirect_page);
    }
    $ReturnString .= "<style type='text/css'>";
    $ReturnString .= $Custom_CSS;
    $ReturnString .= EWD_FEUP_Add_Modified_Styles();
    $ReturnString .= "<div class='feup-information-div'>";
    $ReturnString .= $feup_Label_Successful_Logout_Message;
    $ReturnString .= "</div>";
    if ($no_message != "Yes") {
        return $ReturnString;
    }
}
开发者ID:otkinsey,项目名称:wp-nsds,代码行数:31,代码来源:Insert_Logout.php

示例3: Auto_Login

function Auto_Login($atts)
{
    global $user_message, $feup_success;
    session_start();
    $username = $password = "";
    if (array_key_exists('Username', $_SESSION)) {
        $username = $_SESSION['Username'];
    }
    if (array_key_exists('User_Password', $_SESSION)) {
        $password = $_SESSION['User_Password'];
    }
    // Include the required global variables, and create a few new ones
    $Salt = get_option("EWD_FEUP_Hash_Salt");
    $Custom_CSS = get_option("EWD_FEUP_Custom_CSS");
    $Username_Is_Email = get_option("EWD_FEUP_Username_Is_Email");
    $Time = time();
    $ReturnString = "";
    // Get the attributes passed by the shortcode, and store them in new variables for processing
    extract(shortcode_atts(array('redirect_page' => '#', 'redirect_field' => '', 'redirect_array_string' => '', 'submit_text' => __('Login', 'EWD_FEUP')), $atts));
    $ReturnString .= "<style type='text/css'>";
    $ReturnString .= $Custom_CSS;
    $ReturnString .= "</style>";
    if ($feup_success and $redirect_field != "") {
        $redirect_page = Determine_Redirect_Page($redirect_field, $redirect_array_string, $redirect_page);
    }
    if ($feup_success and $redirect_page != '#') {
        FEUPRedirect($redirect_page);
    }
    $ReturnString .= "<div id='ewd-feup-login-form-div'>";
    if (isset($user_message['Message'])) {
        $ReturnString .= $user_message['Message'];
    }
    //    $ReturnString .= "<br/>Logging you in...<br/>";
    $ReturnString .= "<form action='#' method='post' id='ewd-feup-login-form' class='pure-form pure-form-aligned hidden'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-check' value='" . sha1(md5($Time . $Salt)) . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-time' value='" . $Time . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-action' value='login'>";
    $ReturnString .= "<div class='pure-control-group'>";
    if ($Username_Is_Email == "Yes") {
        $ReturnString .= "<label for='Username' id='ewd-feup-login-username-div' class='ewd-feup-field-label'>" . __('Email', 'EWD_FEUP') . ": </label>";
        $ReturnString .= "<input type='email' class='ewd-feup-text-input' name='Username' value='{$username}' placeholder='" . __('Email', 'EWD_FEUP') . "...'>";
    } else {
        $ReturnString .= "<label for='Username' id='ewd-feup-login-username-div' class='ewd-feup-field-label'>" . __('Username', 'EWD_FEUP') . ": </label>";
        $ReturnString .= "<input type='text' class='ewd-feup-text-input' name='Username'  value='{$username}' placeholder='" . __('Username', 'EWD_FEUP') . "...'>";
    }
    $ReturnString .= "</div>";
    $ReturnString .= "<div class='pure-control-group'>";
    $ReturnString .= "<label for='Password' id='ewd-feup-login-password-div' class='ewd-feup-field-label'>" . __('Password', 'EWD_FEUP') . ": </label>";
    $ReturnString .= "<input type='password' class='ewd-feup-text-input' name='User_Password' value='{$password}'>";
    $ReturnString .= "</div>";
    $ReturnString .= "<div class='pure-control-group'>";
    $ReturnString .= "<label for='Submit'></label><input type='submit' class='ewd-feup-submit pure-button pure-button-primary' name='Login_Submit' '" . $submit_text . "'>";
    $ReturnString .= "</div>";
    $ReturnString .= "</form>";
    $ReturnString .= "</div>";
    wp_enqueue_script('auto-login-script', '/wp-content/js/auto-login.js', array('jquery'));
    return $ReturnString;
}
开发者ID:jeremygeltman,项目名称:ThinkThinly,代码行数:58,代码来源:Auto_Login.php

示例4: Insert_Reset_Password_Form

function Insert_Reset_Password_Form($atts)
{
    global $wpdb, $user_message, $feup_success;
    global $ewd_feup_user_table_name;
    $Custom_CSS = get_option("EWD_FEUP_Custom_CSS");
    $Salt = get_option("EWD_FEUP_Hash_Salt");
    $Time = time();
    $ReturnString = "";
    // Get the attributes passed by the shortcode, and store them in new variables for processing
    extract(shortcode_atts(array('redirect_page' => '#', 'login_page' => '', 'submit_text' => __('Update Account', 'EWD_FEUP')), $atts));
    $CheckCookie = CheckLoginCookie();
    if ($CheckCookie['Username'] == "") {
        $ReturnString .= __('You must be logged in to access this page.', 'EWD_FEUP');
        if ($login_page != "") {
            $ReturnString .= "<br />" . __('Please', 'EWD_FEUP') . " <a href='" . $login_page . "'>" . __('login', 'EWD_FEUP') . "</a> " . __('to continue.', 'EWD_FEUP');
        }
        return $ReturnString;
    }
    /*$Sql = "SELECT * FROM $ewd_feup_fields_table_name ";
    	$Fields = $wpdb->get_results($Sql);*/
    $User = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$ewd_feup_user_table_name} WHERE Username='%s'", $CheckCookie['Username']));
    $ReturnString .= "<style type='text/css'>";
    $ReturnString .= $Custom_CSS;
    $ReturnString .= "</style>";
    if ($feup_success and $redirect_page != '#') {
        FEUPRedirect($redirect_page);
    }
    $ReturnString .= "<div id='ewd-feup-edit-profile-form-div'>";
    if (isset($user_message['Message'])) {
        $ReturnString .= $user_message['Message'];
    }
    $ReturnString .= "<form action='#' method='post' id='ewd-feup-edit-profile-form' class='pure-form pure-form-aligned'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-check' value='" . sha1(md5($Time . $Salt)) . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-time' value='" . $Time . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-action' value='edit-account'>";
    $ReturnString .= "<input type='hidden' name='Username' value='" . $User->Username . "'>";
    $ReturnString .= "<div id='ewd-feup-register-username-div' class='ewd-feup-field-label'>" . __('Email', 'EWD_FEUP') . ": " . $User->Username . "</div>";
    $ReturnString .= "<div class='pure-control-group'>";
    $ReturnString .= "<label for='User_Password' id='ewd-feup-edit-password' class='ewd-feup-field-label'>" . __('Password', 'EWD_FEUP') . ": </label>";
    $ReturnString .= "<input type='password' class='ewd-feup-text-input' name='User_Password' class='ewd-feup-text-input pure-input-1-3' value='' />";
    $ReturnString .= "</div>";
    $ReturnString .= "<div class='pure-control-group'>";
    $ReturnString .= "<label for='Confirm_User_Password' id='ewd-feup-edit-confirm-password' class='ewd-feup-field-label'>" . __('Repeat Password', 'EWD_FEUP') . ": </label>";
    $ReturnString .= "<input type='password' class='ewd-feup-text-input' name='Confirm_User_Password' class='ewd-feup-text-input pure-input-1-3' value='' />";
    $ReturnString .= "</div>";
    $ReturnString .= "<div class='pure-control-group'><label for='submit'></label><input type='submit' class='ewd-feup-submit pure-button pure-button-primary' name='Edit_Password_Submit' value='" . $submit_text . "'></div>";
    $ReturnString .= "</div>";
    $ReturnString .= "</form>";
    return $ReturnString;
}
开发者ID:jeremygeltman,项目名称:ThinkThinly,代码行数:50,代码来源:Insert_Reset_Password.php

示例5: Insert_Login_Form

function Insert_Login_Form($atts)
{
    global $user_message, $feup_success;
    // Include the required global variables, and create a few new ones
    $Salt = get_option("EWD_FEUP_Hash_Salt");
    $Custom_CSS = get_option("EWD_FEUP_Custom_CSS");
    $Username_Is_Email = get_option("EWD_FEUP_Username_Is_Email");
    $Time = time();
    $ReturnString = "";
    // Get the attributes passed by the shortcode, and store them in new variables for processing
    extract(shortcode_atts(array('redirect_page' => '#', 'redirect_field' => '', 'redirect_array_string' => '', 'submit_text' => __('Login', 'EWD_FEUP')), $atts));
    $ReturnString .= "<style type='text/css'>";
    $ReturnString .= $Custom_CSS;
    $ReturnString .= EWD_FEUP_Add_Modified_Styles();
    if ($feup_success and $redirect_field != "") {
        $redirect_page = Determine_Redirect_Page($redirect_field, $redirect_array_string, $redirect_page);
    }
    if ($feup_success and $redirect_page != '#') {
        FEUPRedirect($redirect_page);
    }
    $ReturnString .= "<div id='ewd-feup-login' class='ewd-feup-login-form-div' class='ewd-feup-form-div'>";
    if (isset($user_message['Message'])) {
        $ReturnString .= $user_message['Message'];
    }
    $ReturnString .= "<form action='#' method='post' id='ewd-feup-login-form' class='pure-form pure-form-aligned feup-pure-form-aligned'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-check' value='" . sha1(md5($Time . $Salt)) . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-time' value='" . $Time . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-action' value='login'>";
    $ReturnString .= "<div class='feup-pure-control-group'>";
    if ($Username_Is_Email == "Yes") {
        $ReturnString .= "<label for='Username' id='ewd-feup-login-username-div' class='ewd-feup-field-label ewd-feup-login-label'>" . __('Email', 'EWD_FEUP') . ": </label>";
        $ReturnString .= "<input type='email' class='ewd-feup-text-input ewd-feup-login-field' name='Username' placeholder='" . __('Email', 'EWD_FEUP') . "...'>";
    } else {
        $ReturnString .= "<label for='Username' id='ewd-feup-login-username-div' class='ewd-feup-field-label ewd-feup-login-label'>" . __('Username', 'EWD_FEUP') . ": </label>";
        $ReturnString .= "<input type='text' class='ewd-feup-text-input ewd-feup-login-field' name='Username' placeholder='" . __('Username', 'EWD_FEUP') . "...'>";
    }
    $ReturnString .= "</div>";
    $ReturnString .= "<div class='feup-pure-control-group'>";
    $ReturnString .= "<label for='Password' id='ewd-feup-login-password-div' class='ewd-feup-field-label ewd-feup-login-label'>" . __('Password', 'EWD_FEUP') . ": </label>";
    $ReturnString .= "<input type='password' class='ewd-feup-text-input ewd-feup-login-field' name='User_Password'>";
    $ReturnString .= "</div>";
    $ReturnString .= "<div class='feup-pure-control-group'>";
    $ReturnString .= "<label for='Submit'></label><input type='submit' class='ewd-feup-submit ewd-feup-login-submit feup-pure-button feup-pure-button-primary' name='Login_Submit' value='" . $submit_text . "'>";
    $ReturnString .= "</div>";
    $ReturnString .= "</form>";
    $ReturnString .= "</div>";
    return $ReturnString;
}
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:48,代码来源:Insert_Login_Form.php

示例6: Insert_Confirm_Forgot_Password

function Insert_Confirm_Forgot_Password($atts)
{
    global $wpdb, $user_message, $feup_success;
    global $ewd_feup_user_table_name;
    $Custom_CSS = get_option("EWD_FEUP_Custom_CSS");
    $CheckCookie = CheckLoginCookie();
    $Salt = get_option("EWD_FEUP_Hash_Salt");
    $Time = time();
    $User = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$ewd_feup_user_table_name} WHERE Username='%s'", $CheckCookie['Username']));
    $ReturnString = "";
    // Get the attributes passed by the shortcode, and store them in new variables for processing
    extract(shortcode_atts(array('redirect_page' => '#', 'login_page' => '', 'submit_text' => __('Change password', 'EWD_FEUP')), $atts));
    $ReturnString .= "<style type='text/css'>";
    $ReturnString .= $Custom_CSS;
    $ReturnString .= "</style>";
    if ($feup_success and $redirect_page != '#') {
        FEUPRedirect($redirect_page);
    }
    $ReturnString .= "<div id='ewd-feup-edit-profile-form-div'>";
    if (isset($user_message['Message'])) {
        $ReturnString .= $user_message['Message'];
    }
    $ReturnString .= "<form action='#' method='post' id='ewd-feup-edit-profile-form' class='feup-pure-form pure-form-aligned'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-check' value='" . sha1(md5($Time . $Salt)) . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-time' value='" . $Time . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-action' value='confirm-forgot-password'>";
    $ReturnString .= "<div class='feup-pure-control-group'>";
    $ReturnString .= "<label for='Email' id='ewd-feup-edit-password' class='ewd-feup-field-label'>" . __('Email', 'EWD_FEUP') . ": </label>";
    $ReturnString .= "<input type='email' class='ewd-feup-text-input' name='Email' class='ewd-feup-text-input' value='" . $_GET['add'] . "' />";
    $ReturnString .= "</div>";
    $ReturnString .= "<div class='feup-pure-control-group'>";
    $ReturnString .= "<label for='Resetcode' id='ewd-feup-edit-password' class='ewd-feup-field-label'>" . __('Reset code', 'EWD_FEUP') . ": </label>";
    $ReturnString .= "<input type='text' class='ewd-feup-text-input' name='Resetcode' class='ewd-feup-text-input' value='" . $_GET['rc'] . "' />";
    $ReturnString .= "</div>";
    $ReturnString .= "<div class='feup-pure-control-group'>";
    $ReturnString .= "<label for='User_Password' id='ewd-feup-edit-password' class='ewd-feup-field-label'>" . __('Password', 'EWD_FEUP') . ": </label>";
    $ReturnString .= "<input type='password' class='ewd-feup-text-input' name='User_Password' class='ewd-feup-text-input' value='' />";
    $ReturnString .= "</div>";
    $ReturnString .= "<div class='feup-pure-control-group'>";
    $ReturnString .= "<label for='Confirm_User_Password' id='ewd-feup-edit-confirm-password' class='ewd-feup-field-label'>" . __('Repeat Password', 'EWD_FEUP') . ": </label>";
    $ReturnString .= "<input type='password' class='ewd-feup-text-input' name='Confirm_User_Password' class='ewd-feup-text-input' value='' />";
    $ReturnString .= "</div>";
    $ReturnString .= "<div class='feup-pure-control-group'><label for='submit'></label><input type='submit' class='ewd-feup-submit feup-pure-button feup-pure-button-primary' name='Edit_Password_Submit' value='" . $submit_text . "'></div>";
    $ReturnString .= "</div>";
    $ReturnString .= "</form>";
    return $ReturnString;
}
开发者ID:eugene-gromky-co,项目名称:mindfulnesssummit,代码行数:47,代码来源:Insert_Confirm_Forgot_Password.php

示例7: Try_Now

function Try_Now($atts)
{
    // Include the required global variables, and create a few new ones
    global $wpdb, $post, $user_message, $feup_success;
    global $ewd_feup_fields_table_name;
    global $redirect_field, $redirect_array_string, $redirect_page;
    $Custom_CSS = get_option("EWD_FEUP_Custom_CSS");
    $Salt = get_option("EWD_FEUP_Hash_Salt");
    $Username_Is_Email = get_option("EWD_FEUP_Username_Is_Email");
    $Time = time();
    $Sql = "SELECT * FROM {$ewd_feup_fields_table_name} ORDER BY Field_Order";
    $Fields = $wpdb->get_results($Sql);
    $ReturnString = "";
    if (isset($_GET['ConfirmEmail'])) {
        ConfirmUserEmail();
    }
    // Get the attributes passed by the shortcode, and store them in new variables for processing
    extract(shortcode_atts(array('redirect_page' => '#', 'redirect_field' => "", 'redirect_array_string' => "", 'submit_text' => __('Register', 'EWD_FEUP')), $atts));
    if (isset($_GET['ConfirmEmail'])) {
        $ConfirmationSuccess = ConfirmUserEmail();
    }
    if ($feup_success and $redirect_field != "") {
        $redirect_page = Determine_Redirect_Page($redirect_field, $redirect_array_string, $redirect_page);
    }
    if ($feup_success and $redirect_page != '#') {
        //brian autologin
        session_start();
        $_SESSION['Username'] = $_REQUEST['Username'];
        $_SESSION['User_Password'] = $_REQUEST['User_Password'];
        FEUPRedirect($redirect_page);
    }
    $ReturnString .= "<style type='text/css'>";
    $ReturnString .= $Custom_CSS;
    $ReturnString .= "</style>";
    if (!isset($ConfirmationSuccess)) {
        $ReturnString .= "<div id='ewd-feup-register-form-div'>";
        $ReturnString .= <<<HTML
<p class="terms_cond"><i>Get your 3-day free trial now.  No credit card required!</i></p>
HTML;
        if (isset($user_message['Message'])) {
            $ReturnString .= "<span id='signup_error_message' class='error-message'>" . $user_message['Message'] . "</span>";
        }
        $ReturnString .= "<form action='#' name='ewd-feup-register-form' method='post' id='ewd-feup-register-form' class='pure-form pure-form-aligned' enctype='multipart/form-data' data-toggle='validator' novalidate>";
        $ReturnString .= "<input type='hidden' name='ewd-feup-check' value='" . sha1(md5($Time . $Salt)) . "'>";
        $ReturnString .= "<input type='hidden' name='ewd-feup-time' value='" . $Time . "'>";
        $ReturnString .= "<input type='hidden' name='ewd-feup-action' value='register'>";
        $ReturnString .= "<input type='hidden' name='ewd-feup-post-id' value='" . $post->ID . "'>";
        $ReturnString .= '
        <div class="pure-control-group">
        <label for="Phone" id="ewd-feup-register-4"
                                               class="ewd-feup-field-label">Phone: </label><input name="Phone"
                                                                                                  id="ewd-feup-register-input-4"
                                                                                                  class="ewd-feup-text-input pure-input-1-3"
                                                                                                  type="tel"
                                                                                                  placeholder="Phone"
                                                                                                  data-inputmask="\'mask\': \'9999999999\'"
                                                                                                  required=""></div>
        <div class="pure-control-group"><label for="Gender" id="ewd-feup-register-11" class="ewd-feup-field-label" required>Gender: </label><select
                name="Gender" id="ewd-feup-register-input-11" class="ewd-feup-select pure-input-1-3" required>
                <option value="Female" selected>- Gender -</option> 
                <option value="Female" >Female</option>
                <option value="Male">Male</option>
                <!--<option value="Other">Other</option>-->
            </select></div>


';
        $ReturnString .= "<div class='pure-control-group hidden'>";
        if ($Username_Is_Email == "Yes") {
            $ReturnString .= "<label for='Username' id='ewd-feup-register-username-div' class='ewd-feup-field-label'>Hidden username</label>";
            if (isset($_POST['Username'])) {
                $ReturnString .= "<input type='text' class='ewd-feup-text-input' name='Username' required=false value='" . $_POST['Username'] . "'>";
            } else {
                $ReturnString .= "<input type='text' class='ewd-feup-text-input' name='Username' required=false placeholder='" . __('Email', 'EWD_FEUP') . "...'>";
            }
        } else {
            $ReturnString .= "<label for='Username' id='ewd-feup-register-username-div' class='ewd-feup-field-label'>Hidden username</label>";
            if (isset($_POST['Username'])) {
                $ReturnString .= "<input type='text' class='ewd-feup-text-input' name='Username' required=false value='" . $_POST['Username'] . "'>";
            } else {
                $ReturnString .= "<input type='text' class='ewd-feup-text-input' name='Username' required=false placeholder='" . __('Username', 'EWD_FEUP') . "...'>";
            }
        }
        $ReturnString .= "</div>";
        $ReturnString .= "<div class='pure-control-group hidden'>";
        $ReturnString .= "<label for='Password' id='ewd-feup-register-password-div' class='ewd-feup-field-label'>" . __('Password', 'EWD_FEUP') . ": </label>";
        if (isset($_POST['User_Password'])) {
            $ReturnString .= "<input type='password' class='ewd-feup-text-input' name='User_Password' value='" . $_POST['User_Password'] . "'>";
        } else {
            $ReturnString .= "<input type='password' class='ewd-feup-text-input' name='User_Password'>";
        }
        $ReturnString .= "</div>";
        $ReturnString .= "<div class='pure-control-group hidden'>";
        $ReturnString .= "<label for='Repeat Password' id='ewd-feup-register-password-confirm-div' class='ewd-feup-field-label'>" . __('Repeat Password', 'EWD_FEUP') . ": </label>";
        if (isset($_POST['Confirm_User_Password'])) {
            $ReturnString .= "<input type='password' class='ewd-feup-text-input' name='Confirm_User_Password' value='" . $_POST['Confirm_User_Password'] . "'>";
        } else {
            $ReturnString .= "<input type='password' class='ewd-feup-text-input' name='Confirm_User_Password'>";
        }
        $ReturnString .= "</div>";
//.........这里部分代码省略.........
开发者ID:jeremygeltman,项目名称:ThinkThinly,代码行数:101,代码来源:Try_Now.php

示例8: Insert_Edit_Profile

function Insert_Edit_Profile($atts)
{
    // Include the required global variables, and create a few new ones
    global $wpdb, $user_message, $feup_success;
    global $ewd_feup_fields_table_name, $ewd_feup_user_table_name, $ewd_feup_user_fields_table_name;
    $Custom_CSS = get_option("EWD_FEUP_Custom_CSS");
    $Salt = get_option("EWD_FEUP_Hash_Salt");
    $Time = time();
    $CheckCookie = CheckLoginCookie();
    $Sql = "SELECT * FROM {$ewd_feup_fields_table_name} WHERE Field_Show_In_Front_End='Yes' ORDER BY Field_Order";
    $Fields = $wpdb->get_results($Sql);
    $User = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$ewd_feup_user_table_name} WHERE Username='%s'", $CheckCookie['Username']));
    $UserData = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$ewd_feup_user_fields_table_name} WHERE User_ID='%d'", $User->User_ID));
    $ReturnString = "";
    // Get the attributes passed by the shortcode, and store them in new variables for processing
    extract(shortcode_atts(array('redirect_page' => '#', 'login_page' => '', 'omit_fields' => '', 'submit_text' => __('Edit Profile', 'EWD_FEUP')), $atts));
    $ReturnString .= "<style type='text/css'>";
    $ReturnString .= $Custom_CSS;
    $ReturnString .= "</style>";
    if ($CheckCookie['Username'] == "") {
        $ReturnString .= __('You must be logged in to access this page.', 'EWD_FEUP');
        if ($login_page != "") {
            $ReturnString .= "<br />" . __('Please', 'EWD_FEUP') . " <a href='" . $login_page . "'>" . __('login', 'EWD_FEUP') . "</a> " . __('to continue.', 'EWD_FEUP');
        }
        return $ReturnString;
    }
    if ($feup_success and $redirect_page != '#') {
        FEUPRedirect($redirect_page);
    }
    $ReturnString .= "<div id='ewd-feup-edit-profile-form-div'>";
    if (isset($user_message['Message'])) {
        $ReturnString .= $user_message['Message'];
    }
    $ReturnString .= "<form action='#' method='post' id='ewd-feup-edit-profile-form' class='pure-form pure-form-aligned' enctype='multipart/form-data'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-check' value='" . sha1(md5($Time . $Salt)) . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-time' value='" . $Time . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-action' value='edit-profile'>";
    $ReturnString .= "<input type='hidden' name='Omit_Fields' value='" . $omit_fields . "'>";
    $Omitted_Fields = explode(",", $omit_fields);
    foreach ($Fields as $Field) {
        if (!in_array($Field->Field_Name, $Omitted_Fields)) {
            if ($Field->Field_Required == "Yes") {
                $Req_Text = "required";
            } else {
                $Req_Text = "";
            }
            $Value = "";
            foreach ($UserData as $UserField) {
                if ($Field->Field_Name == $UserField->Field_Name) {
                    $Value = $UserField->Field_Value;
                }
            }
            $ReturnString .= "<div class='pure-control-group'>";
            $ReturnString .= "<label for='" . $Field->Field_Name . "' id='ewd-feup-edit-" . $Field->Field_ID . "' class='ewd-feup-field-label'>" . __($Field->Field_Name, 'EWD_FEUP') . ": </label>";
            if ($Field->Field_Type == "text" or $Field->Field_Type == "mediumint") {
                $ReturnString .= "<input name='" . $Field->Field_Name . "' id='ewd-feup-register-input-" . $Field->Field_ID . "' class='ewd-feup-text-input pure-input-1-3' type='text' value='" . $Value . "' " . $Req_Text . "/>";
            } elseif ($Field->Field_Type == "date") {
                $ReturnString .= "<input name='" . $Field->Field_Name . "' id='ewd-feup-register-input-" . $Field->Field_ID . "' class='ewd-feup-date-input pure-input-1-3' type='date' value='" . $Value . "' " . $Req_Text . "/>";
            } elseif ($Field->Field_Type == "datetime") {
                $ReturnString .= "<input name='" . $Field->Field_Name . "' id='ewd-feup-register-input-" . $Field->Field_ID . "' class='ewd-feup-datetime-input pure-input-1-3' type='datetime-local' value='" . $Value . "' " . $Req_Text . "/>";
            } elseif ($Field->Field_Type == "textarea") {
                $ReturnString .= "<textarea name='" . $Field->Field_Name . "' id='ewd-feup-register-input-" . $Field->Field_ID . "' class='ewd-feup-textarea pure-input-1-2' " . $Req_Text . ">" . $Value . "</textarea>";
            } elseif ($Field->Field_Type == "file") {
                $ReturnString .= __("Current file:", 'EWD_FEUP') . " " . substr($Value, 10) . " | ";
                $ReturnString .= "<input name='" . $Field->Field_Name . "' id='ewd-feup-register-input-" . $Field->Field_ID . "' class='ewd-feup-date-input pure-input-1-3' type='file' value='' " . $Req_Text . "/>";
            } elseif ($Field->Field_Type == "select") {
                $Options = explode(",", $Field->Field_Options);
                $ReturnString .= "<select name='" . $Field->Field_Name . "' id='ewd-feup-register-input-" . $Field->Field_ID . "' class='ewd-feup-select pure-input-1-3'>";
                foreach ($Options as $Option) {
                    $ReturnString .= "<option value='" . $Option . "' ";
                    if (trim($Option) == trim($Value)) {
                        $ReturnString .= "selected='selected'";
                    }
                    $ReturnString .= ">" . $Option . "</option>";
                }
                $ReturnString .= "</select>";
            } elseif ($Field->Field_Type == "radio") {
                $Counter = 0;
                $Options = explode(",", $Field->Field_Options);
                foreach ($Options as $Option) {
                    if ($Counter != 0) {
                        $ReturnString .= "</div><div class='pure-control-group ewd-feup-negative-top'><label class='pure-radio'></label>";
                    }
                    $ReturnString .= "<input type='radio' name='" . $Field->Field_Name . "' value='" . $Option . "' class='ewd-feup-radio' " . $Req_Text . " ";
                    if (trim($Option) == trim($Value)) {
                        $ReturnString .= "checked";
                    }
                    $ReturnString .= ">" . $Option;
                    $Counter++;
                }
            } elseif ($Field->Field_Type == "checkbox") {
                $Counter = 0;
                $Options = explode(",", $Field->Field_Options);
                $Values = explode(",", $Value);
                foreach ($Options as $Option) {
                    if ($Counter != 0) {
                        $ReturnString .= "</div><div class='pure-control-group ewd-feup-negative-top'><label class='pure-radio'></label>";
                    }
                    $ReturnString .= "<input type='checkbox' name='" . $Field->Field_Name . "[]' value='" . $Option . "' class='ewd-feup-checkbox' " . $Req_Text . " ";
                    if (in_array($Option, $Values)) {
//.........这里部分代码省略.........
开发者ID:katekbg,项目名称:2thinkers_cebu,代码行数:101,代码来源:Insert_Edit_Profile.php

示例9: Insert_Edit_Times


//.........这里部分代码省略.........
                    $ReturnString .= "<option value='" . $Option . "' ";
                    if (trim($Option) == trim($Value)) {
                        $ReturnString .= "selected='selected'";
                    }
                    $ReturnString .= ">" . $Option . "</option>";
                }
                $ReturnString .= "</select>";
            } elseif ($Field->Field_Type == "radio") {
                $Counter = 0;
                $Options = explode(",", $Field->Field_Options);
                foreach ($Options as $Option) {
                    if ($Counter != 0) {
                        $ReturnString .= "</div><div class='pure-control-group ewd-feup-negative-top  " . ($hidden ? "hidden" : "") . "'><label class='pure-radio'></label>";
                    }
                    $ReturnString .= "<input type='radio' name='" . $Field->Field_Name . "' value='" . $Option . "' class='ewd-feup-radio' " . $Req_Text . " ";
                    if (trim($Option) == trim($Value)) {
                        $ReturnString .= "checked";
                    }
                    $ReturnString .= ">" . $Option;
                    $Counter++;
                }
            } elseif ($Field->Field_Type == "checkbox") {
                $Counter = 0;
                $Options = explode(",", $Field->Field_Options);
                $Values = explode(",", $Value);
                foreach ($Options as $Option) {
                    if ($Counter != 0) {
                        $ReturnString .= "</div><div class='pure-control-group ewd-feup-negative-top  " . ($hidden ? "hidden" : "") . "'><label class='pure-radio'></label>";
                    }
                    $ReturnString .= "<input type='checkbox' name='" . $Field->Field_Name . "[]' value='" . $Option . "' class='ewd-feup-checkbox' " . $Req_Text . " ";
                    if (in_array($Option, $Values)) {
                        $ReturnString .= "checked";
                    }
                    $ReturnString .= ">" . $Option . "</br>";
                    $Counter++;
                }
            }
            $ReturnString .= "</div>";
            unset($Req_Text);
            if ($Field->Field_Name == "I need the most help...") {
                //                $ReturnString .= '<hr/>';
            }
        }
    };
    $Custom_CSS = get_option("EWD_FEUP_Custom_CSS");
    $Username_Is_Email = get_option("EWD_FEUP_Username_Is_Email");
    $CheckCookie = CheckLoginCookie();
    $ReturnString = "";
    // Get the attributes passed by the shortcode, and store them in new variables for processing
    extract(shortcode_atts(array('redirect_page' => '#', 'login_page' => '', 'submit_text' => __('Update Account', 'EWD_FEUP')), $atts));
    $ReturnString .= "<style type='text/css'>";
    $ReturnString .= $Custom_CSS;
    $ReturnString .= "</style>";
    if ($CheckCookie['Username'] == "") {
        $ReturnString .= __('You must be logged in to access this page.', 'EWD_FEUP');
        if ($login_page != "") {
            $ReturnString .= "<br />" . __('Please', 'EWD_FEUP') . " <a href='" . $login_page . "'>" . __('login', 'EWD_FEUP') . "</a> " . __('to continue.', 'EWD_FEUP');
        }
        return $ReturnString;
    }
    if ($feup_success and $redirect_page != '#') {
        FEUPRedirect($redirect_page);
    }
    $ReturnString .= "<div id='ewd-feup-edit-profile-form-div'>";
    if (isset($user_message['Message'])) {
        $ReturnString .= $user_message['Message'];
    }
    $ReturnString .= "<form novalidate action='#' method='post' id='ewd-feup-edit-profile-form' class='pure-form pure-form-aligned' enctype='multipart/form-data'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-check' value='" . sha1(md5($Time . $Salt)) . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-time' value='" . $Time . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-action' value='edit_reminder_times'>";
    //UserData: 0: Time zone; 1: OK to receive texts?; 2: Dinner; 3: Lunch; 4: Breakfast; 5: Phone; 6:Gender; 7: Last Name; 8 First Name: ; 9: I need the most help...; 10: Membership Expiry Date
    //Fields: 5: First Name; 0: Breakfast; 1: Lunch; 2: Dinner; 3: I need the most help...; 4: Select your time zone; 5: First Name; 6:Last Name; 7: Gender; 8: OK to receive texts?; 9: Phone;
    //    $times = array($UserData[4]->Field_Value, $UserData[3]->Field_Value, $UserData[2]->Field_Value);
    $ReturnString .= '<div><br/></div>';
    $ReturnString .= $print_field($Fields[0]);
    $ReturnString .= $print_field($Fields[1]);
    $ReturnString .= $print_field($Fields[2]);
    $ReturnString .= $print_field($Fields[3], true);
    $ReturnString .= $print_field($Fields[4], true);
    $ReturnString .= $print_field($Fields[5], true);
    $ReturnString .= $print_field($Fields[6], true);
    $ReturnString .= $print_field($Fields[7], true);
    $ReturnString .= $print_field($Fields[8], true);
    $ReturnString .= $print_field($Fields[9], true);
    $ReturnString .= $print_field($Fields[10], true);
    $ReturnString .= <<<HTML
<div><br/></div>
<div class="pure-control-group center">
    <select rel="" name="Time zone" id="ewd-feup-register-input-14" class="ewd-feup-select">
    <option value="Please select">Please select</option><option value="PST" selected="selected">Pacific Time Zone</option>
    <option value="EST">Eastern Standard Timezone</option><option value="CST">Central Standard Timezone</option><option value="MST">Mountain Standard Timezone</option></select>
</div>
HTML;
    /** @var string $submit_text */
    $ReturnString .= "<input type='submit' class='ewd-feup-submit pure-button pure-button-primary' name='Edit_Profile_Submit' value='Save'>";
    $ReturnString .= "</form>";
    $ReturnString .= "</div>";
    return $ReturnString;
}
开发者ID:jeremygeltman,项目名称:ThinkThinly,代码行数:101,代码来源:Insert_Edit_Times_brian.php

示例10: Insert_Edit_Profile

function Insert_Edit_Profile($atts)
{
    /** @var string $redirect_page
     * @var string $login_page
     * @var string $Time
     * @var string $Salt
     * @var string $omit_fields
     */
    // Include the required global variables, and create a few new ones
    global $wpdb, $user_message, $feup_success;
    global $ewd_feup_fields_table_name, $ewd_feup_user_table_name, $ewd_feup_user_fields_table_name;
    $Custom_CSS = get_option("EWD_FEUP_Custom_CSS");
    $CheckCookie = CheckLoginCookie();
    $Sql = "SELECT * FROM {$ewd_feup_fields_table_name} WHERE Field_Show_In_Front_End='Yes' ORDER BY `FIELD_ORDER` ASC";
    $Fields = $wpdb->get_results($Sql);
    $User = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$ewd_feup_user_table_name} WHERE Username='%s'", $CheckCookie['Username']));
    $UserData = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$ewd_feup_user_fields_table_name} WHERE User_ID='%d'", $User->User_ID));
    //If user doesn't have First name last name, send to first-time-sign-in
    $first_name = array_pop(array_filter($UserData, function ($v) {
        return $v->Field_Name == "First Name";
    }));
    $last_name = array_pop(array_filter($UserData, function ($v) {
        return $v->Field_Name == "Last Name";
    }));
    if (is_object($first_name) && empty($first_name->Field_Value) && is_object($last_name) && empty($last_name->Field_Value)) {
        FEUPRedirect('/first-time-sign-in');
    }
    $ReturnString = "";
    // Get the attributes passed by the shortcode, and store them in new variables for processing
    extract(shortcode_atts(array('redirect_page' => '#', 'login_page' => '', 'omit_fields' => '', 'submit_text' => __('Save settings', 'EWD_FEUP')), $atts));
    $ReturnString .= "<style type='text/css'>";
    $ReturnString .= $Custom_CSS;
    $ReturnString .= "</style>";
    if ($CheckCookie['Username'] == "") {
        $ReturnString .= __('You must be logged in to access this page.', 'EWD_FEUP');
        if ($login_page != "") {
            $ReturnString .= "<br />" . __('Please', 'EWD_FEUP') . " <a href='" . $login_page . "'>" . __('login', 'EWD_FEUP') . "</a> " . __('to continue.', 'EWD_FEUP');
            if (isset($_SESSION['user_name_changed']) && isset($_SESSION['message_count']) && !empty($_SESSION['user_name_changed']) && $_SESSION['message_count'] > 0) {
                $ReturnString .= "<p class='text-success'>Your email has been changed. Please use your new email for logging in.</p><br/>";
                $_SESSION['message_count']--;
            }
        }
        return $ReturnString;
    }
    if ($feup_success and $redirect_page != '#') {
        FEUPRedirect($redirect_page);
    }
    $ReturnString .= "<div id='ewd-feup-edit-profile-form-div'>";
    if (isset($user_message['Message'])) {
        $ReturnString .= "<div class='updated'><p>" . $user_message['Message'] . "</p></div>";
    }
    session_start();
    if (isset($_SESSION['first_sms_sent_to']) && !empty($_SESSION['first_sms_sent_to']) && isset($_SESSION['message_count']) && $_SESSION['message_count'] > 0) {
        $ReturnString .= "<br/><p class='text-success'>Welcome to ThinkThinly. A message has been sent to your number " . $_SESSION['first_sms_sent_to'] . "</p>";
        $_SESSION['message_count']--;
    }
    session_start();
    if (isset($_SESSION['user_updated'])) {
        $ReturnString .= "<br/><p class='updated'>" . $_SESSION['user_updated'] . "</p>";
        unset($_SESSION['user_updated']);
    }
    $ReturnString .= "<form action='#' method='post' id='ewd-feup-edit-profile-form' class='pure-form pure-form-aligned' enctype='multipart/form-data'>";
    //fields
    //5: First Name; 0: Breakfast; 1: Lunch; 2: Dinner; 3: I need the most help...; 4: Select your time zone; 5: First Name; 6:Last Name; 7: Gender; 8: OK to receive texts?; 9: Phone;
    $ReturnString .= "<input type='hidden' name='ewd-feup-check' value='" . sha1(md5($Time . $Salt)) . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-time' value='" . $Time . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-action' value='edit_your_settings'>";
    $ReturnString .= "<input type='hidden' name='Omit_Fields' value='" . $omit_fields . "'>";
    $Omitted_Fields = explode(",", $omit_fields);
    //Brian added. Force new username and password if user has just signed up
    $username = $User->Username;
    $user_email = $User->user_email;
    if (strpos($username, "@foobar.com") != false) {
        $username = "";
    }
    $ReturnString .= '<div class="pure-control-group hidden">';
    $ReturnString .= '<label for="Username">Phone number: </label>';
    $ReturnString .= '<input type="text" class="ewd-feup-text-input" name="Username" value="' . $username . '" required>';
    $ReturnString .= '</div>';
    if (empty($username)) {
        $ReturnString .= '<div class="pure-control-group">';
        $ReturnString .= '<label for ="User_Password">Password: </label>';
        $ReturnString .= '<input type = "password" class="ewd-feup-text-input" name = "User_Password" value = "" required>';
        $ReturnString .= '</div>';
        $ReturnString .= '<div class="pure-control-group">';
        $ReturnString .= '<label for="Confirm_User_Password" > Repeat Password: </label>';
        $ReturnString .= '<input type = "password" class="ewd-feup-text-input" name = "Confirm_User_Password" value = "" >';
        $ReturnString .= '</div>';
    }
    ////Brian added force new username
    $print_field = function ($Field) use($Omitted_Fields, $UserData, &$ReturnString) {
        $display_label = $Field->Field_Name;
        if ($display_label == "Breakfast") {
            $display_label = "Reminder time";
        }
        if ($display_label == "Lunch") {
            $display_label = "Reminder 2";
        }
        if ($display_label == "Dinner") {
            $display_label = "Reminder 3";
//.........这里部分代码省略.........
开发者ID:jeremygeltman,项目名称:ThinkThinly,代码行数:101,代码来源:Insert_Edit_Profile.php

示例11: Insert_Edit_Profile

function Insert_Edit_Profile($atts)
{
    /** @var string $redirect_page
     * @var string $login_page
     * @var string $Time
     * @var string $Salt
     * @var string $omit_fields
     */
    // Include the required global variables, and create a few new ones
    global $wpdb, $user_message, $feup_success;
    global $ewd_feup_fields_table_name, $ewd_feup_user_table_name, $ewd_feup_user_fields_table_name;
    $Custom_CSS = get_option("EWD_FEUP_Custom_CSS");
    $CheckCookie = CheckLoginCookie();
    $Sql = "SELECT * FROM {$ewd_feup_fields_table_name} WHERE Field_Show_In_Front_End='Yes' ORDER BY `FIELD_ORDER` ASC";
    $Fields = $wpdb->get_results($Sql);
    $User = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$ewd_feup_user_table_name} WHERE Username='%s'", $CheckCookie['Username']));
    $UserData = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$ewd_feup_user_fields_table_name} WHERE User_ID='%d'", $User->User_ID));
    $ReturnString = "";
    // Get the attributes passed by the shortcode, and store them in new variables for processing
    extract(shortcode_atts(array('redirect_page' => '#', 'login_page' => '', 'omit_fields' => '', 'submit_text' => __('Save settings', 'EWD_FEUP')), $atts));
    $ReturnString .= "<style type='text/css'>";
    $ReturnString .= $Custom_CSS;
    $ReturnString .= "</style>";
    if ($CheckCookie['Username'] == "") {
        $ReturnString .= __('You must be logged in to access this page.', 'EWD_FEUP');
        if ($login_page != "") {
            $ReturnString .= "<br />" . __('Please', 'EWD_FEUP') . " <a href='" . $login_page . "'>" . __('login', 'EWD_FEUP') . "</a> " . __('to continue.', 'EWD_FEUP');
            if (isset($_SESSION['user_name_changed']) && isset($_SESSION['message_count']) && !empty($_SESSION['user_name_changed']) && $_SESSION['message_count'] > 0) {
                $ReturnString .= "<p class='text-success'>Your email has been changed. Please use your new email for logging in.</p><br/>";
                $_SESSION['message_count']--;
            }
        }
        return $ReturnString;
    }
    if ($feup_success and $redirect_page != '#') {
        FEUPRedirect($redirect_page);
    }
    $ReturnString .= "<div id='ewd-feup-edit-profile-form-div'>";
    if (isset($user_message['Message'])) {
        $ReturnString .= "<div class='updated'><p>" . $user_message['Message'] . "</p></div>";
    }
    session_start();
    if (isset($_SESSION['first_sms_sent_to']) && !empty($_SESSION['first_sms_sent_to']) && isset($_SESSION['message_count']) && $_SESSION['message_count'] > 0) {
        $ReturnString .= "<br/><p class='text-success'>Welcome to ThinkThinly. A message has been sent to your number " . $_SESSION['first_sms_sent_to'] . "</p>";
        $_SESSION['message_count']--;
    }
    session_start();
    if (isset($_SESSION['user_updated'])) {
        $ReturnString .= "<br/><p class='updated'>" . $_SESSION['user_updated'] . "</p>";
        unset($_SESSION['user_updated']);
    }
    $ReturnString .= "<form action='#' method='post' id='ewd-feup-edit-profile-form' class='pure-form pure-form-aligned' enctype='multipart/form-data'>";
    //fields
    //5: First Name; 0: Breakfast; 1: Lunch; 2: Dinner; 3: I need the most help...; 4: Select your time zone; 5: First Name; 6:Last Name; 7: Gender; 8: OK to receive texts?; 9: Phone;
    $ReturnString .= "<input type='hidden' name='ewd-feup-check' value='" . sha1(md5($Time . $Salt)) . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-time' value='" . $Time . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-action' value='edit-profile'>";
    $ReturnString .= "<input type='hidden' name='Omit_Fields' value='" . $omit_fields . "'>";
    $Omitted_Fields = explode(",", $omit_fields);
    //Brian added. Force new username and password if user has just signed up
    $username = $User->Username;
    $user_email = $User->user_email;
    if (strpos($username, "@foobar.com") != false) {
        $username = "";
    }
    $ReturnString .= '<div class="pure-control-group hidden">';
    $ReturnString .= '<label for="Username">Phone number: </label>';
    $ReturnString .= '<input type="text" class="ewd-feup-text-input" name="Username" value="' . $username . '" required>';
    $ReturnString .= '</div>';
    if (empty($username)) {
        $ReturnString .= '<div class="pure-control-group">';
        $ReturnString .= '<label for ="User_Password">Password: </label>';
        $ReturnString .= '<input type = "password" class="ewd-feup-text-input" name = "User_Password" value = "" required>';
        $ReturnString .= '</div>';
        $ReturnString .= '<div class="pure-control-group">';
        $ReturnString .= '<label for="Confirm_User_Password" > Repeat Password: </label>';
        $ReturnString .= '<input type = "password" class="ewd-feup-text-input" name = "Confirm_User_Password" value = "" >';
        $ReturnString .= '</div>';
    }
    ////Brian added force new username
    //fixing data before display
    //5: First Name; 0: Breakfast; 1: Lunch; 2: Dinner; 3: I need the most help...; 4: Select your time zone; 5: First Name; 6:Last Name; 7: Gender; 8: OK to receive texts?; 9: Phone;
    $print_field = function ($Field) use($Omitted_Fields, $UserData, &$ReturnString) {
        $display_label = $Field->Field_Name;
        if ($display_label == "Breakfast") {
            $display_label = "Time 1";
        }
        if ($display_label == "Lunch") {
            $display_label = "Time 2";
        }
        if ($display_label == "Dinner") {
            $display_label = "Time 3";
        }
        if ($display_label == "Select your time zone") {
            $display_label = "Time Zone";
        }
        if (!in_array($Field->Field_Name, $Omitted_Fields)) {
            if ($Field->Field_Required == "Yes") {
                $Req_Text = "required";
            }
//.........这里部分代码省略.........
开发者ID:jeremygeltman,项目名称:ThinkThinly,代码行数:101,代码来源:Insert_Edit_Profile_tabs.php

示例12: Insert_Edit_Account_Form

function Insert_Edit_Account_Form($atts)
{
    global $wpdb, $user_message, $feup_success;
    global $ewd_feup_user_table_name;
    $Custom_CSS = get_option("EWD_FEUP_Custom_CSS");
    $Username_Is_Email = get_option("EWD_FEUP_Username_Is_Email");
    $CheckCookie = CheckLoginCookie();
    //$Sql = "SELECT * FROM $ewd_feup_fields_table_name ";
    //$Fields = $wpdb->get_results($Sql);
    $User = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$ewd_feup_user_table_name} WHERE Username='%s'", $CheckCookie['Username']));
    $feup_Label_Please = get_option("EWD_FEUP_Label_Please");
    if ($feup_Label_Please == "") {
        $feup_Label_Please = __("Please", 'EWD_FEUP');
    }
    $feup_Label_To_Continue = get_option("EWD_FEUP_Label_To_Continue");
    if ($feup_Label_To_Continue == "") {
        $feup_Label_To_Continue = __("To Continue", 'EWD_FEUP');
    }
    $feup_Label_Login = get_option("EWD_FEUP_Label_Login");
    if ($feup_Label_Login == "") {
        $feup_Label_Login = __("Login", 'EWD_FEUP');
    }
    $feup_Label_Email = get_option("EWD_FEUP_Label_Email");
    if ($feup_Label_Email == "") {
        $feup_Label_Email = __("Email", 'EWD_FEUP');
    }
    $feup_Label_Username = get_option("EWD_FEUP_Label_Username");
    if ($feup_Label_Username == "") {
        $feup_Label_Username = __("Username", 'EWD_FEUP');
    }
    $feup_Label_Password = get_option("EWD_FEUP_Label_Password");
    if ($feup_Label_Password == "") {
        $feup_Label_Password = __("Password", 'EWD_FEUP');
    }
    $feup_Label_Repeat_Password = get_option("EWD_FEUP_Label_Repeat_Password");
    if ($feup_Label_Repeat_Password == "") {
        $feup_Label_Repeat_Password = __("Repeat Password", 'EWD_FEUP');
    }
    $feup_Label_Password_Strength = get_option("EWD_FEUP_Label_Password_Strength");
    if ($feup_Label_Password_Strength == "") {
        $feup_Label_Password_Strength = __("Password Strength", 'EWD_FEUP');
    }
    $feup_Label_Require_Login_Message = get_option("EWD_FEUP_Label_Require_Login_Message");
    if ($feup_Label_Require_Login_Message == "") {
        $feup_Label_Require_Login_Message = __('You must be logged in to access this page.', 'EWD_FEUP');
    }
    $ReturnString = "";
    // Get the attributes passed by the shortcode, and store them in new variables for processing
    extract(shortcode_atts(array('redirect_page' => '#', 'login_page' => '', 'submit_text' => __('Update Account', 'EWD_FEUP')), $atts));
    $ReturnString .= "<style type='text/css'>";
    $ReturnString .= $Custom_CSS;
    $ReturnString .= EWD_FEUP_Add_Modified_Styles();
    if ($CheckCookie['Username'] == "") {
        $ReturnString .= $feup_Label_Require_Login_Message;
        if ($login_page != "") {
            $ReturnString .= "<br />" . $feup_Label_Please . " <a href='" . $login_page . "'>" . $feup_Label_Login . "</a> " . $feup_Label_To_Continue;
        }
        return $ReturnString;
    }
    if ($feup_success and $redirect_page != '#') {
        FEUPRedirect($redirect_page);
    }
    $ReturnString .= "<div id='ewd-feup-edit-account-form-div' class='ewd-feup-form-div'>";
    if (isset($user_message['Message'])) {
        $ReturnString .= $user_message['Message'];
    }
    $ReturnString .= "<form action='#' method='post' id='ewd-feup-edit-account-form' class='pure-form pure-form-aligned feup-pure-form-aligned'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-check' value='" . sha1(md5($Time . $Salt)) . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-time' value='" . $Time . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-action' value='edit-account'>";
    if ($Username_Is_Email == "Yes") {
        $ReturnString .= "<div class='feup-pure-control-group'>";
        $ReturnString .= "<label for='Username' id='ewd-feup-register-username-div' class='ewd-feup-field-label ewd-feup-login-label'>" . $feup_Label_Email . ": </label>";
        // $ReturnString .= "<div id='ewd-feup-register-username-div' class='ewd-feup-field-label'>" . __('Email', 'EWD_FEUP') . ": </div>";
        $ReturnString .= "<input type='email' class='ewd-feup-text-input' name='Username' value='" . $User->Username . "'>";
        $ReturnString .= "</div>";
    } else {
        $ReturnString .= "<div class='feup-pure-control-group'>";
        $ReturnString .= "<label for='Username' id='ewd-feup-register-username-div' class='ewd-feup-field-label ewd-feup-login-label'>" . $feup_Label_Username . ": </label>";
        // $ReturnString .= "<div id='ewd-feup-register-username-div' class='ewd-feup-field-label'>" . __('Username', 'EWD_FEUP') . ": </div>";
        $ReturnString .= "<input type='text' class='ewd-feup-text-input' name='Username' value='" . $User->Username . "'>";
        $ReturnString .= "</div>";
    }
    $ReturnString .= "<div class='feup-pure-control-group'>";
    $ReturnString .= "<label for='Password' id='ewd-feup-login-password-div' class='ewd-feup-field-label ewd-feup-login-label'>" . $feup_Label_Password . ": </label>";
    // $ReturnString .= "<div id='ewd-feup-register-password-div' class='ewd-feup-field-label'>" . __('Password', 'EWD_FEUP') . ": </div>";
    $ReturnString .= "<input type='password' class='ewd-feup-text-input ewd-feup-password-input' name='User_Password' value=''>";
    $ReturnString .= "</div>";
    $ReturnString .= "<div class='feup-pure-control-group'>";
    $ReturnString .= "<label for='Repeat-Password' id='ewd-feup-register-password-confirm-div' class='ewd-feup-field-label ewd-feup-login-label'>" . $feup_Label_Repeat_Password . ": </label>";
    // $ReturnString .= "<div id='ewd-feup-register-password-confirm-div' class='ewd-feup-field-label'>" . __('Repeat Password', 'EWD_FEUP') . ": </div>";
    $ReturnString .= "<input type='password' class='ewd-feup-text-input ewd-feup-check-password-input' name='Confirm_User_Password' value=''>";
    $ReturnString .= "</div>";
    $ReturnString .= "<div class='feup-pure-control-group'>";
    $ReturnString .= "<label for='Password Strength' id='ewd-feup-password-strength' class='ewd-feup-field-label'>" . $feup_Label_Password_Strength . ": </label>";
    $ReturnString .= "<span id='ewd-feup-password-result'>Too Short</span>";
    $ReturnString .= "</div>";
    $ReturnString .= "<div class='feup-pure-control-group'><label for='submit'></label><input type='submit' class='ewd-feup-submit feup-pure-button feup-pure-button-primary' name='Edit_Profile_Submit' value='" . $submit_text . "'></div>";
    $ReturnString .= "</form>";
    $ReturnString .= "</div>";
//.........这里部分代码省略.........
开发者ID:otkinsey,项目名称:wp-nsds,代码行数:101,代码来源:Insert_Edit_Account.php

示例13: Insert_Register_Form

function Insert_Register_Form($atts)
{
    // Include the required global variables, and create a few new ones
    global $wpdb, $post, $user_message, $feup_success;
    global $ewd_feup_fields_table_name;
    $Custom_CSS = get_option("EWD_FEUP_Custom_CSS");
    $Salt = get_option("EWD_FEUP_Hash_Salt");
    $Username_Is_Email = get_option("EWD_FEUP_Username_Is_Email");
    $Use_Captcha = get_option("EWD_FEUP_Use_Captcha");
    $Time = time();
    $Sql = "SELECT * FROM {$ewd_feup_fields_table_name} ORDER BY Field_Order";
    $Fields = $wpdb->get_results($Sql);
    $ReturnString = "";
    if (isset($_GET['ConfirmEmail'])) {
        ConfirmUserEmail();
    }
    // Get the attributes passed by the shortcode, and store them in new variables for processing
    extract(shortcode_atts(array('redirect_page' => '#', 'redirect_field' => "", 'redirect_array_string' => "", 'submit_text' => __('Register', 'EWD_FEUP')), $atts));
    if (isset($_GET['ConfirmEmail'])) {
        $ConfirmationSuccess = ConfirmUserEmail();
    }
    if ($feup_success and $redirect_field != "") {
        $redirect_page = Determine_Redirect_Page($redirect_field, $redirect_array_string, $redirect_page);
    }
    if ($feup_success and $redirect_page != '#') {
        FEUPRedirect($redirect_page);
    }
    $ReturnString .= "<style type='text/css'>";
    $ReturnString .= $Custom_CSS;
    $ReturnString .= EWD_FEUP_Add_Modified_Styles();
    if (!isset($ConfirmationSuccess)) {
        $ReturnString .= "<div id='ewd-feup-register-form-div' class='ewd-feup-form-div'>";
        if (isset($user_message['Message'])) {
            $ReturnString .= $user_message['Message'];
        }
        $ReturnString .= "<form action='#' method='post' id='ewd-feup-register-form' class='feup-pure-form feup-pure-form-aligned' enctype='multipart/form-data'>";
        $ReturnString .= "<input type='hidden' name='ewd-feup-check' value='" . sha1(md5($Time . $Salt)) . "'>";
        $ReturnString .= "<input type='hidden' name='ewd-feup-time' value='" . $Time . "'>";
        $ReturnString .= "<input type='hidden' name='ewd-feup-action' value='register'>";
        $ReturnString .= "<input type='hidden' name='ewd-feup-post-id' value='" . $post->ID . "'>";
        $ReturnString .= "<div class='feup-pure-control-group'>";
        if ($Username_Is_Email == "Yes") {
            $ReturnString .= "<label for='Username' id='ewd-feup-register-username-div' class='ewd-feup-field-label'>" . __('Email', 'EWD_FEUP') . ": </label>";
            if (isset($_POST['Username'])) {
                $ReturnString .= "<input type='email' class='ewd-feup-text-input' name='Username' value='" . $_POST['Username'] . "'>";
            } else {
                $ReturnString .= "<input type='email' class='ewd-feup-text-input' name='Username' placeholder='" . __('Email', 'EWD_FEUP') . "...'>";
            }
        } else {
            $ReturnString .= "<label for='Username' id='ewd-feup-register-username-div' class='ewd-feup-field-label'>" . __('Username', 'EWD_FEUP') . ": </label>";
            if (isset($_POST['Username'])) {
                $ReturnString .= "<input type='text' class='ewd-feup-text-input' name='Username' value='" . $_POST['Username'] . "'>";
            } else {
                $ReturnString .= "<input type='text' class='ewd-feup-text-input' name='Username' placeholder='" . __('Username', 'EWD_FEUP') . "...'>";
            }
        }
        $ReturnString .= "</div>";
        $ReturnString .= "<div class='feup-pure-control-group'>";
        $ReturnString .= "<label for='Password' id='ewd-feup-register-password-div' class='ewd-feup-field-label'>" . __('Password', 'EWD_FEUP') . ": </label>";
        if (isset($_POST['User_Password'])) {
            $ReturnString .= "<input type='password' class='ewd-feup-text-input' name='User_Password' value='" . $_POST['User_Password'] . "'>";
        } else {
            $ReturnString .= "<input type='password' class='ewd-feup-text-input' name='User_Password'>";
        }
        $ReturnString .= "</div>";
        $ReturnString .= "<div class='feup-pure-control-group'>";
        $ReturnString .= "<label for='Repeat Password' id='ewd-feup-register-password-confirm-div' class='ewd-feup-field-label'>" . __('Repeat Password', 'EWD_FEUP') . ": </label>";
        if (isset($_POST['Confirm_User_Password'])) {
            $ReturnString .= "<input type='password' class='ewd-feup-text-input' name='Confirm_User_Password' value='" . $_POST['Confirm_User_Password'] . "'>";
        } else {
            $ReturnString .= "<input type='password' class='ewd-feup-text-input' name='Confirm_User_Password'>";
        }
        $ReturnString .= "</div>";
        foreach ($Fields as $Field) {
            if ($Field->Field_Required == "Yes") {
                $Req_Text = "required";
            } else {
                $Req_Text = "";
            }
            $ReturnString .= "<div class='feup-pure-control-group'>";
            $ReturnString .= "<label for='" . $Field->Field_Name . "' id='ewd-feup-register-" . $Field->Field_ID . "' class='ewd-feup-field-label'>" . __($Field->Field_Name, 'EWD_FEUP') . ": </label>";
            if ($Field->Field_Type == "text" or $Field->Field_Type == "mediumint") {
                if (isset($_POST[str_replace(" ", "_", $Field->Field_Name)])) {
                    $ReturnString .= "<input name='" . $Field->Field_Name . "' id='ewd-feup-register-input-" . $Field->Field_ID . "' class='ewd-feup-text-input pure-input-1-3' type='text' value='" . $_POST[str_replace(" ", "_", $Field->Field_Name)] . "' " . $Req_Text . "/>";
                } else {
                    $ReturnString .= "<input name='" . $Field->Field_Name . "' id='ewd-feup-register-input-" . $Field->Field_ID . "' class='ewd-feup-text-input' type='text' placeholder='" . $Field->Field_Name . "' " . $Req_Text . "/>";
                }
            } elseif ($Field->Field_Type == "date") {
                $ReturnString .= "<input name='" . $Field->Field_Name . "' id='ewd-feup-register-input-" . $Field->Field_ID . "' class='ewd-feup-date-input' type='date' value='" . $Value . "' " . $Req_Text . "/>";
            } elseif ($Field->Field_Type == "datetime") {
                $ReturnString .= "<input name='" . $Field->Field_Name . "' id='ewd-feup-register-input-" . $Field->Field_ID . "' class='ewd-feup-datetime-input' type='datetime-local' value='" . $Value . "' " . $Req_Text . "/>";
            } elseif ($Field->Field_Type == "file") {
                $ReturnString .= "<input name='" . $Field->Field_Name . "' id='ewd-feup-register-input-" . $Field->Field_ID . "' class='ewd-feup-date-input' type='file' value='' " . $Req_Text . "/>";
            } elseif ($Field->Field_Type == "textarea") {
                $ReturnString .= "<textarea name='" . $Field->Field_Name . "' id='ewd-feup-register-input-" . $Field->Field_ID . "' class='ewd-feup-textarea' " . $Req_Text . ">" . $_POST[str_replace(" ", "_", $Field->Field_Name)] . "</textarea>";
            } elseif ($Field->Field_Type == "select") {
                $Options = explode(",", $Field->Field_Options);
                $ReturnString .= "<select name='" . $Field->Field_Name . "' id='ewd-feup-register-input-" . $Field->Field_ID . "' class='ewd-feup-select'>";
                foreach ($Options as $Option) {
                    $ReturnString .= "<option value='" . $Option . "' ";
//.........这里部分代码省略.........
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:101,代码来源:Insert_Register_Form.php

示例14: Insert_Login_Form

function Insert_Login_Form($atts)
{
    global $user_message, $feup_success;
    // Include the required global variables, and create a few new ones
    $Salt = get_option("EWD_FEUP_Hash_Salt");
    $Custom_CSS = get_option("EWD_FEUP_Custom_CSS");
    $Username_Is_Email = get_option("EWD_FEUP_Username_Is_Email");
    $Time = time();
    $Payment_Frequency = get_option("EWD_FEUP_Payment_Frequency");
    $Payment_Types = get_option("EWD_FEUP_Payment_Types");
    $Membership_Cost = get_option("EWD_FEUP_Membership_Cost");
    $Levels_Payment_Array = get_option("EWD_FEUP_Levels_Payment_Array");
    $feup_Label_Login = get_option("EWD_FEUP_Label_Login");
    if ($feup_Label_Login == "") {
        $feup_Label_Login = __("Login", 'EWD_FEUP');
    }
    $feup_Label_Email = get_option("EWD_FEUP_Label_Email");
    if ($feup_Label_Email == "") {
        $feup_Label_Email = __("Email", 'EWD_FEUP');
    }
    $feup_Label_Username = get_option("EWD_FEUP_Label_Username");
    if ($feup_Label_Username == "") {
        $feup_Label_Username = __("Username", 'EWD_FEUP');
    }
    $feup_Label_Password = get_option("EWD_FEUP_Label_Password");
    if ($feup_Label_Password == "") {
        $feup_Label_Password = __("Password", 'EWD_FEUP');
    }
    $ReturnString = "";
    // Get the attributes passed by the shortcode, and store them in new variables for processing
    extract(shortcode_atts(array('redirect_page' => '#', 'redirect_field' => '', 'redirect_array_string' => '', 'submit_text' => __('Login', 'EWD_FEUP')), $atts));
    $ReturnString .= "<style type='text/css'>";
    $ReturnString .= $Custom_CSS;
    $ReturnString .= EWD_FEUP_Add_Modified_Styles();
    $ReturnString .= "</style>";
    if ($_POST['Payment_Required'] == "Yes") {
        if ($Payment_Types == "Membership" and is_numeric($Membership_Cost) and $Membership_Cost != "" or $Payment_Types == "Levels" and sizeof($Levels_Payment_Array) > 0) {
            $ReturnString .= do_shortcode("[account-payment]");
            return $ReturnString;
        }
    }
    if ($feup_success and $redirect_field != "") {
        $redirect_page = Determine_Redirect_Page($redirect_field, $redirect_array_string, $redirect_page);
    }
    // if there is no redirect page, have the current page reload
    if ($feup_success and $redirect_page != '#') {
        FEUPRedirect($redirect_page);
    }
    $ReturnString .= "<div id='ewd-feup-login' class='ewd-feup-login-form-div' class='ewd-feup-form-div'>";
    if (isset($user_message['Message'])) {
        $ReturnString .= $user_message['Message'];
    }
    if (strpos($user_message['Message'], "Payment required.") !== false) {
        $ReturnString .= "</div>";
        return $ReturnString;
    }
    //Payment required
    $ReturnString .= "<form action='user-blog' method='post' id='ewd-feup-login-form' class='pure-form pure-form-aligned feup-pure-form-aligned'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-check' value='" . sha1(md5($Time . $Salt)) . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-time' value='" . $Time . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-action' value='login'>";
    $ReturnString .= "<div class='feup-pure-control-group'>";
    if ($Username_Is_Email == "Yes") {
        $ReturnString .= "<label for='Username' id='ewd-feup-login-username-div' class='ewd-feup-field-label ewd-feup-login-label'>" . $feup_Label_Email . ": </label>";
        $ReturnString .= "<input type='email' class='ewd-feup-text-input ewd-feup-login-field' name='Username' placeholder='" . $feup_Label_Email . "...'>";
    } else {
        $ReturnString .= "<label for='Username' id='ewd-feup-login-username-div' class='ewd-feup-field-label ewd-feup-login-label'>" . $feup_Label_Username . ": </label>";
        $ReturnString .= "<input type='text' class='ewd-feup-text-input ewd-feup-login-field' name='Username' placeholder='" . $feup_Label_Username . "...'>";
    }
    $ReturnString .= "</div>";
    $ReturnString .= "<div class='feup-pure-control-group'>";
    $ReturnString .= "<label for='Password' id='ewd-feup-login-password-div' class='ewd-feup-field-label ewd-feup-login-label'>" . $feup_Label_Password . ": </label>";
    $ReturnString .= "<input type='password' class='ewd-feup-text-input ewd-feup-login-field' name='User_Password'>";
    $ReturnString .= "</div>";
    $ReturnString .= "<div class='feup-pure-control-group'>";
    $ReturnString .= "<label for='Submit'></label><input type='submit' class='ewd-feup-submit ewd-feup-login-submit feup-pure-button feup-pure-button-primary' name='Login_Submit' value='" . $feup_Label_Login . "'>";
    $ReturnString .= "</div>";
    $ReturnString .= "</form>";
    $ReturnString .= "</div>";
    return $ReturnString;
}
开发者ID:otkinsey,项目名称:wp-nsds,代码行数:81,代码来源:Insert_Login_Form.php

示例15: Insert_Login_Form

function Insert_Login_Form($atts)
{
    global $user_message, $feup_success;
    global $ewd_feup_fields_table_name, $ewd_feup_user_table_name, $ewd_feup_user_fields_table_name, $wpdb;
    // Include the required global variables, and create a few new ones
    $Salt = get_option("EWD_FEUP_Hash_Salt");
    $Custom_CSS = get_option("EWD_FEUP_Custom_CSS");
    $Username_Is_Email = get_option("EWD_FEUP_Username_Is_Email");
    $Time = time();
    $ReturnString = "";
    // Get the attributes passed by the shortcode, and store them in new variables for processing
    extract(shortcode_atts(array('redirect_page' => '#', 'redirect_field' => '', 'redirect_array_string' => '', 'submit_text' => __('Login', 'EWD_FEUP')), $atts));
    $ReturnString .= "<style type='text/css'>";
    $ReturnString .= $Custom_CSS;
    $ReturnString .= "</style>";
    /**
     * @var string $redirect_field
     * @var string $redirect_page
     * @var string $redirect_array_string
     */
    if ($feup_success and $redirect_field != "") {
        $redirect_page = Determine_Redirect_Page($redirect_field, $redirect_array_string, $redirect_page);
    }
    if ($feup_success and $redirect_page != '#') {
        $CheckCookie = CheckLoginCookie();
        $User = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$ewd_feup_user_table_name} WHERE Username='%s'", $CheckCookie['Username']));
        if ($User->subscription == "active") {
            $redirect_page = "/your-settings";
        } else {
            $UserData = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$ewd_feup_user_fields_table_name} WHERE User_ID='%d'", $User->User_ID));
            $expiry_date = null;
            foreach ($UserData as $u) {
                if ($u->Field_Name == "Membership Expiry Date") {
                    $expiry_date = $u->Field_Value;
                }
            }
            //$UserData[10]->Field_Value;
            //compare date here
            if (time() - strtotime($expiry_date) > -3600 * 24) {
                $redirect_page = '/account-expired';
            } elseif ($expiry_date == "") {
                $redirect_page = '/you-did-it';
            } else {
                $redirect_page = '/your-settings';
            }
        }
        FEUPRedirect($redirect_page);
    }
    $ReturnString .= "<div id='ewd-feup-login-form-div'>";
    if (isset($user_message['Message'])) {
        $ReturnString .= $user_message['Message'];
    }
    $ReturnString .= "<form action='#' method='post' id='ewd-feup-login-form' class='pure-form pure-form-aligned'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-check' value='" . sha1(md5($Time . $Salt)) . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-time' value='" . $Time . "'>";
    $ReturnString .= "<input type='hidden' name='ewd-feup-action' value='login'>";
    $ReturnString .= "<div class='pure-control-group'>";
    if ($Username_Is_Email == "Yes") {
        $ReturnString .= "<label for='Username' id='ewd-feup-login-username-div' class='ewd-feup-field-label'>Phone</label>";
        $ReturnString .= "<input type='text' class='ewd-feup-text-input' name='Username' placeholder='Phone Number...'>";
    } else {
        $ReturnString .= "<label for='Username' id='ewd-feup-login-username-div' class='ewd-feup-field-label'>Phone Number: </label>";
        $ReturnString .= "<input type='text' class='ewd-feup-text-input' name='Username' placeholder='Phone Number...'>";
    }
    $ReturnString .= "</div>";
    $ReturnString .= "<div class='pure-control-group'>";
    $ReturnString .= "<label for='Password' id='ewd-feup-login-password-div' class='ewd-feup-field-label'>" . __('Password', 'EWD_FEUP') . "</label>";
    $ReturnString .= "<input type='password' class='ewd-feup-text-input' name='User_Password'>";
    $ReturnString .= "</div>";
    $ReturnString .= "<input type='submit' class='ewd-feup-submit pure-button pure-button-primary' name='Login_Submit' value='" . $submit_text . "'>";
    $ReturnString .= "</form>";
    $ReturnString .= "</div>";
    return $ReturnString;
}
开发者ID:jeremygeltman,项目名称:ThinkThinly,代码行数:74,代码来源:Insert_Login_Form.php


注:本文中的FEUPRedirect函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。