Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

pull request for 503 issue =) #3

Merged
merged 3 commits into from

2 participants

Scott Rigby Mike Cantelon
Scott Rigby

Hi Mike,
This is for the issue i just added:
#2
Cheers!
Scott

Mike Cantelon mcantelon merged commit 99ab5d5 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 18, 2012
  1. Add 503 header to preserve SE ranking

    Scott Rigby authored
  2. Update readme with D6/D7 branch info

    Scott Rigby authored
  3. Update master to 7.x

    Scott Rigby authored
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 9 deletions.
  1. +3 −3 README.txt
  2. +1 −1  sopa.info
  3. +3 −5 sopa.module
6 README.txt
View
@@ -13,9 +13,9 @@ will only be able to access URLs starting with "user" and "admin"
without seeing the SOPA blackout page. After January 18 your site will
be back to normal.
-Developed for/tested with Drupal 6 or Drupal 7. If using it with Drupal 7
-just change "6.x" to "7.x" in the sopa.info file and you should be good
-to go.
+Developed for/tested with Drupal 6 or Drupal 7:
+* D6: checkout 6.x-1.x
+* D7: checkout 7.x-1.x
Inspired by WP-SOPA-Blackout:
2  sopa.info
View
@@ -1,5 +1,5 @@
name = Sopa Blackout
description = Black out your site on Jan 18, 2012 in protest of SOPA.
-core = "6.x"
+core = "7.x"
project = "sopa"
8 sopa.module
View
@@ -8,6 +8,9 @@ $on_user_page = strpos($_SERVER['REQUEST_URI'], 'user') === 1;
if (isset($_GET['sopa_test']) || !($on_admin_page || $on_user_page)) {
if (isset($_GET['sopa_test']) || date('Y-m-d') == '2012-01-18') {
+ // Preserve SE ranking. @see http://drupal.org/node/1405892#comment-5481540
+ header('HTTP/1.1 503 Service Temporarily Unavailable');
+ header('Retry-After: Thu, 19 Jan 2012 00:00:00 GMT');
print file_get_contents(dirname(__FILE__) .'/template/sopa.html');
exit();
}
@@ -17,15 +20,10 @@ if (isset($_GET['sopa_test']) || !($on_admin_page || $on_user_page)) {
* Implementation of hook_help().
*/
function sopa_help($section = '') {
-
$output= '';
switch ($section) {
-
case "admin/modules#description":
- $output = t("Block out your site on January 18, 2012.");
- break;
-
case "admin/help":
$output = t("Block out your site on January 18, 2012.");
break;
Something went wrong with that request. Please try again.