Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Forum: Plugins
    In reply to: Protect Old Posts
    Thread Starter snee7

    (@snee7)

    Or you could just take the plugin and reverse it. Take the area where they insert your new password (‘CHANGEME’) and leave it blank, and then take the blank area where it changes all non-protected posts and put in the password you used.

    That will change all posts with that password into no password. Then upload and reactivate the plugin. For instance:

    $default_password = ”;

    function mm_something_changed($something) { // This is extremely crude
    global $wpdb, $tableposts, $default_password;
    $count = $wpdb->get_var(“SELECT COUNT(*) FROM $tableposts WHERE post_status = ‘publish'”);
    $one = $count – 1;
    $wpdb->query(“UPDATE $tableposts SET post_password = ‘$default_password’ WHERE post_status = ‘publish’ AND post_password = ‘*************THE PASSWORD YOU USED********’ ORDER BY post_date_gmt ASC LIMIT $one”);
    return $something;

    Forum: Plugins
    In reply to: Protect Old Posts
    Thread Starter snee7

    (@snee7)

    Yup, I’m bringing up an old unresolved issue. I have still been unable to modify the plugin to protect all posts beyond a certain date or number. Any advice?

    $default_password = 'changeme';

    function mm_something_changed($something) { // This is extremely crude
    global $wpdb, $tableposts, $default_password;
    $count = $wpdb->get_var("SELECT COUNT(*) FROM $tableposts WHERE post_status = 'publish'");
    $one = $count - 1;
    $wpdb->query("UPDATE $tableposts SET post_password = '$default_password' WHERE post_status = 'publish' AND post_password = '' ORDER BY post_date_gmt ASC LIMIT $one");
    return $something;
    }

    I tried by editing the ASC limit among a million other things, but it’s been quite a few months since I’ve tried messing with it and I’d still like to do it. Any suggestions?

    Forum: Plugins
    In reply to: Protect Old Posts
    Thread Starter snee7

    (@snee7)

    It password protects old posts with a default password set in the plugin. I’d still like to be able to give people this password who I know personally, so it would be the ideal setup.

Viewing 3 replies - 1 through 3 (of 3 total)