I am getting Error: Object of class OssnUser could not be converted to string in /var/www/vhosts/localapp.live/prod.localapp.live/components/RecordMaint/ossn_com.php:181
$user = ossn_loggedin_user();
$database = new OssnDatabase();
$params = array();
$params["from"] = "ossn_object";
$params["params"] = array("guid","title");
$params["wheres"] = array("guid = ".$params_in["group_guid"]);
$data = $database->select($params);
$abc = "";
$chars = "23456791xTHCMYGREtheuckmyrbrwnfxjumpsivertheazymyrd-RWNFXMT12345679PZSVXEWRTHAZYMYGRD2345679";
for( $i = 0; $i < 12; $i++ )
{ $abc .= $chars[ mt_rand(0, 31 ) ]; }
$params["into"] = "mgr_calendars";
$params["names"] = array(
"cal_id",
"cal_owner",
"cal_group_id",
"cal_name",
"cal_link"
);
$params["values"] = array(
0,
$user->guid,
$data->guid,
$data->title,
"$abc"
);
$calid = $database->getLastEntry();
$query = "INSERT INTO mgr_calusers (cu_id, cu_cal_id, cu_user_id, cu_group_id, cu_admin, cu_active) VALUES (0, $calid, $user, ".$data->guid.", 1, 1)";
$database->statement($query);
$database->execute();
You are welcome, just for reference sharing the callback https://www.opensource-socialnetwork.org/documentation/view/5605/group-deleted
Great! Got it now, thanks again!
When you delete a group you get a instance of it already in $params["entity"] callback.
Thank you, Arsalan. That worked,
I am testing my callbacks and find I do not understand how to reference the OssnGroup instance to get the group id when I delete a group. Please advise.
Well here you have two problems
$database->getLastEntry(); will show after insert operationcu_user_id you need to pass user ID not user object.Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.
$199 (Life Time)