Page 1 of 1

[SOLVED]Getting a User's Properties through the User Defined Tag

Posted: Wed May 13, 2009 10:45 pm
by njmeyer
All,

     I am looking for a way to pull the information from FEU to build a query on the database.  I have had no issues using the tag {$ccuser->property('propertyname')} on a page or in a template.  However I want to be able to get the information using a "User defined tag".  Is there a library or refercene that I can use to assign these values to PHP varabiles and query the databse?

I would like to do something to the effect of:

property('FName');
   $query = "SELECT * FROM TABLE WHERE FNAME = '" . $firstName . "'";
?>

Thanks,
Nick

Re: Getting a User's Properties through the User Defined Tag

Posted: Wed May 13, 2009 11:58 pm
by JeremyBASS
try..


global $gCms;


$feusers = &$gCms->modules['FrontEndUsers']['object'];

so you couuld call like this...
$uid = $feusers->LoggedInID();

cheers
jeremyBass

Re: Getting a User's Properties through the User Defined Tag

Posted: Thu May 14, 2009 1:55 pm
by njmeyer
Awesome!! that is half of the answer I am looking for.  Now how do I get the properties from the $uid?

Thanks,
njmeyer

Re: Getting a User's Properties through the User Defined Tag

Posted: Thu May 14, 2009 2:42 pm
by njmeyer
I figured it out and just used :

$feusers->GetUserPropertyFull('Fname', $uid);