Blackoutspeakout, June 4

adixon's picture

Many Canadian non-profit organizations are protesting the latest federal budget, here:

http://www.blackoutspeakout.ca/

If you know of any organizations that use Drupal and would like to participate, you're welcome to use and/or recycle this simple D6 sandbox module (based on a similar module created for the US sopa campaign earlier this year).

http://drupal.org/sandbox/adixon/1611860

or just use this command to grab it:

git clone --recursive --branch master http://git.drupal.org/sandbox/adixon/1611860.git blackoutspeakout

It's pretty plug and play, you just have to enable it and it'll "black out" the site with an appropriate replacement page for the day on June 4.

Comments

Thanks!

daven's picture

I just installed it on two sites.

I wish I could install it

abe's picture

Is there a D7 version available? Thanks.

could be ...

adixon's picture

shouldn't be hard, look at this thread

http://drupal.org/node/1405892

and this example.

https://github.com/basekamp/drupal-sopa-blackout

A D7 Version is Pretty Simple

mgifford's picture

Think you just need to add this to the blackoutspeakout.info core = "7.x" to get it to work.

I also added a cookie so that you could actually get to the site, but you'd be reminded about the campaign every hour:

function blackoutspeakout_init() {
  $on_admin_page = strpos($_SERVER['REQUEST_URI'], 'admin') === 1;
  $on_user_page = strpos($_SERVER['REQUEST_URI'], 'user') === 1;
  if (isset($_COOKIE['blackoutspeakout'])) {
    $first_visit = TRUE;
  }
  else {
    // Set cookie for 1hrs
    setcookie('blackoutspeakout', 1, time()+3600);
  }

  if (isset($_GET['blackoutspeakout_test']) || !($on_admin_page || $on_user_page || $first_visit)) {
    if (isset($_GET['blackoutspeakout_test']) || date('Y-m-d') == '2012-06-04') {
      // Preserve SE ranking. @see http://drupal.org/node/1405892#comment-5481540
      header('HTTP/1.1 503 Service Temporarily Unavailable');
      header('Retry-After: Tue, 05 Jun 2012 04:00:00 GMT');
      $module_path = drupal_get_path('module', 'blackoutspeakout');
      $vars = array('module_path' => '/'.$module_path,
                    'message' => t('The %title website is still <a href="/" style="color:#fff">available</a>. ', array('%title' => variable_get('site_name',''))),
      );
      print theme_render_template($module_path .'/template/index.php',$vars);
      exit();
    }
  }
}

Anyways, thanks for posting this Alan. Splashify seemed like overkill for what was needed (and it didn't seem to work for me) - http://drupal.org/project/splashify

Anyways I've got it running here now http://openconcept.ca

Toronto

Group events

Add to calendar

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week