Private message plugin

Hi there,

I have setup this plugin and it working perfectly. A couple of things that I would like to fix though:

- How can I remove the attachment section, I do not want user to attach anything?
- Also, how can I pull the URL of where they sent the message from. This one is really important to sort out.

Thanks,
Omar

    James Morris

    Hello Omar,

    Thank you for your questions.

    To disable attachments is very simple. Private Messaging allows you to restrict attachments to only specific user roles. Administrators always have the capability of attaching files though.

    To disable attachments for all but Administrators, go to Admin -> Messaging -> Settings -> Attachments and deselect the check boxes next to all user roles.

    If you are wanting to disable attachments for ALL users, including Administrators, you're going to need to modify the plugin's files. This also applies to your second question about including the URL of where they sent the message from.

    Please note, if you choose to modify plugin files, your changes will be lost when you update your plugin.

    I've contacted the plugin developer to for more information on what would need to be modified to accomplish what you're wanting. I will reply back here as soon as I have more information.

    Please let me know if you have any further questions. I'll be happy to help!

    Best regards,

    James Morris

    James Morris

    Hello Omar,

    I've looked into this further. Any user roles beyond Contributor will be granted attachment upload access. Subscribers and Contributors can be denied. If your users do not need to be given permissions beyond that of the Contributor role, I suggest dropping their user roles down to that level. This will prevent the need to hack the core files of the plugin in order to remove the attachments feature.

    However, if this is not possible in your situation, there are several files you'll need to modify in order to remove attachments.

    *** Important note: If you modify these files, anytime you update your plugin, your changes will be lost and you will need to re-apply your changes. In general, we advise against making such changes unless it is absolutely unavoidable. ***

    That being said, here's what you'll need to modify in order to remove attachments:

    wp-content/plugins/private-messaging/app/views/backend/message/modal.php

    Line: 51 Change the code to comment out the attachments as so...

    <?php /*if (mmg()->can_upload() == true) {
    	ig_uploader()->show_upload_control($model, 'attachment', false, array(
    		'title' => __("Attach media or other files.", mmg()->domain)
    	));
    } */?>

    wp-content/plugins/private-messaging/app/views/bar/_compose_form.php

    Line: 85 Change the code to comment out the attachments as so...

    <?php /*if ( mmg()->can_upload() == true ) {
    ig_uploader()->show_upload_control( $model, 'attachment', false, array(
    	'title' => __( "Attach media or other files.", mmg()->domain )
    ) );
    } */?>

    wp-content/plugins/private-messaging/app/views/message_me/modal.php

    Line: 56 Change the code to comment out the attachments as so...

    <?php
    /* if (mmg()->can_upload()) {
    	ig_uploader()->show_upload_control($model, 'attachment', false, array(
    		'title' => __("Attach media or other files.", mmg()->domain),
    		'c_id' => 'message_me_modal_container'
    	));
    } */?>

    wp-content/plugins/private-messaging/app/views/shortcode/_compose_form.php

    Line: 70 Change the code to comment out the attachments as so...

    <?php /*if (mmg()->can_upload() == true) {
    	ig_uploader()->show_upload_control($model, 'attachment', false, array(
    		'title' => __("Attach media or other files.", mmg()->domain)
    	));
    } */?>

    wp-content/plugins/private-messaging/app/views/shortcode/_reply_form.php

    Line: 53 Change the code to comment out the attachments as so...

    <?php /*if (mmg()->can_upload() == true) {
    	ig_uploader()->show_upload_control($model, 'attachment', false, array(
    		'title' => __("Attach media or other files.", mmg()->domain),
    		'c_id' => 'mm_reply_compose_container'
    	));
    } */?>

    As far as your second question goes...

    Also, how can I pull the URL of where they sent the message from. This one is really important to sort out.

    I've dug around quite a bit and there's no simple solution for this. This goes beyond support and starts moving into the realm of customization. I suggest you either post your question in the Community Forum under the Web Development & Coding section to see if a member will help you with a custom solution. If this is urgent, you could post a request in the Jobs & Pros board where another member could help you with your customizatoin.

    Please let me know if you have any further questions. I'll be happy to help!

    Best regards,

    James Morris