Forums: How to display user pic next to "Logged on as" message - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to display user pic next to "Logged on as" message

#1 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 16044
  • Joined: 03-February 03

Posted 13 November 2013 - 05:00 PM

Lets consider the situation when your login tables stores path to user picture. Sample database structure:

ID Username Password Pic
--------------------------
1  admin    xxxx     http://yourwebsite.com/images/image1.jpg 
2  user     xxxx     http://yourwebsite.com/images/image2.jpg
...


Here is how you can display this picture as a part of 'Logged on as' message.

1. In AfterSuccessfulLogin event save path to image file in session variable:
SESSION("pic")=data("Pic")

2. Then in BeforeDisplay event of the page where you need to display this picture use the following:
xt.assign "username","<img height=24x width=24px src='" & SESSION("pic") & "'> " & SESSION("UserName")


Modify width and height of the page accordingly. You will have to add this code to each BeforeDisplay event of those pages where you want to display this picture.
Best regards,
Sergey Kornilov
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic