Shamim Hasan
Forum Replies Created
-
AuthorPosts
-
Shamim HasanKeymaster
Please check following
1. Allow attachment in Front End PM PRO Settings
2. File mime type is present and it is in allowed type
3. File size is less then from Front End PM PRO SettingsYou can also remove some check from this function and try to find out which check failed. eg remove
if( !$mime || !in_array( $mime, get_allowed_mime_types() ) ) return false;
then try. Also remove other check and try.
September 3, 2017 at 9:59 am in reply to: Front End PM Pro causing date conflict With "Toolset" plugin #6206Shamim HasanKeymasteris “Toolset” is in wp repository? Please give me the link.
‘the_time’ is wp core filter and it has 2 arguments. So if any plugin use that they should provide 2 arguments but That plugin did not provide that. That plugin should correct that.I will also correct my code for this type of issue for those plugin which this hook use wrongly.
You can temporarily correct code to use for now. go to front-end-pm-pro/functions.php and change
fep_format_date( $date, $d )
tofep_format_date( $date, $d = '' )
Shamim HasanKeymasterI am not sure if i will add in future because it is not most of the users use and it need a pretty big library. Also it use unnecessary resources for our purposes.
But time will tell if anytime need this to include.
Shamim HasanKeymasterI have added that string in free version also. Please check online translation. in couple of hours it will show there and you can translate.
When you use POT of PRO version your already translated string for free version will be there as translated. So you will not have to translate all. You will need to translate only string which is not available in free version.
Let me know for any assistance.
Shamim HasanKeymasterPlease use following (Untested).
let me knowfunction action_putmessage( $args ) { global $out, $admin_user_login; if( ! function_exists( 'fep_send_message' ) ) return false; $sender = fep_get_userdata( $admin_user_login, 'ID', 'login' ); if (!$sender) { $out['errmsg'] = "No such sender '$admin_user_login'"; return false; } $recipient = fep_get_userdata( $args['user'], 'ID', 'login' ); if (!$recipient) { $out['errmsg'] = "No such recipient '{$args['user']}'"; return false; } $message = array( 'message_title' => $args['title'], 'message_content' => $args['message'], 'message_to_id' => $recipient, 'open_emr_args' => $args, //pass to get in attachment function ); $override = array( 'post_author' => $sender, ); $message_id = fep_send_message( $message, $override ); } add_action ('fep_action_message_after_send', 'fep_open_emr_upload_attachments', 10, 3 ); function fep_open_emr_upload_attachments( $message_id, $message, $inserted_message ){ if ( ! fep_get_option( 'allow_attachment', 1 ) || ! $message_id || empty( $message['open_emr_args']) ) return false; $args = $message['open_emr_args']; $name = isset( $args['filename'] ) ? $args['filename'] : ''; if( ! $name ) return false; $size_limit = (int) wp_convert_hr_to_bytes(fep_get_option('attachment_size','4MB')); $fields = (int) fep_get_option('attachment_no', 4); if( class_exists( 'Fep_Attachment' ) ){ add_filter('upload_dir', array(Fep_Attachment::init(), 'upload_dir')); } $mime = isset( $args['mimetype'] ) ? $args['mimetype'] : ''; $content = isset( $args['contents'] ) ? base64_decode($args['contents']) : ''; if( !$mime || !in_array( $mime, get_allowed_mime_types() ) ) return false; $size = strlen( $content ); if( $size > $size_limit ) return false; $att = wp_upload_bits( $name, null, $content ); if( ! isset( $att['file'] ) || ! isset( $att['url'] ) || ! isset( $att['type'] ) ) return false; $attachment = array( 'guid' => $att['url'], 'post_mime_type' => $att['type'], 'post_title' => preg_replace( '/\.[^.]+$/', '', basename( $att['url'] ) ), 'post_content' => '', 'post_author' => $inserted_message->post_author, 'post_status' => 'inherit' ); // Insert the attachment. wp_insert_attachment( $attachment, $att['file'], $message_id ); if( class_exists( 'Fep_Attachment' ) ){ remove_filter('upload_dir', array(Fep_Attachment::init(), 'upload_dir')); } }
Shamim HasanKeymasterWhat is your android version?
Android has an known issue about it https://issuetracker.google.com/issues/36983532
Hope they will solve this as soon as possible.Shamim HasanKeymasterPlease let me know following so that i can write some code for you.
1. Sender is always $admin_user_login?
2. what is $args[‘user’] ? ( user id or login ? )
3. maximum 1 attachment allowed?
4. Should i have to check mime type, size etc or it is already validated?Shamim HasanKeymasterYou can see Fep_Attachment class. upload attachment is hooked to fep_action_message_after_send action. But if $_FILES[‘fep_upload’] not exists then no attachment will be uploaded. In that case you can see FEP_Email_Pipe class and see how it is done there.
September 1, 2017 at 10:30 am in reply to: Redirection of ads mails to private internal messaging #6139Shamim HasanKeymasterYou can use https://www.shamimsplugins.com/docs/front-end-pm/shortcode/fep_shortcode_new_message_form/
This will show a form. when user send message it will use Front End PM PRO message system.Shamim HasanKeymasterYou can use
fep_send_message()
function for this. It will take care of everything. If you do not want to send emails for those imports you can usefep_enable_email_send
filter hook to restrict email send.Shamim HasanKeymasterPRO version and free version use same text domain. So which string present in both version only those string translated. others you have to translate by using pot file supplied with PRO version.
Shamim HasanKeymasterFrom Google Email you can Forward email to your email address which can forward to a script. Then From there you can forward email to script for email piping.
Currently this plugin only can process email pipe to its script (Not POP3 or IMAP)
Shamim HasanKeymasterWe can not use online translation for our PRO plugin, That is for only free version. For PRO plugin there is a pot file in languages folder of PRO plugin. Please use that to translate additional string in PRO plugin.
Shamim HasanKeymasterNo.
You can change files inside “templates” in your theme.For files inside includes there are lots of hooks to change its behavior. You can use those hooks.
Regards
ShamimShamim HasanKeymasterThank you for your nice suggestion.I am working on documentation and hope will be able to improve it.
Regards
Shamim -
AuthorPosts