aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--index.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/index.php b/index.php
index b5e9f1e..14f2883 100644
--- a/index.php
+++ b/index.php
@@ -15,6 +15,8 @@
* @link http://svnweb.mageia.org/svn/web/hugs/
*/
+header('Content-Type: text/html; charset=utf-8');
+
$app_root = realpath(dirname(__FILE__));
$images = glob(sprintf('%s/var/hugs/*.jpg', $app_root));
@@ -31,7 +33,9 @@ if (count($images) > 0) {
&& isset($exif['COMMENT'])) {
$out .= sprintf('<figcaption id="hicomment">%s</figcaption>',
- nl2br($exif['COMMENT'][0]));
+ nl2br(preg_replace('`((?:https?|ftp)://\S+[[:alnum:]]/?)`si',
+ '<a href="$1" rel="nofollow">$1</a>',
+ trim($exif['COMMENT'][0]))));
}
$out = sprintf('<figure>%s</figure>', $out);
@@ -75,7 +79,7 @@ if (count($images) > 0) {
#hi.flipped { -webkit-transform: rotateY(180deg); -moz-transform: rotateY(180deg); }
#hi p { padding: 2em; }
#hicomment { width: 342px; padding: 1em 4px; color: #cccccc; font-size: 70%; font-family: Verdana, Arial; }
- #hicomment a { color: #aaaaaa; }
+ #hicomment a { color: #bbbbbb; }
p { font-family: "Trebuchet MS"; font-size: 90%; color: #222; }
section { float: left; margin-left: 20px; }
aside { float: left; text-align: left; margin-left: 60px; width: 350px; display: block; }