From dd3d2509f6048e11f9b2b127f6c7acb80a506d8d Mon Sep 17 00:00:00 2001
From: emkael <emkael@tlen.pl>
Date: Thu, 29 Jan 2015 10:50:20 +0100
Subject:  * link to original URL

---
 http/index.php | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

(limited to 'http')

diff --git a/http/index.php b/http/index.php
index e8e18a8..a7034b6 100644
--- a/http/index.php
+++ b/http/index.php
@@ -54,7 +54,10 @@ if ($path) {
     $content = '<html><head>'
        . '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'
        . '<base href="' . BASE_PATH . '" />'
-       . '<style>body {width: 580px; font-family: Tahoma, Geneva, Arial, Helvetica, "sans-serif";}</style>'
+       . '<style>'
+       . 'body{width:580px;font-family:Tahoma,Geneva,Arial,Helvetica,"sans-serif";}'
+       . 'a{text-decoration:none;color:black;}'
+       . '</style>'
        . '</head><body>'
        . implode(PHP_EOL, array_slice($contentLines, $delimiters[0]+1, $delimiters[1]-$delimiters[0]-1))
        . '</body></html>';
@@ -117,6 +120,15 @@ if ($path) {
   }
   $html->top();
 
+  // link to the original URL on the image from foto/ directory and on the name+surname
+  // (actually, on every text with font-size:28px set)
+  $linking = $html->find('img[src^="foto/"],span[style*=":28px"]');
+  foreach ($linking as $link) {
+     $link->wrap('<a></a>');
+     $link->parent()->attr('href', $mscUrl);
+  }
+  $html->top();
+
   // all done
   print $html->html();
 }
-- 
cgit v1.2.3