7 years ago
2
Topic

Hello there,

I spent some time to learn it so I will let this thread to someone else that need to manipulate Seblod custom user content anywhere like me. 

To get user content:

$SeblodUser = JCckContent::getInstance(array( 'joomla_user' , $userId));
$someValue = $SeblodUser->get('some_field', 0);<br>

To set and save custom user content:

Padlock closed fields:

$SeblodUser = JCckContent::getInstance(array( 'joomla_user' , $userId));
$itemfield=array(
    'yourfieldname1'=>'yourcontent1',
    'yourfieldname2'=>'yourcontent2',
    );

$data=$sebloduser->save('more',$itemfield);


<br>

Padlock open fields:

$SeblodUser = JCckContent::getInstance(array( 'joomla_user' , $userId));
$itemfield=array(
    'yourfieldname1'=>'yourcontent1',
    'yourfieldname2'=>'yourcontent2',
    );

$data=$sebloduser->save('more2',$itemfield);
<br>

You can learn more about JCckContent class in:  /public_html/libraries/cms/cck/content.php

Regards,

Get a Book for SEBLOD
6 years ago
1
Level 1

Thanks for posting.

Question.  It does not appear that I am getting the user back?  doing the following

$userID = "91";

$sebloduser = JCckContent::getInstance(array('joomla_user', $userID)); 

dump($sebloduser, "sebloduser");

The dump is just giving me back the methods available but no properties

Any suggestions?

4229 Posts
Kadministrator
6 years ago
0
Level 2

There are no public properties, probably this is why you are not seeing them, you need to use $SeblodUser->get as written above

Get a VIP membership