Page 1 of 1

[SOLVED]pass logged in uid to FEU for user profile

Posted: Tue Feb 07, 2012 8:38 am
by cleatus
what is the current best way to display current logged in user's feu properties without manually designating uid? both FEU and CGuserdirectory appear to need the uid. what is the best way to pass current logged in user's uid to {FrontEndUsers action="viewuser" uid=""} or {CGUserDirectory action="detail" uid=""} ?

cmsms 1.10.3
feu 1.17
custom content 1.7.3

Re: pass logged in uid to FEU, CGuserdirectory for user prof

Posted: Sat Feb 18, 2012 2:43 am
by cleatus
well i've got current logged in user's username and group memberships showing on front end using the following from custom content module:

Code: Select all

{if $ccuser->loggedin()}
<p>Username:<strong>{$customcontent_loginname}</strong></p><p>My Current Groups and Memberships:<strong>{$customcontent_groups}</strong></p>
<p>{$ccuser->property('alt_email')}</p>
{else}
<p>You are not logged in.</p>{/if}
now, does anyone know how to display all other front end user properties?

specifically, how to use

Code: Select all

$ccuser->property('propertyname')
from custom content help page?

right now i used

Code: Select all

{$ccuser->property(alt_email)}
(left missing quotes referenced by dr.css in post below for reference purposes)
or

Code: Select all

{$ccuser->property('ph')}
just in case it didn't like the underscore

but i get error:
Warning: Invalid argument supplied for foreach() in /home/www/site.org/modules/FrontEndUsers/lib/class.FrontEndUsersManipulator.php on line 1620

thanks in advance.

Re: pass logged in uid to FEU, CGuserdirectory for user prof

Posted: Sat Feb 18, 2012 4:39 am
by Dr.CSS
Notice the missing ' ' in your call?...

Re: pass logged in uid to FEU, CGuserdirectory for user prof

Posted: Sat Feb 18, 2012 11:35 pm
by cleatus
thanks for the response. yes, i wasn't sure if that was part of the call or used to denote "example".
with or without quotes i get the same error. the property name is correct and a property of logged in user. i'm assuming i'm just using it wrong, but not sure how. am i correct that this can be used to get and display specified FEU properties for current logged in ccuser?

note: i edited above code to more accurately reflect my current effort. i noticed i had also left an old line in previous post as well.

Re: pass logged in uid to FEU, CGuserdirectory for user prof

Posted: Sun Feb 19, 2012 6:47 pm
by Dr.CSS
Have you tried the {get_template_vars} tag, it should output all variables...

Re: pass logged in uid to FEU, CGuserdirectory for user prof

Posted: Tue Feb 21, 2012 5:01 pm
by cleatus
thanks again, doc.
i had tried {get_template_vars} previously but had trouble dumping third level variables. anyways you forced me to look at it again. It ended up being a permissions issue. for some reason FEU permissions were different from everything else on server. Sorry for wasting your time on that.

So {$ccuser->property('propertyname')} works after all. Also, when i went to submit feature request for FEU for the ability to use loggedin() instead of uid for "viewuser" param i noticed it had already been requested and evidently will be in next version of FEU!
http://dev.cmsmadesimple.org/feature_request/view/7260
So i'll use a combination of FEU changesettings form and custom content for profile page until FEU's viewuser params are updated.