Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Updated StopSOPA Plugin

TimTim Vanilla Staff
edited January 2012 in Vanilla 2.0 - 2.8

I've done some tweaks to the plugin to make it more friendly to your site:

  1. Add a Status: 503 'Service Temporarily Unavailable' header
  2. Add a Retry-After: Wed 18 Jan header to make the search bots ignore for a day

I also changed the wording and some of the links slightly.

Vanilla Forums COO [GitHub, Twitter, About.me]

Comments

  • clethrillclethrill ✭✭
    edited January 2012

    Just underneath

    // Admins not affected
    if (Gdn::Session()->IsValid() && Gdn::Session()->CheckPermission('Garden.Settings.Manage'))
    return;
    

    I added this

    // Automatically enables for 18th
    $Date = getdate();
    if($Date['mday'] != 18)
        return;
    
  • Thanks clethrill, this is really useful :D

  • Domos123 said:
    Thanks clethrill, this is really useful :D

    Thanks, to be noted however is that will then make it work all day (I think the strike was planned 0800 - 2000 EST.
    Also if you leave the plugin enabled till next month you will be striking again.

  • XD ok, I can turn it off after... Is there any way to modify it to work between certain times?

  • ToddTodd Vanilla Staff
    edited January 2012

    I think this will expire a bit more properly than @clethrill's excellent solution.

    $Expires = strtotime('2012-01-18 20:00 EST');
    if (time() > $Expires)
        return;
    
  • Domos123Domos123 New
    edited January 2012

    Would that still work if expanded to

      $Starts = strtotime('2012-01-18 08:00 EST');
      $Expires = strtotime('2012-01-18 20:00 EST');
      if (time() > $Expires) or (time() < $Starts)
          return;
    

    EDIT -
    Nope, that didn't work. But this seems to

      $Starttime = strtotime('2012-01-18 08:00 EST');
      if (time() < $Starttime)
          return;
    
Sign In or Register to comment.