DISPLAY DATA FOR CURRENT USER - Dec 29th, 2010


OK,

Let's say that you want to display some information from the current user's account record in your viewer.

For example: for user Jo Jones...

Welcome Joe Jones,

It's pretty simple to accomplish using $CURRENT_USER

If you have a field called "last_name" and another called "first_name" in your user account section, (If not you might
consider creating them to replace the existing "fullname" field. It's not used by CMS Builder, so you can safely delete
the "fullname" field unless you're using it in a viewer)



Welcome <?php echo $CURRENT_USER['first_name']; ?>&nbsp;<?php echo $CURRENT_USER['first_name']; ?>,



Will display the user's first name, followed by a space and then their last name followed by a coma.

According to Jason Sauchuk from Interactive Tools:

You can display any field other then an Upload field using $CURRENT USER

To display an upload field you'll first need to use the getRecords function to select the record for that user.

You can get the userNumber like this:

$CURRENT_USER['num']



The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact Interactive Tools for information on the downloading of the software or the purchasing of licenses.


Terms of Service