]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-content/themes/default/images/header-img.php
WordPress 3.7-scripts
[autoinstalls/wordpress.git] / wp-content / themes / default / images / header-img.php
index c54491a36da77966ce6244675a6b1edac9d76231..50bd3c370cc244d46b428b850e4f0c20890f4342 100644 (file)
@@ -1,77 +1,82 @@
-<?php\r
+<?php
+/**
+ * @package WordPress
+ * @subpackage Default_Theme
+ */
 
 
-$img = 'kubrickheader.jpg';\r
+/** @ignore */
+$img = 'kubrickheader.jpg';
 
 
-// If we don't have image processing support, redirect.\r
-if ( ! function_exists('imagecreatefromjpeg') )\r
-       die(header("Location: kubrickheader.jpg"));\r
+// If we don't have image processing support, redirect.
+if ( ! function_exists('imagecreatefromjpeg') )
+       die(header("Location: kubrickheader.jpg"));
 
 
-// Assign and validate the color values\r
-$default = false;\r
-$vars = array('upper'=>array('r1', 'g1', 'b1'), 'lower'=>array('r2', 'g2', 'b2'));\r
-foreach ( $vars as $var => $subvars ) {\r
-       if ( isset($_GET[$var]) ) {\r
-               foreach ( $subvars as $index => $subvar ) {\r
-                       $length = strlen($_GET[$var]) / 3;\r
-                       $v = substr($_GET[$var], $index * $length, $length);\r
-                       if ( $length == 1 ) $v = '' . $v . $v;\r
-                       $$subvar = hexdec( $v );\r
-                       if ( $$subvar < 0 || $$subvar > 255 )\r
-                               $default = true;\r
-               }\r
-       } else {\r
-               $default = true;\r
-       }\r
-}\r
+// Assign and validate the color values
+$default = false;
+$vars = array('upper'=>array('r1', 'g1', 'b1'), 'lower'=>array('r2', 'g2', 'b2'));
+foreach ( $vars as $var => $subvars ) {
+       if ( isset($_GET[$var]) ) {
+               foreach ( $subvars as $index => $subvar ) {
+                       $length = strlen($_GET[$var]) / 3;
+                       $v = substr($_GET[$var], $index * $length, $length);
+                       if ( $length == 1 ) $v = '' . $v . $v;
+                       $$subvar = hexdec( $v );
+                       if ( $$subvar < 0 || $$subvar > 255 )
+                               $default = true;
+               }
+       } else {
+               $default = true;
+       }
+}
 
 
-if ( $default )\r
-       list ( $r1, $g1, $b1, $r2, $g2, $b2 ) = array ( 105, 174, 231, 65, 128, 182 );\r
+if ( $default )
+       list ( $r1, $g1, $b1, $r2, $g2, $b2 ) = array ( 105, 174, 231, 65, 128, 182 );
 
 
-// Create the image\r
-$im = imagecreatefromjpeg($img);\r
+// Create the image
+$im = imagecreatefromjpeg($img);
 
 
-// Get the background color, define the rectangle height\r
-$white = imagecolorat( $im, 15, 15 );\r
-$h = 182;\r
+// Get the background color, define the rectangle height
+$white = imagecolorat( $im, 15, 15 );
+$h = 182;
 
 
-// Define the boundaries of the rounded edges ( y => array ( x1, x2 ) )\r
-$corners = array(\r
-       0 => array ( 25, 734 ),\r
-       1 => array ( 23, 736 ),\r
-       2 => array ( 22, 737 ),\r
-       3 => array ( 21, 738 ),\r
-       4 => array ( 21, 738 ),\r
-       177 => array ( 21, 738 ),\r
-       178 => array ( 21, 738 ),\r
-       179 => array ( 22, 737 ),\r
-       180 => array ( 23, 736 ),\r
-       181 => array ( 25, 734 ),\r
-       );\r
+// Define the boundaries of the rounded edges ( y => array ( x1, x2 ) )
+$corners = array(
+       0 => array ( 25, 734 ),
+       1 => array ( 23, 736 ),
+       2 => array ( 22, 737 ),
+       3 => array ( 21, 738 ),
+       4 => array ( 21, 738 ),
+       177 => array ( 21, 738 ),
+       178 => array ( 21, 738 ),
+       179 => array ( 22, 737 ),
+       180 => array ( 23, 736 ),
+       181 => array ( 25, 734 ),
+       );
 
 
-// Blank out the blue thing\r
-for ( $i = 0; $i < $h; $i++ ) {\r
-       $x1 = 19;\r
-       $x2 = 740;\r
-       imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white );\r
-}\r
+// Blank out the blue thing
+for ( $i = 0; $i < $h; $i++ ) {
+       $x1 = 19;
+       $x2 = 740;
+       imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white );
+}
 
 
-// Draw a new color thing\r
-for ( $i = 0; $i < $h; $i++ ) {\r
-       $x1 = 20;\r
-       $x2 = 739;\r
-       $r = ( $r2 - $r1 != 0 ) ? $r1 + ( $r2 - $r1 ) * ( $i / $h ) : $r1;\r
-       $g = ( $g2 - $g1 != 0 ) ? $g1 + ( $g2 - $g1 ) * ( $i / $h ) : $g1;\r
-       $b = ( $b2 - $b1 != 0 ) ? $b1 + ( $b2 - $b1 ) * ( $i / $h ) : $b1;\r
-       $color = imagecolorallocate( $im, $r, $g, $b );\r
-       if ( array_key_exists($i, $corners) ) {\r
-               imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white );\r
-               list ( $x1, $x2 ) = $corners[$i];\r
-       }\r
-       imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $color );\r
-}\r
+// Draw a new color thing
+for ( $i = 0; $i < $h; $i++ ) {
+       $x1 = 20;
+       $x2 = 739;
+       $r = ( $r2 - $r1 != 0 ) ? $r1 + ( $r2 - $r1 ) * ( $i / $h ) : $r1;
+       $g = ( $g2 - $g1 != 0 ) ? $g1 + ( $g2 - $g1 ) * ( $i / $h ) : $g1;
+       $b = ( $b2 - $b1 != 0 ) ? $b1 + ( $b2 - $b1 ) * ( $i / $h ) : $b1;
+       $color = imagecolorallocate( $im, $r, $g, $b );
+       if ( array_key_exists($i, $corners) ) {
+               imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white );
+               list ( $x1, $x2 ) = $corners[$i];
+       }
+       imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $color );
+}
 
 
-//die;\r
-header("Content-Type: image/jpeg");\r
-imagejpeg($im, '', 92);\r
-imagedestroy($im);\r
-?>\r
+//die;
+header("Content-Type: image/jpeg");
+imagejpeg($im, '', 92);
+imagedestroy($im);
+?>