Шаблоны

    WebLoginPE: Шаблоны

    Шаблоны сниппета WebLoginPE Simple Register Profle Manager Users Taconite.

    Every view that is presented to the user can be customized using MODx chunks.

    The snippet changes between views based on a post-back system. It looks for the value of $_POST['service'] to determine which view to display. In the case of the default view for a logged in user, a form is presented with two submit buttons. The buttons each have the name attribute set to "service", but a different value

     
    
    

    If the "Log Out" button is pressed, the $_POST['service'] value is "logout" and WebLoginPE executes the code in the case 'logout': block.

    The services in WebLoginPE are:

    &messageTpl

    WebLoginPE will display many messages, either confirmations or errors. The message will be placed in a placeholder ([+wlpe.message+]) which you can put anywhere in your custom form or anywhere on the page.

    When creating the chunk for &messageTpl you should place "[+wlpe.message.text+]" wherever you want the actual message to show up in the template.

    Default:

    <div><p>[+wlpe.message.text+]</p></div>
    

    &loginFormTpl

    The view presented to the user asking for their "username" and "password". Required form field names are "username" and "password". Optional inputs are a checkbox named "rememberme" which sets a 5 year cookie, or a select named "stayloggedin" which sets a cookie for the number of seconds specified in each options value. The cookie name is "WebLoginPE" and the value is a MD5 hash of the username and password (usernames and passwords should never be set in the open because cookies are saved in plain text. That is why WebLoginPE converts them to a hash). When the user returns to your site, WebLoginPE grabs the cookie, uses an algorithm to decode the username and password, then automatically logs the user in.

    Default: defaultLoginFormTpl

    [+wlpe.message+]
    
    Web User Login Form

    &successTpl

    The view presented to the user asking for their "username" and "password". Required form field names are "username" and "password". Optional inputs are a checkbox named "rememberme" which sets a 5 year cookie, or a select named "stayloggedin" which sets a cookie for the number of seconds specified in each options value. The cookie name is "WebLoginPE" and the value is a MD5 hash of the username and password (usernames and passwords should never be set in the open because cookies are saved in plain text. That is why WebLoginPE converts them to a hash). When the user returns to your site, WebLoginPE grabs the cookie, uses an algorythm to decode the username and password, then automatically logs the user in.

    Default: defaultLoginSuccessTpl

    [+wlpe.message+]
    
    <img id="wlpeMyProfileImg" src="[+user.photo+]" alt="[+user.username+]" title="[+user.username+]" height="30" width="30">

    Welcome back [+user.username+]!

    You have logged into [(site_name)] [+user.logincount+] times now.
    Your last login was [+user.lastlogin+]

    [+user.comment+]

    &registerTpl

    The view presented to the user to register for a new account. You can have a form input for every field in the database table "web_user_attributes" and all the fields set in &customFields*. When setting up your form, the input name attribute should be the same as the field name in the table. For example, the form input asking for the users mobile phone number (table field "mobilephone") should be:

    <input type="text" name="mobilephone" value="[+post.mobilephone+]" />

    Placeholders for values in the $_POST array are available for use in your forms so that if there is an error, all the information that the user entered in your form is not lost. As you can see in the example for "mobilephone" above, the placeholder "[+post.inputname+]" is set for each input name attribute.

    If you specified form fields in &inputHandler, you could also use the [+form.fieldname+] placeholder here.

    *It is advised against providing inputs for id, internalKey, role, blocked, blockedunitl, blockedafter, failedlogincount, and sessionid as that can SERIOUSLY corrupt your entire MODx installation. Those fields should only be edited by the web master from the back end.

    Default Instant: defaultRegisterInstantFormTpl

    [+wlpe.message+]
    

    Use this form to register for a new user account.
    Filds marked with * are required.

    Register for a new user account [+form.country+] [+form.gender+] <img id="wlpeUserDefaultImage" src="[+user.defaultphoto+]" alt="Default User Image" title="Default User Image" height="100" width="100">

    No bigger than 100kb. will be resized to 100 x 100.

    <img id="wlpeCaptchaImage" src="[+form.captcha+]" width="148" height="60" alt="If you have trouble reading the code, click on the code itself to generate a new random code.">

    Terms of Service/Privacy Policy

    [+tos+]

    Default Verify: defaultRegisterVerifyFormTpl

    [+wlpe.message+]
    

    Enter your email address, your name, and your desired username in the fields below.

    A password will be emailed to you with instructions on how to activate Your account.

    &registerSuccessTpl

    The view presented to the user to after successfully registering for a new account. If you want this custom view to be displayed after registration, DO NOT put the &regSuccessId parameter in your call. The default is the whatever is specified in &loginFormTpl so the user can log in after registering.

    Default: defaultLoginFormTpl

    [+wlpe.message+]
    
    Web User Login Form

    &tosChunk

    In your registration form, you may want your users to agree to your "Terms Of Service / Privacy Policy" before you accept their registration. You specify your terms of service chunk with this parameter, then in your registration form, use the placeholder [+tos+] (which is set by WebLoginPE to hold your tosChunk) where you want your Terms of Service to be displayed and put a checkbox with the name attribute set to "tos". You should also specify "tos" in the &regRequired parameter to make sure that if they don't check it (signifying that they agree) they will not be allowed to register.

    Terms of Service/Privacy Policy

    [+tos+]

    The default terms of service were generated by Kinky Solution's Terms Of Service / Privacy Policy Document Generator.

    Default: defaultTosTpl

    &profileTpl

    The form presented to the user which allows them to modify their attributes stored in the databse. Like &registerTpl, this form can contain as many or as few of the table fields from web_user_attributes AND the extended user attributes table as you want. The difference in this form is that you can set the value of the form fields to one of the placeholders. For example the "Full Name" input would look like:

    
    

    If you specified form fields in &inputHandler, you could also use the [+form.fieldname+] placeholder here and the users selections and checks would be remembered and pre-selected or pre-checked.

    Default: defaultProfileTpl

    [+wlpe.message+]
    

    Hello [+user.fullname+] ([+user.username+])!

    Use this form to update your profile information

    Your User Profile [+form.country+] [+form.gender+] <img id="wlpeUserProfilePhotoImg" src="[+user.photo+]" alt="[+user.username+]" title="[+user.fullname+]" height="100" width="100">

    No bigger than 100kb. will be resized to 100 x 100.

    Change your password

    Change your password
    (leave blank if you do not want a new password).

    &userOuterTpl

    The template that works as a "wrapper" for each of your lists in type=`users`.

    Default: defaultUserOuterTpl

    [+wlpe.message+]
    

    [+view.title+]

    [+view.list+]

    &usersTpl

    When you have called WebLoginPE with &type=`users`, each user in the databases is listed and (in the default template) their user image and username are links to a separate area that can list more details about the user and give other users a form to contact that user. Since this view may contain privileged data, you may want to use "Access Permissions" on this page. The &usersTpl paramter chunk should define the structure of the block for EACH user on this page. It will loop through each user, one at a time, exchange the placeholders for their info, add it to the que, then go to the next user. When it has finished looping over each user, it will return the entire que to the page. This view has access to the [+user.age+] placeholder that calculates the user's age based on their DOB.

    If you specified form fields in &customFields parameter for register and profile, you should also specify them here to make sure placeholders are set for them.

    Default: defaultUsersTpl

    [+wlpe.message+]
    
    <a href="[~[*id*]~]?service=viewprofile&username=[+view.username+]"> <img src="[+view.photo+]" alt="[+view.photo+]" title="[+view.username+]" height="100" width="100"> </a> <a href="[~[*id*]~]?service=viewprofile&username=[+view.username+]">

    [+view.username+]

    </a>

    Username: [+view.username+]

    Age: [+view.age+]

    Last Login: [+view.thislogin+]

    [+view.comment+]

    &viewProfileTpl

    When you have called WebLoginPE with &type=`users`, each user in the databases is listed and (in the default template) their user image and username are links to a separate area that can list more details about the user and give other users a form to contact that user. As with &usersTpl, this view may contain privileged data, you may want to use "Access Permissions" on the calling page. The &viewProfileTpl paramter chunk should define the structure of this separate area to view more details on an individual user. This view has access to the [+view.age+] placeholder that calculates the user's age based on their DOB.

    If you specified form fields in &customFields parameter for register and profile, you should also specify them here to make sure placeholders are set for them.

    Default: defaultViewProfileTpl

    [+wlpe.message+]
    

    Viewing the profile of "[+view.username+]":

    Username: [+view.username+]
    Full Name: [+view.fullname+]
    Email: [+view.email+]
    Phone Number: [+view.phone+]
    Mobile Phone Number: [+view.mobilephone+]
    Fax Number: [+view.fax+]
    State: [+view.state+]
    Country: [+view.country+]
    Age: [+view.age+]
    Gender: [+view.gender+]
    Signature: [+view.comment+]
    Photo: <img src="[+view.photo+]" alt="[+view.photo+]" title="[+view.username+]">

    Contact [+view.username+]

    &profileDeleteTpl

    The form presented to the user to confirm that they actually want to delete their account. This is presented after the user has clicked the "Delete My Profile" button on the profile page. We want to make sure they didn't click it by accident!

    Default: defaultProfileDeleteTpl

    [+wlpe.message+]
    
    Delete Your Profile

    WARNING!

    You are about to delete your profile. Are you sure you want to continue?

    &manageOuterTpl

    The template that works as a "wrapper" for each of your lists in type=`manager`. The default is the same as the default &userOuterTpl.

    Default: defaultUserOuterTpl

    [+wlpe.message+]
    

    [+view.title+]

    [+view.list+]

    &manageTpl

    The template (chunk) that will be applied to each user in type=`manager`.

    Default: defaultManageTpl

    <img src="[+view.photo+]" alt="[+view.photo+]" title="[+view.username+]" height="100" width="100">

    [+view.username+]

    Username: [+view.username+]

    Age: [+view.age+]

    Current Status: [+view.status+]

    &manageProfileTpl

    The Form (chunk) that will be displayed when editing a user's attributes in type=`manager`.

    Default: defaultManageProfileTpl

    [+wlpe.message+]
    

    Editing the profile of [+view.username+] ([+view.fullname+])!

    Use this form to edit [+view.username+]'s profile information

    [+view.username+]'s User Profile [+form.country+] [+form.gender+] <img id="wlpeUserProfilePhotoImg" src="[+view.photo+]" alt="[+view.username+]" title="[+view.fullname+]" height="100" width="100">

    No bigger than 100kb. will be resized to 100 x 100.

    Change your password

    Change your password
    (leave blank if you do not want to set a new password for this user).

    &manageDeleteTpl

    The Form (chunk) that will be displayed asking for confirmation of intention to delete after clicking the "Delete Profile" button for a user in type=`manager`.

    Default: defaultManageDeleteTpl

    [+wlpe.message+]
    
    Delete User Profile

    WARNING!

    You are about to delete the profile of "[+post.username+]". Are you sure you want to continue?

    &resetTpl

    The form presented when a user clicks the "Forgot Password" button. This form has only one input ("email"). They enter their email address, WebLoginPE sets a random password and key in the web_users table's cachepwd field and sends them a link to the URL of the page that this was called from with the string "?service=activate&userid=3&activationkey=kl3tW5rtDi where "3" would be the users internalKey and "kl3tW5rtDi" would be the randomly generated activation key which is a 10 character string.

    Default: defaultResetFormTpl

    [+wlpe.message+]
    

    Don't Worry, it happens to everyone.

    Enter your email address in the field below and we will set a temporary password for your account.

    This temporary password will be emailed to you with instructions on how to activate it.

    &activateTpl

    This form is presented when the user clicks the link in the email that was sent from the &resetTpl form. It is the view for service=activate. The user is asked for the temporary password that was emailed to them and they are given the option to set a new password. WebLoginPE then checks that the temporary password and the activationkey match what was stored in the cachepwd field for the internalKey in the web_users table. If everything checks out, the new password that the user entered is activated. The default form has three input fields with the name attributes "activationpassword", "newpassword", and "newpassword.confirm".

    Default: defaultActivationFormTpl

    [+wlpe.message+]
    

    &notifyTpl

    This is not a view presented to the user, but a template format for the email message that will be sent to the addresses in &notify. It uses all the placeholders that are available in the Tools > Configuration > User > Web signup email template, with the addition of [+uem+] for the user's email address. The user's password will NOT be available in this template.

    Default: defaultNotifyTpl

    Hello, my name is [+ufn+] and I just signed up at [+sname+] as "[+uid+]" using WebLoginPE.
    My email address is [+uem+].
    P.S. This message was auto generated by WebLoginPE and PHPMailer.
    

    &notifySubject

    This is also not a view presented to the user, but a definition of the subject line for the email message that will be sent to the addresses in &notify.

    Default:

    New Web User for [(site_name)].