Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

How to initial fill the about_content of a GroupJive group.

  • NicoFaaij
  • NicoFaaij
  • OFFLINE
  • Posts: 114
  • Thanks: 10
  • Karma: 1
11 years 1 month ago #234145 by NicoFaaij
Hi,

I create groups by a GroupJive auto action.

After that I want to fill the About-tab of the group (by another auto action) with a standard text which they can change later, if they want.

So basically I want to add the about_content ="<my standard text>" to the params field in the #__groupjive_groups table.

I tried for example:

<?php
require_once( $_CB_framework->getCfg( 'absolute_path' ) . '/components/com_comprofiler/plugin/user/plug_cbgroupjive/cbgroupjive.class.php' );
$group = cbgjData::getGroups( array( array( 'grp_access', 'mod_lvl2' ), $user ), array( 'id', '=', (int) $grpid ), null, null, false );
$params = $group->getParams();
$content = "My standard text" ;
$params->set( 'about_content', $content );
?>


But I cannot get it worked and maybe it is easier with just an sql query?

Thanks in advance,
Nico

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 1 month ago - 11 years 1 month ago #234159 by krileon
Set just sets it to the params object. You need to save the params after doing this. To save them just run the below after setting them.

Code:
$group->storeParams( $params );

Also when using a Code action with PHP method don't add the PHP opening and closing tags as it's already in PHP.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 11 years 1 month ago by krileon.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum