Was able to make a working proof of concept by making changes directly in jrDiscussion. I then reimplemented this properly using a new module (ntDiscussion) and listeners. Think of the new module as a subclass of jrDiscussion. ( Of course I reset jrDiscussion back to its pristine form. )
One of the listeners in this solution seems ugly (to me). I am running it by you folks to see if the practice is sensible for jamroom. The ugly listener is used to invoke the function that saves the newly uploaded Discussion Image:
function ntDiscussion_get_save_data_listener($_data, $_user, $_conf, $_args, $event)
{
...
jrCore_save_all_media_files('jrDiscussion', 'update', $_user['user_active_profile_id'], $_post['id']);
...
}
My only concern is that I was forced to access $_post as a global variable to get the information I needed to limit the functionality to the create and update forms for discussions.
Is this an appropriate solution?
--
TiG
updated by @tig: 01/23/18 12:05:41PM