summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2008-10-28 17:40:14 +0100
committerHugues Hiegel <hugues@hiegel.fr>2008-10-28 17:40:14 +0100
commit1a697961b741b9a3cdd1bc535e9b9c3436e445da (patch)
treef8763eaa62e3a2270c5dd171ef274a3a5b9c0754
parent12455c6f5e4775821d80d3c86dcdc6c1d825d718 (diff)
Disclaimer. Committing suicide.
l---------Badges.php2
-rw-r--r--DISCLAIMER.php98
2 files changed, 99 insertions, 1 deletions
diff --git a/Badges.php b/Badges.php
index acb2261..c7187c3 120000
--- a/Badges.php
+++ b/Badges.php
@@ -1 +1 @@
-Badges_v2.php \ No newline at end of file
+DISCLAIMER.php \ No newline at end of file
diff --git a/DISCLAIMER.php b/DISCLAIMER.php
new file mode 100644
index 0000000..91dd517
--- /dev/null
+++ b/DISCLAIMER.php
@@ -0,0 +1,98 @@
+<?
+
+clearstatcache();
+
+include "Config.php";
+$Cache=CACHE_FOLDER."/Pictures/Maintenance.png";
+
+if ( is_file($Cache)
+ )
+{
+ $fd=fopen($Cache, "r");
+ echo fread($fd, filesize($Cache));
+ fclose($fd);
+ exit;
+}
+
+class Text {
+ var $width = 0;
+ var $height = 0;
+ var $x = 0;
+ var $y = 0;
+
+ var $font = "";
+ var $size = 150; // High values to better quality
+ var $angle = 2;
+ var $color = 0;
+ var $value = "";
+
+ function initiate($size) {
+ $this->x = 0;
+ $this->width = abs(
+ max($size[0], $size[2], $size[4], $size[6])
+ - min($size[0], $size[2], $size[4], $size[6])
+ );
+ $this->height= abs(
+ max($size[1], $size[3], $size[5], $size[7])
+ - min($size[1], $size[3], $size[5], $size[7])
+ );
+
+ $ratio = WIDTH / $this->width;
+
+ $this->width = WIDTH;
+ $this->height *= $ratio;
+ $this->size = floor($this->size * $ratio);
+ }
+}
+$Lines = array();
+$Lines[] = new Text;
+
+$Lines[0]->value = "Sorry";
+$Lines[0]->angle = 2;
+$Lines[] = new Text;
+$Lines[1]->value = "due to too heavy load";
+$Lines[] = new Text;
+$Lines[2]->value = "badges will be suspended";
+$Lines[] = new Text;
+$Lines[3]->value = "for some time...";
+
+foreach ($Lines as $Line)
+ $Line->font = "import/Georgia";
+
+$y=0;
+foreach ($Lines as $Line)
+{
+ $size=imageftbbox($Line->size, $Line->angle, $Line->font, $Line->value);
+ $Line->initiate($size);
+ $y+=$Line->height;
+ $Line->y=$y;
+}
+
+$Image = new Text;
+$Image->width = WIDTH;
+$Image->height = $y;
+
+$img=imagecreatetruecolor($Image->width, $Image->height);
+imagealphablending($img, FALSE);
+imagesavealpha($img, TRUE);
+
+foreach ($Lines as $Line)
+{
+ $Line->color=imagecolorallocate($img, 0,
+ 0,
+ 0);
+}
+
+$transparent=imagecolorallocatealpha($img, 255, 255, 255, 127);
+
+imagefilledrectangle($img, 0, 0, $Image->width, $Image->height, $transparent);
+
+foreach ($Lines as $Line)
+ imagettftext($img, $Line->size, $Line->angle, $Line->x, $Line->y, $Line->color, $Line->font, $Line->value);
+
+imagepng($img);
+
+if ($Cache != "") imagepng($img, $Cache);
+imagedestroy($img);
+
+?>