From ee6e716a4894dce6e92bbb8ef5b38c9bbf98a5d1 Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Wed, 4 May 2011 15:33:28 +0000 Subject: initial code --- index.php | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 index.php (limited to 'index.php') diff --git a/index.php b/index.php new file mode 100644 index 0000000..c245730 --- /dev/null +++ b/index.php @@ -0,0 +1,100 @@ + + * @copyright 2011 Romain d'Alverny + * @license MIT License, see LICENSE.txt + * @link http://svnweb.mageia.org/svn/web/hugs/ +*/ + +$app_root = realpath(dirname(__FILE__)); + +$images = glob(sprintf('%s/var/hugs/*.jpg', $app_root)); +if (count($images) > 0) { + $img_tmpl = 'Free Hugs!'; + $img = $images[array_rand($images)]; + $out = sprintf($img_tmpl, + str_replace(realpath(dirname(__FILE__)), '', $img)); +} else { + $out = '

404 Hug Not Found :(

'; +} + +?> + + + + Free Hugs! @ Mageia + + + + + + + + + +
+
+ +
+
+ + + \ No newline at end of file -- cgit v1.2.1