CustomContent $ccuser->property() not working [SOLVED]

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
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm
Location: North West England

CustomContent $ccuser->property() not working [SOLVED]

Post by Russ »

CustomContent 1.5
FrontEndUsers 1.4.2
CMS Made Simple 1.2.4 "Greenland"
Local Install PHP 5, Apache 2 Mac 10.5.2

CustomContent $ccuser->property() does not appear to be working
Pages not cached, anyway it's in templates, so not problem with '->' being changed by WYSIWYG

These work...
{$ccuser->memberof('Group')}
{$customcontent_loginname}

Any using the property values don't seem to work {$ccuser->property('propertyname')}
e.g.
{$ccuser->property('firstname')} or {$ccuser->property('surname')}

I've also tried assigning variables, just in case e.g.
{capture assign='first_name'}{$ccuser->property('firstname')}{/capture}
{$first_name}

Am I doing something wrong or is it a bug report? Anyone with a quick fix?

Russ

SOLUTION:
It would seem that even if you are logged in, you still have to wrap the '{$ccuser->property('firstname')} ' stuff in
{if $ccuser->loggedin()}
{$ccuser->property('firstname')}
{/if}
Just putting {$ccuser->property('firstname')} will not work, at least not for me. Looking at the code it seems you have to use the loggedin function otherwise the '_uid' variable stays at -1 and does not get the real user id. Doesn't seem logical to me but it may be by design so i don't know if it is a bug or not?

Russ
Last edited by Russ on Thu May 01, 2008 1:37 pm, edited 1 time in total.
kendo451

Re: CustomContent $ccuser->property() not working [SOLVED]

Post by kendo451 »

I just tested this in CustomContent 1.5.2 and it works fine, without being preceded by any other calls to CustomContent or FEU.

{$ccuser->property('firstname')}

Could be a bug that was fixed between 1.5.0 and 1.5.2.
Post Reply

Return to “Developers Discussion”