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)
-   -   You last visited on ... (https://forum.x-cart.com/showthread.php?t=20573)

jdedba 03-17-2006 07:52 AM

You last visited on ...
 
In x-cart, only Admin can know a customer's "last visit" time. Can we let customer see his/her "last visit" time (like phpbb does) ? Is there any variable in x-cart holding the information?

Thanks.

Jeff

zaa 03-18-2006 04:39 AM

Re: You last visited on ...
 
Quote:

Originally Posted by jdedba
In x-cart, only Admin can know a customer's "last visit" time. Can we let customer see his/her "last visit" time (like phpbb does) ? Is there any variable in x-cart holding the information?

Thanks.

Jeff


You may get this information by applying the following mod to your x-cart.
1. add those lines at the bottom of auth.php (just above ?> at the end of the file) in the root of your x-cart

Code:

if (!empty($login)) {
        $last_login_time = func_query_first_cell("SELECT last_login from {$sql_tbl['customers']} WHERE login='$login'");
        $smarty->assign("last_login_time", $last_login_time);
}


2. open required template file which appears in customer area, for example, skin1/authbox.tpl and add into template:

Code:

{if $last_login_time ne ""}You logged in last time at: {$last_login_time|date_format:$config.Appearance.datetime_format}{/if}

Lionel 03-18-2006 01:56 PM

This useful code should be moved to completed mods.

shan 03-20-2006 06:17 AM

moved

Jerrad 04-10-2006 02:10 AM

Thanks for the code, zaa - it works great! :D


All times are GMT -8. The time now is 02:37 PM.

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