How can I access the current user data from DW Anything?
Ответ
As of the version 2.0, DW Anyting allows you to access the user data for the user currently logged in.
You can place it within your template, as well as header, footer, and SQL query using special set of tags as follows:
SELECT * FROM `#__sometable` WHERE `id_user` = '{user.id}'
This way, you can access any of the scalar properties of JUser class.
The following table lists the most commonly used properties
Property | Description | Usage |
---|---|---|
id | User ID number | {user.id} |
name | User full name | {user.name} |
username | User login name | {user.username} |
User email address | {user.email} | |
usertype | User type description, e.g. "Super Administrator" or "Registered" | {user.usertype} |
block | The user account block flag. 1 if user account is disabled; 0 if enabled | {user.block} |
sendEmail | Send system email messages flag. 1 if user receives system messages by email; 0 if not | {user.sendEmail} |
gid | User group ID number | {user.gid} |
registerDate | User registration date | {user.registerDate} |
lastvisitDate | User last log in date | {user.lastvisitDate} |
guest | Guest flag. 1 for unregistered user; 0 if user currently logged in | {user.guest} |
Добавить комментарий