• Hello

    I found this code below can it be modified to work with accesspress anonymous post. how can I restrict/limit logged in users to publish only blog post per day. Each logged in user should not be able to post more than one blog post entry per day using the Frontend Post Plugin.

    /**
    * Limit User to One Submission Per Time Period
    * https://gravitywiz.com/2012/04/25/limit-user-to-one-submission-per-time-period/
    */

    // update the “5” to your form ID
    add_action(‘gform_pre_render_5’, ‘gform_limit_submissions’);
    function gform_limit_submissions($form){
    global $wpdb;

    $limit_message = ‘You may only submit this form once every 24 hours.’;
    $limit_time = 86400; // must be specified in seconds; 86400 seconds is equal to 24 hours

    /* You do not need to edit below this line */

    $current_user = wp_get_current_user();
    $last_submission = $wpdb->get_var($wpdb->prepare(“SELECT date_created FROM {$wpdb->prefix}rg_lead WHERE created_by = %d and form_id = %d ORDER BY date_created DESC”, $current_user->ID, $form[‘id’]));

    if(empty($last_submission))
    return $form;

    $time_out = strtotime($last_submission) + $limit_time;
    $current_time = time();

    if($current_time > $time_out)
    return $form;

    $is_submit = rgpost(“is_submit_{$form[‘id’]}”);

    if(!$is_submit) {
    add_filter(‘gform_get_form_filter’, create_function(”, “return ‘<div class=\”limit-message\”>$limit_message</div>’;”) );
    }

    return $form;
    }

    I got this code from https://gravitywiz.com/limit-user-to-one-submission-per-time-period/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi there,

    Thank you for your contributions,

    We will look into these codes and get back to you soon.

    Regards!!

    Thread Starter teeboy4real

    (@teeboy4real)

    Thank you so much for your feedback I will be looking forward to a feasible solution, also please not that I am using the pro version just in case of code difference between the free and pro version.

    Thanks

    Hi there,

    Thank you writing in,

    We are looking through your issues. Our team is work on finding out a feasible solution to fix the issues as soon as possible. Please have patience.we will get back to you soon.

    Please keep yourself updated with our plugin.

    Regards!

    Thread Starter teeboy4real

    (@teeboy4real)

    Hello,

    Please any solution on this issue

    Thanks

    Hi @teeboy4real

    Thank you for writing back.

    We are extremely sorry for the late response. The feature that we were searching for is not available at the moment. But we are planning to add this feature if it becomes feasible with the current setting.

    Please do contact us if you have any questions.

    Regards!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Limit postings per day’ is closed to new replies.