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

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
njmeyer
Forum Members
Forum Members
Posts: 16
Joined: Thu Jun 19, 2008 7:04 pm

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

Post 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
Last edited by njmeyer on Thu May 14, 2009 2:43 pm, edited 1 time in total.
JeremyBASS

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

Post by JeremyBASS »

try..


global $gCms;


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

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

cheers
jeremyBass
njmeyer
Forum Members
Forum Members
Posts: 16
Joined: Thu Jun 19, 2008 7:04 pm

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

Post 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
njmeyer
Forum Members
Forum Members
Posts: 16
Joined: Thu Jun 19, 2008 7:04 pm

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

Post by njmeyer »

I figured it out and just used :

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

Return to “Developers Discussion”