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 --- LICENSE.txt | 19 ++++++++++ README.md | 21 +++++++++++ index.php | 100 +++++++++++++++++++++++++++++++++++++++++++++++++ static/mageia-logo.png | Bin 0 -> 15505 bytes var/hugs/padd1.jpg | Bin 0 -> 29995 bytes var/hugs/padd2.jpg | Bin 0 -> 29453 bytes var/hugs/padd3.jpg | Bin 0 -> 20023 bytes 7 files changed, 140 insertions(+) create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100644 index.php create mode 100644 static/mageia-logo.png create mode 100644 var/hugs/padd1.jpg create mode 100644 var/hugs/padd2.jpg create mode 100644 var/hugs/padd3.jpg diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..fe16050 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (c) 2011 Romain d'Alverny + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..5f6042d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# hugs.mageia.org +Romain d'Alverny for Mageia.Org + +Code is available in http://svn.mageia.org/svn/web/hugs/ +under MIT license, see LICENSE.txt. + +## About + +See https://bugs.mageia.org/show_bug.cgi?id=1043 + + +## Requirements + + - PHP 5.2+ + + +## TODO + + - Submission guidelines for photographs. + - Add a caption to a picture + a link to bonjourmageia.fr? + => use photograph EXIF data for Copyright, comment, link? 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 diff --git a/static/mageia-logo.png b/static/mageia-logo.png new file mode 100644 index 0000000..2878e32 Binary files /dev/null and b/static/mageia-logo.png differ diff --git a/var/hugs/padd1.jpg b/var/hugs/padd1.jpg new file mode 100644 index 0000000..bf400a0 Binary files /dev/null and b/var/hugs/padd1.jpg differ diff --git a/var/hugs/padd2.jpg b/var/hugs/padd2.jpg new file mode 100644 index 0000000..3c213f6 Binary files /dev/null and b/var/hugs/padd2.jpg differ diff --git a/var/hugs/padd3.jpg b/var/hugs/padd3.jpg new file mode 100644 index 0000000..3095e5c Binary files /dev/null and b/var/hugs/padd3.jpg differ -- cgit v1.2.1