![]() |
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 |
try {$userinfo.firstname} instead of {$login}
:D |
Quote:
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 |
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, |
Quote:
This works! Thanks a lot for the help Jon. :D |
Your welcome :D
|
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? |
Can you explain what you've done and/or provide a URL to your site?
|
I've used {$userinfo.firstname} instead of {$login}
test site URL : http://ad.atrativagames.com.br/loja |
That won't work.
If you follow the instructions I posted above, it should. |
Other mehtod haven't worked also...
Where on the file should I put the code you've described? |
All times are GMT -8. The time now is 01:46 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.