function view_jrDiscussion_create_topic_save($_post, &$_user, &$_conf)
{
...
// $id will be the INSERT_ID (_item_id) of the created item
$id = jrCore_db_create_item('jrDiscussion', $_rt, $_core);
if (!$id) {
jrCore_set_form_notice('error', 'An error was encountered creating this discussion - please try again.');
jrCore_form_result();
}
...
... would be brilliant if it included this after the db_create_item:
jrCore_save_all_media_files('jrDiscussion', 'create', $_rt['discussion_profile_id'], $id);
... similar to jrBlog:
// $bid will be the INSERT_ID (_item_id) of the created item
$bid = jrCore_db_create_item('jrBlog', $_rt);
if (!$bid) {
jrCore_set_form_notice('error', 12);
jrCore_form_result();
}
// Save any uploaded media files added in by our
jrCore_save_all_media_files('jrBlog', 'create', $_user['user_active_profile_id'], $bid);
As you might surmise, I have included support for images in discussions. Updates are no problem since the id is provided, but for creates I cannot seem to find a way to get the new id for a created discussion at the right time to issue the jrCore_save_all_media_files.
The obvious choice (at least given the logic of the function) of tagging off of the jrAction listener fails because of embedded logic that ignores admins making changes.
Any ideas?
--
TiG
updated by @tig: 04/04/18 04:39:47AM