Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Display a users first name instead of the login in authbox

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-15-2003, 10:57 AM
 
jaymon jaymon is offline
 

Member
  
Join Date: Sep 2002
Location: St. Louis
Posts: 16
 

Default Display a users first name instead of the login in authbox

After a user logs on to my site, I'd rather the authbox.tpl display their first name instead of the default username or login name. I've noticed it calls /include/login.php and that it pulls the login name from the database with other user data and displays it in authbox.tpl with the variable {$login}. How would I call the users firstname into the template instead of the login name?

TIA,
jaymon
__________________
--
Austin
Reply With Quote
  #2  
Old 05-16-2003, 11:15 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

try {$userinfo.firstname} instead of {$login}

__________________
ex x-cart guru
Reply With Quote
  #3  
Old 05-19-2003, 06:46 AM
 
jaymon jaymon is offline
 

Member
  
Join Date: Sep 2002
Location: St. Louis
Posts: 16
 

Default

Quote:
Originally Posted by funkydunk
try {$userinfo.firstname} instead of {$login}


funkydunk, thanks for the reply.

Hmmm, I tried that with no success. Not sure if it matters, but I'm using X-cart version 3.3.3.

I see the authbox.tpl template is calling /include/login.php and in it there's a call to the database that grabs the user data.

$user_data=func_query_first("select * from $sql_tbl[customers] where login='$username' and usertype='$usertype' and status='Y'");

and below that I assume this is putting the user data from the database into login

$login = $user_data[login]; //$username;

I assume that I need to pull the customers firstname from the database also, because it doesn't look like it's being done above. And then I can build a variable like the login above. I this a correct assumption? Sorry, I'm not a PHP wizard.

TIA,
jaymon
__________________
--
Austin
Reply With Quote
  #4  
Old 05-29-2003, 02:24 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

In my /include/check_useraccount.php

I added the query:

Code:
$name=func_query_first("select firstname,lastname from $sql_tbl[customers] where login='$login'");

In the same file:

Code:
$smarty->assign("name",$name);$smarty->assign("name",$name);

Then in my authbox.tpl

Code:
Welcome back, {$name[0]} {$name[1]}
Reply With Quote
  #5  
Old 05-30-2003, 07:09 AM
 
jaymon jaymon is offline
 

Member
  
Join Date: Sep 2002
Location: St. Louis
Posts: 16
 

Default

Quote:
Originally Posted by Jon
In my /include/check_useraccount.php

I added the query:

Code:
$name=func_query_first("select firstname,lastname from $sql_tbl[customers] where login='$login'");

In the same file:

Code:
$smarty->assign("name",$name);$smarty->assign("name",$name);

Then in my authbox.tpl

Code:
Welcome back, {$name[0]} {$name[1]}

This works! Thanks a lot for the help Jon.
__________________
--
Austin
Reply With Quote
  #6  
Old 05-30-2003, 07:11 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Your welcome
Reply With Quote
  #7  
Old 08-18-2003, 02:25 PM
 
luizgg luizgg is offline
 

Newbie
  
Join Date: May 2003
Posts: 8
 

Default

Hello,

Have applied both soluitons to my authbox.tpl template, but firstname is actually shown on all pages except for home.php.
What should I try?
Reply With Quote
  #8  
Old 08-18-2003, 02:30 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Can you explain what you've done and/or provide a URL to your site?
Reply With Quote
  #9  
Old 08-20-2003, 05:45 AM
 
luizgg luizgg is offline
 

Newbie
  
Join Date: May 2003
Posts: 8
 

Default

I've used {$userinfo.firstname} instead of {$login}

test site URL : http://ad.atrativagames.com.br/loja
Reply With Quote
  #10  
Old 08-20-2003, 09:51 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

That won't work.

If you follow the instructions I posted above, it should.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:21 PM.

   

 
X-Cart forums © 2001-2020