-
+ 0888083BF7F6D0D91334455B26D392C120B352A0D11AB7016D84F190008C6AAE056DE1E55E947C990814A778559300F154FD9FA8B1366B418769F9764505286B
mp-wp/wp-content/themes/default/images/header-img.php
(0 . 0)(1 . 82)
67262 <?php
67263 /**
67264 * @package WordPress
67265 * @subpackage Default_Theme
67266 */
67267
67268 /** @ignore */
67269 $img = 'kubrickheader.jpg.svg';
67270
67271 // If we don't have image processing support, redirect.
67272 if ( ! function_exists('imagecreatefromjpeg') )
67273 die(header("Location: kubrickheader.jpg.svg"));
67274
67275 // Assign and validate the color values
67276 $default = false;
67277 $vars = array('upper'=>array('r1', 'g1', 'b1'), 'lower'=>array('r2', 'g2', 'b2'));
67278 foreach ( $vars as $var => $subvars ) {
67279 if ( isset($_GET[$var]) ) {
67280 foreach ( $subvars as $index => $subvar ) {
67281 $length = strlen($_GET[$var]) / 3;
67282 $v = substr($_GET[$var], $index * $length, $length);
67283 if ( $length == 1 ) $v = '' . $v . $v;
67284 $$subvar = hexdec( $v );
67285 if ( $$subvar < 0 || $$subvar > 255 )
67286 $default = true;
67287 }
67288 } else {
67289 $default = true;
67290 }
67291 }
67292
67293 if ( $default )
67294 list ( $r1, $g1, $b1, $r2, $g2, $b2 ) = array ( 105, 174, 231, 65, 128, 182 );
67295
67296 // Create the image
67297 $im = imagecreatefromjpeg($img);
67298
67299 // Get the background color, define the rectangle height
67300 $white = imagecolorat( $im, 15, 15 );
67301 $h = 182;
67302
67303 // Define the boundaries of the rounded edges ( y => array ( x1, x2 ) )
67304 $corners = array(
67305 0 => array ( 25, 734 ),
67306 1 => array ( 23, 736 ),
67307 2 => array ( 22, 737 ),
67308 3 => array ( 21, 738 ),
67309 4 => array ( 21, 738 ),
67310 177 => array ( 21, 738 ),
67311 178 => array ( 21, 738 ),
67312 179 => array ( 22, 737 ),
67313 180 => array ( 23, 736 ),
67314 181 => array ( 25, 734 ),
67315 );
67316
67317 // Blank out the blue thing
67318 for ( $i = 0; $i < $h; $i++ ) {
67319 $x1 = 19;
67320 $x2 = 740;
67321 imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white );
67322 }
67323
67324 // Draw a new color thing
67325 for ( $i = 0; $i < $h; $i++ ) {
67326 $x1 = 20;
67327 $x2 = 739;
67328 $r = ( $r2 - $r1 != 0 ) ? $r1 + ( $r2 - $r1 ) * ( $i / $h ) : $r1;
67329 $g = ( $g2 - $g1 != 0 ) ? $g1 + ( $g2 - $g1 ) * ( $i / $h ) : $g1;
67330 $b = ( $b2 - $b1 != 0 ) ? $b1 + ( $b2 - $b1 ) * ( $i / $h ) : $b1;
67331 $color = imagecolorallocate( $im, $r, $g, $b );
67332 if ( array_key_exists($i, $corners) ) {
67333 imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white );
67334 list ( $x1, $x2 ) = $corners[$i];
67335 }
67336 imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $color );
67337 }
67338
67339 //die;
67340 header("Content-Type: image/jpeg");
67341 imagejpeg($im, '', 92);
67342 imagedestroy($im);
67343 ?>