diff options
-rw-r--r-- | LICENSE.txt | 19 | ||||
-rw-r--r-- | README.md | 21 | ||||
-rw-r--r-- | index.php | 100 | ||||
-rw-r--r-- | static/mageia-logo.png | bin | 0 -> 15505 bytes | |||
-rw-r--r-- | var/hugs/padd1.jpg | bin | 0 -> 29995 bytes | |||
-rw-r--r-- | var/hugs/padd2.jpg | bin | 0 -> 29453 bytes | |||
-rw-r--r-- | var/hugs/padd3.jpg | bin | 0 -> 20023 bytes |
7 files changed, 140 insertions, 0 deletions
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 <rda@mageia.org> + +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 <rda> 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 @@ +<?php +/** + * hugs.mageia.org - a place where to send the grumpy ones. + * + * Got an argument (or approaching) with someone on IRC or by email? + * Things get tense? Be cool! And be the first to give this virtual hug! + * + * PHP version 5 + * + * @category Mageia_Web_Sites + * @package Hugs.mageia.org + * @author Romain d'Alverny <rda@mageia.org> + * @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 = '<img id="hi" src="%s" alt="Free Hugs!" title="Come get a hug!">'; + $img = $images[array_rand($images)]; + $out = sprintf($img_tmpl, + str_replace(realpath(dirname(__FILE__)), '', $img)); +} else { + $out = '<div id="hi"><p>404 Hug Not Found :(</p></div>'; +} + +?><!DOCTYPE html> +<html lang="en" dir="ltr"> +<head> + <meta charset="utf-8"> + <title>Free Hugs! @ Mageia</title> + <meta name="description" content="Be kind. Enough with bugs. Hug someone!"> + <meta name="keywords" content="mageia, hugs, bugs, calins"> + <meta name="robots" content="index, follow"> + <link rel="canonical" href="http://hugs.mageia.org/"> + <link rel="icon" type="image/png" href="/static/favicon.png"> + <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Unkempt"> + <style> + html { margin: 0; padding: 0; background: #fff; } + body { margin: 0 auto; padding: 20px 40px; font-size: 100%; } + h1, h2 { font-family: Unkempt, "Times New Roman", serif; font-weight: normal; } + h1 { margin: 0 0 1em 0; font-size: 250%; } + h2 { margin-top: 2em; font-size: 180%; } + a, a:link { color: #2383c2; text-decoration: none; } + ul { margin-bottom: 4em; } + li { margin-bottom: 0.6em; } + #hi { margin: 10px 0 0 0; width: 350px; -webkit-box-shadow: 0 0 40px #555; + -moz-box-shadow: 0 0 40px #555; box-shadow: 0 0 40px #555; } + #hi p { padding: 2em; } + p { font-family: "Trebuchet MS"; font-size: 80%; color: #222; } + section { float: left; margin-left: 20px; } + aside { float: left; text-align: left; margin-left: 60px; width: 350px; + display: block; } + article { display: block; width: auto; margin: auto; } + footer { clear: both; color: #ddd; margin-top: 3em; } + footer a { color: #ddd; text-decoration: none; } + div.clear { clear: both; } + </style> +</head> +<body> + <article> + <section><?php echo $out; ?></section> + <aside> + <h1>Need a hug?</h1> + + <p>Maybe you wanted to visit <a href="http://bugs.mageia.org/" + rel="nofollow">bugs.mageia.org</a> (with a b!) actually?</p> + <p>Or to check our <a href="http://mageia.org/en/about/code-of-conduct/" + rel="nofollow">code of conduct</a>; + just some advice to help collaboration within our project.</p> + <p>Or to learn more about <a href="http://mageia.org/">Mageia</a>! + We're <a href="http://bonjourmageia.fr/" + rel="nofollow">nice fellows</a> + and we gather to build a Linux-based operating system. + It's fun, it's great, <a href="http://mageia.org/">have a look</a> + and <a href="http://mageia.org/join/">join us</a>!</p> + <p style="text-align: center;"><a href="http://mageia.org/"> + <img src="static/mageia-logo.png" + style="width: 200px;" + alt="Mageia"></a></p> + + <h2>Free hugs?</h2> + <p>Yes! A hug definitely will make you feel better. + It's free and it's great!</p> + + <p>Check the <a href="http://www.freehugscampaign.org/">Free + Hugs Campaign</a> out, and save the date: next International + Free Hugs Day is on <time datetime="2011-07-02">July, + 2<sup>nd</sup> 2011</time>.</p> + </aside> + <div class="clear"></div> + </article> + <footer> + <p><a href="http://mageia.org/">mageia.org</a></p> + </footer> +</body> +</html>
\ No newline at end of file diff --git a/static/mageia-logo.png b/static/mageia-logo.png Binary files differnew file mode 100644 index 0000000..2878e32 --- /dev/null +++ b/static/mageia-logo.png diff --git a/var/hugs/padd1.jpg b/var/hugs/padd1.jpg Binary files differnew file mode 100644 index 0000000..bf400a0 --- /dev/null +++ b/var/hugs/padd1.jpg diff --git a/var/hugs/padd2.jpg b/var/hugs/padd2.jpg Binary files differnew file mode 100644 index 0000000..3c213f6 --- /dev/null +++ b/var/hugs/padd2.jpg diff --git a/var/hugs/padd3.jpg b/var/hugs/padd3.jpg Binary files differnew file mode 100644 index 0000000..3095e5c --- /dev/null +++ b/var/hugs/padd3.jpg |