| ||||||||||
| Shopping cart software Solutions for online shops and malls | ||||||||||
|
|
||||||||||
| X-Cart Home |
Display a users first name instead of the login in authbox | ||||
![]() |
|
|||
|
|
Thread Tools | Search this Thread |
|
#1
|
|||||||
|
|||||||
|
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 |
|||||||
|
#2
|
|||||||
|
|||||||
|
try {$userinfo.firstname} instead of {$login}
__________________
ex x-cart guru |
|||||||
|
#3
|
|||||||
|
|||||||
|
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
__________________
-- Austin |
|||||||
|
#4
|
|||||||||
|
|||||||||
|
In my /include/check_useraccount.php
I added the query: Code:
In the same file: Code:
Then in my authbox.tpl Code:
|
|||||||||
|
#5
|
|||||||
|
|||||||
|
Quote:
This works! Thanks a lot for the help Jon.
__________________
-- Austin |
|||||||
|
#6
|
|||||||||
|
|||||||||
|
Your welcome
|
|||||||||
|
#7
|
|||||||
|
|||||||
|
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? |
|||||||
|
#8
|
|||||||||
|
|||||||||
|
Can you explain what you've done and/or provide a URL to your site?
|
|||||||||
|
#9
|
|||||||
|
|||||||
|
I've used {$userinfo.firstname} instead of {$login}
test site URL : http://ad.atrativagames.com.br/loja |
|||||||
|
#10
|
|||||||||
|
|||||||||
|
That won't work.
If you follow the instructions I posted above, it should. |
|||||||||
![]() |
|
| Thread Tools | Search this Thread |
|
|
|
|
|||
|
X-Cart forums © 2001-2020
|
|||