Well I am making a mess of things today. After posting a few stupid questions today I deleted some of them and took a nap. Fully refreshed I managed to get this plugin working almost perfectly. There is one thing still not working though.
If I have an array of multiple checkboxes they are not properly imported into the CB database. It actually says "Array" in the dbase. So I am guessing I must implode these values first.
Anyway, I found this code in the plugin:
And I am guessing I must do it here somewhere. I am php-"capable" but not very good. I suppose we should test each value inside the $fields3-array for also being an array and then implode it, but how to do this?
Bert
If I have an array of multiple checkboxes they are not properly imported into the CB database. It actually says "Array" in the dbase. So I am guessing I must implode these values first.
Anyway, I found this code in the plugin:
/********************CB part*************************/
$database->setQuery( "SELECT * FROM #__comprofiler_fields WHERE `table`='#__comprofiler' AND name <>'NA' AND registration = '1'" );
$fields = $database->loadObjectList();
$fields2 = array('id', 'user_id');
$fields3 = array();
foreach($fields as $field){
$fields2[] = $field->name;
$fieldname = $field->name;
$fields3[] = JRequest::getVar($params->get($fieldname), '', 'post', 'string');//mosGetParam($_POST, $params->get('$fieldname'), '');
}
$database->setQuery( "INSERT INTO #__comprofiler (".implode(",",$fields2).") VALUES ('".$user->get('id')."','".$user->get('id')."','".implode("','",$fields3)."');" );
if (!$database->query()) {
JError::raiseWarning(100, $database->getErrorMsg());
}
And I am guessing I must do it here somewhere. I am php-"capable" but not very good. I suppose we should test each value inside the $fields3-array for also being an array and then implode it, but how to do this?
Bert