Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter
Support for Vanilla Forums Cloud product

In this Discussion

Follow Us

Updated StopSOPA Plugin

TimTim Lord of Servers Vanilla Staff
edited January 2012 in Questions
This discussion is related to the Stop SOPA Blackout addon.

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 Senior Developer [GitHub, Twitter,]


  • clethrillclethrill ✭✭
    edited January 2012

    Just underneath

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

    I added this

    // Automatically enables for 18th
    $Date = getdate();
    if($Date['mday'] != 18)
  • 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 Chief Product Officer 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)
  • 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)

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

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