Thread: Login Link
View Single Post
  #20  
Old 03-29-2004, 02:40 PM
 
laureon laureon is offline
 

Senior Member
  
Join Date: Oct 2003
Posts: 171
 

Default

Hi,

Creating a seperate 'Login' page:

Step 1 - Create a file named 'myaccount.php' in the folder '[xcart]/customer' in the root x-cart directory. i.e. NOT [skin1]/customer.

In the file 'myaccount.php' paste the following code, ensuring you leave no 'white spaces' at the bottom of the file.

Code:
<? require "./auth.php"; require $xcart_dir."/include/categories.php"; $smarty->assign("main", "myaccount"); $smarty->assign("location",$location); $smarty->display("customer/home.tpl"); ?>

Step 2 - Creating a page to inform Smarty of which template to use:

In [skin1]/common_templates.tpl add the following after the
first if statement:

Code:
{elseif $main eq "myaccount"} {include file="customer/main/myaccount.tpl"}

Step 3 - Creating the 'login' page

Create a new template 'myaccount.tpl' in [skin1]/customer/main. Then simply copy the login code from: '[skin1]/auth.tpl, inbetween the '{capture} and {/capture} tags as we don't want smarty to base the login page on the 'menu.tpl' template place it between the tags '
Code:
{include file="location.tpl"} {capture name=dialog}
and
Code:
{include file="dialog.tpl" title="My Account" content=$smarty.capture.dialog extra="width=100%"}
which should give you something that looks like:

Code:
{assign var="last_location" value="My Account"} { include file="location.tpl" last_location=$last_location } {capture name=dialog} <TABLE border=0 cellPadding=0 cellSpacing=0 width=100%> {if $config.General.use_https_login eq "Y"} {assign var="form_url" value=$https_location} {else} {assign var="form_url" value=$current_location} {/if} <FORM action="{$form_url}/include/login.php" method=post name=authform> {if $config.General.use_secure_login_page eq "Y"} {* use_secure_login_page *} <tr> <td> {if $usertype eq "C"} {assign var="slogin_url" value=$catalogs_secure.customer} {elseif $usertype eq "P" and $active_modules.Simple_Mode eq "Y" or $usertype eq "A"} {assign var="slogin_url" value=$catalogs_secure.admin} {elseif $usertype eq "P"} {assign var="slogin_url" value=$catalogs_secure.provider} {elseif $usertype eq "B"} {assign var="slogin_url" value=$catalogs_secure.partner} {/if} {include file="buttons/secure_login.tpl"} </td> </tr> {else} {* use_secure_login_page *} <tr> <td class=VertMenuItems> <font class=VertMenuItems>{$lng.lbl_username}</font> <input type=text name=username size=16> <font class=VertMenuItems>{$lng.lbl_password}</font> <input type=password name=password size=16> <input type=hidden name=mode value=login> {if $active_modules.Simple_Mode ne "" and $usertype ne "C" and $usertype ne "B"} <input type=hidden name=usertype value="P"> {else} <input type=hidden name=usertype value="{$usertype}"> {/if} <input type=hidden name=redirect value="{$redirect}"> </td></tr> <tr> <td height=24 class=VertMenuItems> {if $js_enabled} {include file="buttons/login_menu.tpl"} {else} {include file="buttons/login_menu.tpl"} {/if} </td> </tr> {/if} {* use_secure_login_page *} {if $usertype eq "C" or ($usertype eq "B" and $config.Modules.partner_register eq "Y")} <tr> <td height=24 nowrap class=VertMenuItems> {include file="buttons/create_profile_menu.tpl"} </td> </tr> {/if} {if $usertype eq "P" and $active_modules.Simple_Mode eq "Y" or $usertype eq "A"} <tr> <td class=VertMenuItems> <div align=left>{$lng.lbl_insecure_login} </div> </td> </tr> {/if} {if $usertype eq "C"} <tr> <td class=VertMenuItems> <div align=right> {if $js_enabled} {$lng.txt_javascript_disabled} {else} {$lng.txt_javascript_enabled} {/if} </div> </td> </tr> {/if} </form> </table> {/capture} {include file="dialog.tpl" title="My Account" content=$smarty.capture.dialog extra="width=100%"}

You will need to create a link to call 'myaccount.php' and that is pretty much it.

This has been tested on v3.5.5.

You can of course change modify the template to your liking and should form the basis of a 'seperate' login page.

Any comments appreciated!
__________________
X-Cart Gold Version: 4.0.17
X-Configurator
X-AOM
X-FancyCategories
X-RMA
X-Offers
Reply With Quote