Shamim Hasan
Forum Replies Created
-
AuthorPosts
-
Shamim HasanKeymaster
I am really sorry for issue arise. In this major version plugin performance is highly improved. So some of the function could not be backward compatible.
To see full changes of this plugin please see https://github.com/shamim2883/front-end-pm
add_action( 'gfpdf_post_save_pdf_5', function( $pdf_path, $filename, $settings, $entry, $form ) { global $wpdb; $user = wp_get_current_user(); $user_ID = $user->ID; $message = array( 'message_title' => $form['title'], 'message_content' => "Message Goes Here", 'message_to_id' => $user_ID, ); $override = array( 'post_author' => 1, ); //Turn off email send remove_action( 'fep_status_to_publish', array( Fep_Emails::init(), 'send_email'), 99, 2 ); //Post message in Frontend PM $message_id = fep_send_message( $message, $override ); //Prepare Attachment $upload_dir = wp_upload_dir(); $upload_dir = $upload_dir['basedir']; $subdir = ''; if ( get_option( 'uploads_use_yearmonth_folders' ) ) { $time = current_time( 'mysql' ); $y = substr( $time, 0, 4 ); $m = substr( $time, 5, 2 ); $subdir = "/$y/$m"; } $upsub = '/front-end-pm' . $subdir; $copy_to_dir = $upload_dir . $upsub . '/'; if( ! is_dir( $copy_to_dir ) ) { wp_mkdir_p( $copy_to_dir ); } $newfilename = wp_unique_filename( $upload_dir, $filename ); $pathtofile = $copy_to_dir . $newfilename; copy( $pdf_path, $pathtofile ); $attachment[] = array( 'att_file' => $pathtofile, 'att_mime' => 'application/pdf', ); //Add attachment to Frontend PM post FEP_Attachments::init()->insert( $message_id, $attachment ); //Update user information update_user_meta( $user_ID, 'payment', '' ); update_user_meta( $user_ID, 'renew', date("Y-m-d", time())); }, 10, 5 );
I have corrected above code (untested), Please check.
For query messages new class
FEP_Message_Query
added. Please use this class. You can go to class-fep-messages.php and see user_messages method to see how it is used. You can also see FEP_Message_Query class __construct to see what args you can pass.Let me know if any more assistance needed.
Shamim HasanKeymasterPlease change your theme to one of default themes then try.
Let me know.September 13, 2018 at 12:01 am in reply to: Your Front End PM PRO is not active for this URL. Please visit your account page #17414Shamim HasanKeymasterYou can download latest version from https://www.shamimsplugins.com/checkout/purchase-history/
Shamim HasanKeymasteroverriding template works as follows
If in future any template is modified in this plugin and you already overridden that template in your child theme then your template will be used instead of this plugins one. So if any new option or anything added in this template that you will not get until you add that in your template manually.Currently no plan to change in directory.php but you should keep an eye when update this plugin in future. Most of the time any template change is mentioned in changelog. If is better always read changelog before update (for any plugin)
Shamim HasanKeymasterPlease follow https://www.shamimsplugins.com/docs/front-end-pm-pro/troubleshoot/license-keys-not-activating/
If still not working let me know.
Shamim HasanKeymasterYou can add following code in your theme’s (child theme’s if any) functions.php
add_filter( 'fep_directory_output', function( $output ){ $pos = strpos( $output, '<input type="hidden" name="feppage"' ); if ( $pos !== false ) { $output = substr_replace( $output, '<input type="submit" value="Search" />', $pos, 0 ); } return $output; });
it may break in future.
OR you can override
directory.php
template to add that button. Instruction to override template in https://www.shamimsplugins.com/docs/front-end-pm-pro/customization-front-end-pm-pro/change-templates/Shamim HasanKeymasterYou can add a link like
<a href="http://example.com/index.php?your_action=delete&id=1">Delete</a>
. Then in init hook use that function to delete that message. Check permission and nonce first if that user have permission to do so.Shamim HasanKeymasterI have updated your site url.
Please go to Front End PM PRO > Settings > Licenses
Then remove your license key and save changes, again input your license key and again save changes.If still shows error then follow https://www.shamimsplugins.com/docs/front-end-pm-pro/troubleshoot/license-keys-not-activating/
September 7, 2018 at 12:16 am in reply to: How to see old announcements after the role change #17335Shamim HasanKeymasterBy default wordpress allow only one role for user. It makes difficult to debug. As you are using another plugin to set multiple roles to a user.
You can debug line by line to find your issue.
Shamim HasanKeymasterIt require many code change.
If you need this feature badly you can contact through https://www.shamimsplugins.com/hire/Shamim HasanKeymasterSee your role name
'Viitasaari
started with'
. Remove that'
from role name. Then try.Let me know.
Shamim HasanKeymasterThere are add more buttons for Admins and Groups in Front End PM PRO > Settings > Recipient. Does those work?
Are you having any js error in role to role block setting page? Please see browser console and let me know.Shamim HasanKeymasterShamim HasanKeymasterUnchecked Front End PM PRO > Settings > Recipient > Can users send message to admin.
Yours can still send message using https://www.shamimsplugins.com/docs/front-end-pm/shortcode/fep_shortcode_new_message_form/September 5, 2018 at 11:07 pm in reply to: How to see old announcements after the role change #17272Shamim HasanKeymasterUse this code
add_action( 'add_user_role', 'fep_cus_update_ann_when_role_change', 10, 2 ); add_action( 'set_user_role', 'fep_cus_update_ann_when_role_change', 10, 2 ); function fep_cus_update_ann_when_role_change( $user_id, $role ) { global $wpdb; if ( ! defined( 'FEP_PARTICIPANT_TABLE' ) ) { return false; } $mgs_ids = $wpdb->get_col( $wpdb->prepare( "SELECT fep_message_id FROM $wpdb->fep_messagemeta where meta_key = %s AND meta_value = %s", '_fep_participant_roles', $role ) ); if ( $mgs_ids ) { $query = 'INSERT INTO ' . FEP_PARTICIPANT_TABLE . ' (mgs_id, mgs_participant) VALUES '; foreach ( $mgs_ids as $mgs_id ) { $values[] = $mgs_id; $values[] = $user_id; $place_holders[] = '(%d, %d)'; } $query .= implode( ', ', $place_holders ); $wpdb->query( $wpdb->prepare( $query, $values ) ); delete_user_meta( $user_id, '_fep_user_announcement_count' ); } }
-
AuthorPosts