Shamim Hasan
Forum Replies Created
-
AuthorPosts
-
September 5, 2017 at 4:27 pm in reply to: [Suggestion] Always display the other person instead of the user itself. #6273Shamim HasanKeymaster
I understand you. But this plugin support multiple recipients. Suppose you have started a conversation where recipients are 5 persons. So you are sender but receivers are 5 persons. So which users avatar will show?
September 5, 2017 at 12:23 pm in reply to: [Suggestion] Always display the other person instead of the user itself. #6266Shamim HasanKeymasterThank you.
Suppose you have 5 recipients. So which users avatar will show? currently user who sent last message, his/her avatar is shown.September 5, 2017 at 12:16 pm in reply to: Redirection of ads mails to private internal messaging #6263Shamim HasanKeymasterI can not access your Back end or message system. Please log in with this user and access message system or back end. You will see error.
Also if possible change language to english for testing.
September 4, 2017 at 8:01 pm in reply to: Redirection of ads mails to private internal messaging #6236Shamim HasanKeymasterIt happens to all users or only for ARALprem?
Can you please create a test account and give me credentials along with message page url?Shamim HasanKeymasterPlease 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.
-
AuthorPosts