X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Login Link (https://forum.x-cart.com/showthread.php?t=2355)

B00MER 03-29-2004 02:54 PM

A much easier approach is to copy paste the <FORM>...</FORM> of the login source on your site and make small minor adjustments to images, and the action location of the form if need be, and paste it into a static page and just call it via pages.php?pageid=1 or such. :)

But this looks groovy :D

laureon 03-29-2004 04:21 PM

BOOMER, if you try my code, the navigation trail only shows the 'site name' and not 'sitename > My Account'. Am I missing something somewhere?

Cheers BOOMER

B00MER 03-30-2004 07:02 AM

Code:

{assign var="last_location" value="My Account"}
{ include file="location.tpl" last_location=$last_location }


:wink:

laureon 03-30-2004 07:15 AM

Thanks BOOMER - your code worked a treat!

domspe 03-30-2004 08:46 AM

I got this code here from x-cart - hopefully it can help someone else!
(amazing, they did something fast & free!!)

Code:

code for login.php

<?php
require_once "./auth.php";
$smarty->display("custom_login.tpl");
?>

Template (skin1/custom_login.tpl)

{* Smarty *}
{assign var="form_url" value=$current_location}
<TABLE border=0 cellPadding=0 cellSpacing=0 width=100%>
<FORM action="{$form_url}/include/login.php" method=post name=authform>
<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>
<input type=hidden name=usertype value="C">
<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>
</form>
</table>


domspe 03-31-2004 10:51 AM

FYI - i'd use the script by laureon

x-cart's version left much to be desired after i implemented laureon's version.

just an FYI for everyone! :)

jburdi 04-07-2004 07:17 AM

this is all good stuff, but is there anyway to have a button that says login if the user isnt logged in and logout if the user is logged in, kinda like the way it works on the real auth box.

this would make the mod perfect.

any information would be greatly appreciated.

laureon 04-07-2004 07:53 AM

If you insert this code: {if $login eq "" } before the table tags as below:

{capture name=dialog}
{if $login eq "" }
<TABLE border=0 cellPadding=0 cellSpacing=0 width=100%>
{if $config.General.use_https_login eq "Y"}

then paste this code after the closing </table> tag and just above '{/capture}
{include file="dialog.tpl" title="My Account" content=$smarty.capture.dialog
extra="width=100%"}'

Code:

{else}
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<form action="{$xcart_web_dir}/include/login.php" method=post name=loginform>
<tr>
<td></td>
<td class=VertMenuItems valign="top">
{$login}
{$lng.txt_logged_in}



{if $js_enabled}
{include file="buttons/logout_menu.tpl"}
{else}
{include file="buttons/logout_menu.tpl"}
{/if}




</td>
</tr>
{if $usertype eq "C"}
<tr>
<td class=VertMenuItems colspan=2>


<div align=right>
{if $js_enabled}
{$lng.txt_javascript_disabled}
{else}
{$lng.txt_javascript_enabled}
{/if}
</div>
</td>
</tr>
{/if}
<input type=hidden name=mode value=logout>
<input type=hidden name=redirect value="{$redirect}">
</form>
</table>
{/if}


Hope this helps.

P.S - Tested and working on 3.5.6

B00MER 04-07-2004 08:57 AM

Just wanted to add those running 3.5.5+ can just use the link customer/secure_login.php if they have a secure HTTPS server, its secure and a seperate login from customer/home.tpl.

Kudos.

domspe 04-10-2004 11:36 AM

Thanks B00mer! 8)
wish i woulda known that earlier :lol:


All times are GMT -8. The time now is 08:15 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.