Permalink
Browse files

First commit eh.

  • Loading branch information...
0 parents commit fb8e3270afca97ec4c86276b37983852d6b4498a @mcantelon committed Jan 15, 2012
Showing with 135 additions and 0 deletions.
  1. +3 −0 README.txt
  2. +11 −0 sopa.info
  3. +59 −0 sopa.module
  4. +19 −0 template/page.tpl.php
  5. +43 −0 template/style.css
@@ -0,0 +1,3 @@
+Block out your Drupal site on January 18, 2012.
+
+This module does just that, via a quick hack.
@@ -0,0 +1,11 @@
+name = Sopa Blackout
+description = Black out your site on Jan 18, 2012 in protest of SOPA.
+
+project = "drupal"
+
+core = 6.x
+
+; Information added by drupal.org packaging script on 2011-06-10
+version = "6.x-dev"
+core = "6.x"
+project = "sopa"
@@ -0,0 +1,59 @@
+<?php
+
+/**
+ * Onerous hackin' time!
+ */
+$on_admin_page = strpos($_REQUEST['q'], 'admin') === 0;
+$on_user_page = strpos($_REQUEST['q'], 'user') === 0;
+
+if ($_GET['sopa_test'] || !($on_admin_page || $on_user_page)) {
+ if ($_GET['sopa_test'] || date('Y-m-d') == '2012-01-18') {
+ $path_to_static = '/'. drupal_get_path('module', 'sopa') .'/template';
+ print sopa_return_template_html('sopa', 'page.tpl.php', array(
+ 'path_to_static' => $path_to_static
+ ));
+ exit();
+ }
+}
+
+/**
+ * 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;
+ }
+
+ return $output;
+}
+
+function sopa_return_template_html($module, $template, $variables = array()) {
+ // Create local copies of variables passed to template
+ if (is_array($variables)) {
+ reset($variables);
+ while (list($key, $value) = each($variables)) {
+ $$key = $value;
+ }
+ }
+
+ // Use output buffering to capture included template output
+ ob_start();
+ if ($module) {
+ include(drupal_get_path('module', $module) .'/template/'. $template);
+ }
+
+ $output = ob_get_contents();
+ ob_end_clean();
+
+ return $output;
+}
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Stop United States Censorship</title>
+
+ <link rel="stylesheet" type="text/css" href="<? print $path_to_static; ?>/style.css" />
+</head>
+<body class="sopa-blackout" id="sopa-page">
+ <div class='container'>
+ <h1>Stop United States Censorship</h1>
+ <p>The US Congress is about to pass internet censorship, even though the vast majority of Americans are opposed. We need to kill the bill - PIPA in the Senate and SOPA in the House - to protect our rights to free speech, privacy, and prosperity.</p>
+ <p><a href="http://americancensorship.org/">Learn more</a>.</p>
+
+ <iframe src="http://player.vimeo.com/video/31100268?byline=0&amp;portrait=0" width="700" height="394" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
+ <p>&nbsp;</p>
+ <iframe src="http://americancensorship.org/callwidget" width="588" height="625" border="0"></iframe>
+ </div>
+</body>
+</html>
@@ -0,0 +1,43 @@
+/*
+ * Blatantly ripped off from the WordPress admin area error pages
+ */
+html {
+ background: #f9f9f9;
+}
+body {
+ background: #fff;
+ color: #333;
+ font-family: sans-serif;
+ margin: 2em auto;
+ padding: 1em 2em;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ border: 1px solid #dfdfdf;
+ max-width: 700px;
+}
+#sopa-page {
+ margin-top: 50px;
+}
+#sopa-page p {
+ font-size: 14px;
+ line-height: 1.5;
+ margin: 25px 0 20px;
+}
+#sopa-page code {
+ font-family: Consolas, Monaco, monospace;
+}
+ul li {
+ margin-bottom: 10px;
+ font-size: 14px ;
+}
+a {
+ color: #21759B;
+ text-decoration: none;
+}
+a:hover {
+ color: #D54E21;
+}
+iframe {
+ display:block;
+ margin:0 auto;
+}

0 comments on commit fb8e327

Please sign in to comment.