Revision: 4887
http://linpha.svn.sourceforge.net/linpha/?rev=4887&view=rev
Author: fangehrn
Date: 2008-02-20 11:02:48 -0800 (Wed, 20 Feb 2008)
Log Message:
-----------
Added Paths:
-----------
trunk/linpha2/templates/misc/box.php
Copied: trunk/linpha2/templates/misc/box.php (from rev 4886, trunk/misc/design/14cornersSchill/box.php)
===================================================================
--- trunk/linpha2/templates/misc/box.php (rev 0)
+++ trunk/linpha2/templates/misc/box.php 2008-02-20 19:02:48 UTC (rev 4887)
@@ -0,0 +1,60 @@
+<?php
+if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','../../../linpha2'); }
+
+include_once( LINPHA_DIR.'/lib/classes/linpha.color.class.php' );
+
+$col = (isset($_GET['col']) ? $_GET['col'] : '87CEFA');
+$rad = (isset($_GET['r']) ? intval($_GET['r']) : 15);
+$width = (isset($_GET['w']) ? intval($_GET['w']) : 2000);
+$height = (isset($_GET['h']) ? intval($_GET['h']) : 1000);
+
+
+// create image
+$image = imagecreate($width, $height);
+$img_corners = imagecreate(2*$rad+1, 2*$rad+1);
+
+// create transparent background
+$colourBlack = imagecolorallocate($img_corners, 255, 255, 255);
+imagecolortransparent($img_corners, $colourBlack);
+
+$colourBlack2 = imagecolorallocate($image, 255, 255, 255);
+imagecolortransparent($image, $colourBlack2);
+
+
+// create colors
+$rgb = LinColor::getRgbFromAll($col);
+$color = imagecolorallocate($img_corners, $rgb['r'], $rgb['g'], $rgb['b']); // must be after imagecolortransparent()
+$color2 = imagecolorallocate($image, $rgb['r'], $rgb['g'], $rgb['b']); // must be after imagecolortransparent()
+
+// fill image
+imagefilledrectangle ($image, 0, $rad, $width-1, $height-$rad-1, $color );
+imagefilledrectangle ($image, $rad, 0, $width-$rad-1, $rad-1, $color );
+imagefilledrectangle ($image, $rad, $height-$rad, $width-$rad-1, $height, $color );
+
+// draw and copy circle
+imagefilledellipse($img_corners, $rad, $rad, ($rad*2)+1, ($rad*2)+1, $color);
+imagecopy($image, $img_corners, 0, 0, 0, 0, $rad, $rad);
+imagecopy($image, $img_corners, $width-$rad, 0, $rad+1, 0, $rad, $rad);
+imagecopy($image, $img_corners, 0, $height-$rad, 0, $rad+1, $rad, $rad);
+imagecopy($image, $img_corners, $width-$rad, $height-$rad, $rad+1, $rad+1, $rad, $rad);
+
+
+// flush image
+header('Content-type: image/gif');
+
+/**
+ * force caching in browser
+ * works in firefox and internet explorer
+ */
+header("Last-Modified: " . gmdate("D, d M Y H:i:s",gmmktime (0,0,0,1,1,2000))); // Date in the past
+header("Expires: Mon, 26 Jul 2100 05:00:00 GMT"); // In other words... never expire the image
+header("Cache-Control: max-age=10000000, s-maxage=1000000, proxy-revalidate, must-revalidate");
+
+
+imagegif($image);
+
+imagedestroy($image);
+imagedestroy($img_corners);
+
+
+?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|