Support » Plugin: Bainternet Posts Creation Limits » Plugin not working when config time span

  • my environment
    -Apache/2.4.18 (Win32) OpenSSL/1.0.2e
    -PHP/7.0.6
    -10.1.13-MariaDB

    i think this code maek a bug
    $time = (isset($arr['time_span']) && $arr['time_span'] != "FOREVER" ) ? " AND TIMEDIFF(NOW(), post_date) < '".$arr['time_span']."'" : "";

    TIMEDIFF is return in format ‘1:00:00’ and you use this to compare with number like ‘1:00:00’ < ‘720’.

    i think you should use this code instead ( add HOUR function before compare)
    $time = (isset($arr['time_span']) && $arr['time_span'] != "FOREVER" ) ? " AND HOUR(TIMEDIFF(NOW(), post_date)) < '".$arr['time_span']."'" : "";

    https://wordpress.org/plugins/bainternet-posts-creation-limits/

Viewing 1 replies (of 1 total)
  • work with this code?

    $time = (isset($arr['time_span']) && $arr['time_span'] != "FOREVER" ) ? " AND HOUR(TIMEDIFF(NOW(), post_date)) < '".$arr['time_span']."'" : "";

Viewing 1 replies (of 1 total)
  • The topic ‘Plugin not working when config time span’ is closed to new replies.