]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Version 0.0.28 beta:
authorSeb Sauvage <sebsauvage@sebsauvage.net>
Thu, 17 Nov 2011 20:46:34 +0000 (21:46 +0100)
committerEmilien Klein <emilien@klein.st>
Thu, 17 Nov 2011 20:46:34 +0000 (21:46 +0100)
- Changed: New Shaarli theme and logo by Idle (http://www.idleman.fr/blog/?p=469)
- Changed: In picture wall, pictures point to Shaarli permalink instead of final URL. This way, users can read the description.
- Corrected: In RSS/ATOM feeds, guid and link URL of permalinks are now proper absolute URLs.
- Added: In RSS/ATOM feeds, URLs are now clickable.
- Changed: http_parse_headers() function renamed to http_parse_headers_shaarli() to prevent name collision with some php extensions.
- Corrected: Thumbnails removed for imgur.com/a/ URLs (Thumbnails are not available for albums on imgur).
- Corrected: Shaarli now correctly only tries to get thumbnails for vimeo video URLs.
- Corrected: A bug in imgur.com URLs handling would cause some thumbnails not to appear. This has been corrected. You should see more thumbnails now.
- Added: Thumbnail support for youtu.be URLs (YouTube short url service).
- Added: PubSubHub protocol support (from http://aldarone.fr/les-flux-rss-shaarli-et-pubsubhubbub/). Warning: This was not tested. You need to set your hub $
- Corrected: The search engine would not return a result if the word to search was the first in description.
- Corrected: Extracted title is now correct if the page has two title html tags.
- Added: RSS and ATOM feeds now also contain tags (in category tags, as per their respective specifications).

images/calendar.png [new file with mode: 0644]
images/favicon.ico [new file with mode: 0644]
images/logo.png [new file with mode: 0644]
images/tag_blue.png [new file with mode: 0644]
index.php
shaarli.css

diff --git a/images/calendar.png b/images/calendar.png
new file mode 100644 (file)
index 0000000..6589138
Binary files /dev/null and b/images/calendar.png differ
diff --git a/images/favicon.ico b/images/favicon.ico
new file mode 100644 (file)
index 0000000..c8b043b
Binary files /dev/null and b/images/favicon.ico differ
diff --git a/images/logo.png b/images/logo.png
new file mode 100644 (file)
index 0000000..2098928
Binary files /dev/null and b/images/logo.png differ
diff --git a/images/tag_blue.png b/images/tag_blue.png
new file mode 100644 (file)
index 0000000..9757fc6
Binary files /dev/null and b/images/tag_blue.png differ
index 801108b808c95af1cbfb16d74f2f2d2c81311e24..daafb1dbebbd8f43856f2f7861f3f79bfdc0b799 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,5 +1,5 @@
 <?php
-// Shaarli 0.0.27 beta - Shaare your links...
+// Shaarli 0.0.28 beta - Shaare your links...
 // The personal, minimalist, super-fast, no-database delicious clone. By sebsauvage.net
 // http://sebsauvage.net/wiki/doku.php?id=php:shaarli
 // Licence: http://www.opensource.org/licenses/zlib-license.php
@@ -20,7 +20,8 @@ $GLOBALS['config']['HIDE_TIMESTAMPS'] = false; // If true, the moment when links
 $GLOBALS['config']['ENABLE_THUMBNAILS'] = true; // Enable thumbnails in links.
 $GLOBALS['config']['CACHEDIR'] = 'cache'; // Cache directory for thumbnails for SLOW services (like flickr)
 $GLOBALS['config']['ENABLE_LOCALCACHE'] = true; // Enable Shaarli to store thumbnail in a local cache. Disable to reduce webspace usage.
-        
+$GLOBALS['config']['PUBSUBHUB_URL'] = ''; // PubSubHub support. Put an empty string to disable, or put your hub url here to enable.
+                                          // Note: You must have publisher.php in the same directory as Shaarli index.php   
 // -----------------------------------------------------------------------------------------------
 // Program config (touch at your own risks !)
 $GLOBALS['config']['UPDATECHECK_FILENAME'] = $GLOBALS['config']['DATADIR'].'/lastupdatecheck.txt'; // For updates check of Shaarli.
@@ -53,7 +54,7 @@ header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
 header("Cache-Control: no-store, no-cache, must-revalidate");
 header("Cache-Control: post-check=0, pre-check=0", false);
 header("Pragma: no-cache");
-define('shaarli_version','0.0.27 beta');
+define('shaarli_version','0.0.28 beta');
 if (!is_dir($GLOBALS['config']['DATADIR'])) { mkdir($GLOBALS['config']['DATADIR'],0705); chmod($GLOBALS['config']['DATADIR'],0705); }
 if (!is_file($GLOBALS['config']['DATADIR'].'/.htaccess')) { file_put_contents($GLOBALS['config']['DATADIR'].'/.htaccess',"Allow from none\nDeny from all\n"); } // Protect data files.    
 if ($GLOBALS['config']['ENABLE_LOCALCACHE'])
@@ -94,7 +95,7 @@ function checkUpdate()
     {
         $version=shaarli_version;
         list($httpstatus,$headers,$data) = getHTTP('http://sebsauvage.net/files/shaarli_version.txt',2);
-        if (strpos($httpstatus,'200 OK')) $version=$data;
+        if (strpos($httpstatus,'200 OK')!==false) $version=$data;
         // If failed, nevermind. We don't want to bother the user with that.  
         file_put_contents($GLOBALS['config']['UPDATECHECK_FILENAME'],$version); // touch file date
     }
@@ -149,6 +150,23 @@ function autoLocale()
     setlocale(LC_TIME,$loc);  // LC_TIME = Set local for date/time format only.
 }
 
+// ------------------------------------------------------------------------------------------
+// PubSubHub protocol support (if enabled)  [UNTESTED]
+// (Source: http://aldarone.fr/les-flux-rss-shaarli-et-pubsubhubbub/ )
+if (!empty($GLOBALS['config']['PUBSUBHUB_URL'])) include './publisher.php';
+function pubsubhub()
+{
+    if (!empty($GLOBALS['config']['PUBSUBHUB_URL']))
+    {
+       $p = new Publisher($GLOBALS['config']['PUBSUBHUB_URL']);
+       $topic_url = array (
+                       serverUrl().$_SERVER['SCRIPT_NAME'].'?do=atom',
+                       serverUrl().$_SERVER['SCRIPT_NAME'].'?do=rss'
+                    );
+       $p->publish_update($topic_url);
+    }
+}
+
 // ------------------------------------------------------------------------------------------
 // Session management
 define('INACTIVITY_TIMEOUT',3600); // (in seconds). If the user does not access any page within this time, his/her session is considered expired.
@@ -378,13 +396,13 @@ function linkdate2locale($linkdate)
 }
 
 // Parse HTTP response headers and return an associative array.
-function http_parse_headers( $headers ) 
+function http_parse_headers_shaarli( $headers ) 
 {
     $res=array();
     foreach($headers as $header)
     {
         $i = strpos($header,': ');
-        if ($i)
+        if ($i!==false)
         {
             $key=substr($header,0,$i);
             $value=substr($header,$i+2,strlen($header)-$i-2);
@@ -401,7 +419,7 @@ function http_parse_headers( $headers )
                       [1] = associative array containing HTTP response headers (eg. echo getHTTP($url)[1]['Content-Type'])
                       [2] = data
     Example: list($httpstatus,$headers,$data) = getHTTP('http://sebauvage.net/');
-             if (strpos($httpstatus,'200 OK'))
+             if (strpos($httpstatus,'200 OK')!==false)
                  echo 'Data type: '.htmlspecialchars($headers['Content-Type']);
              else
                  echo 'There was an error: '.htmlspecialchars($httpstatus)
@@ -415,7 +433,7 @@ function getHTTP($url,$timeout=30)
         $data=file_get_contents($url,false,$context,-1, 4000000); // We download at most 4 Mb from source.
         if (!$data) { $lasterror=error_get_last();  return array($lasterror['message'],array(),''); }
         $httpStatus=$http_response_header[0]; // eg. "HTTP/1.1 200 OK"
-        $responseHeaders=http_parse_headers($http_response_header);
+        $responseHeaders=http_parse_headers_shaarli($http_response_header);
         return array($httpStatus,$responseHeaders,$data);
     }
     catch (Exception $e)  // getHTTP *can* fail silentely (we don't care if the title cannot be fetched)
@@ -428,7 +446,7 @@ function getHTTP($url,$timeout=30)
 // (Returns an empty string if not found.)
 function html_extract_title($html) 
 {
-  return preg_match('!<title>(.*)</title>!is', $html, $matches) ? trim(str_replace("\n",' ', $matches[1])) : '' ;   
+  return preg_match('!<title>(.*?)</title>!is', $html, $matches) ? trim(str_replace("\n",' ', $matches[1])) : '' ;   
 }
 
 // ------------------------------------------------------------------------------------------
@@ -574,7 +592,10 @@ class linkdb implements Iterator, Countable, ArrayAccess
         $s = strtolower($searchterms);
         foreach($this->links as $l)
         { 
-            $found=strpos(strtolower($l['title']),$s) || strpos(strtolower($l['description']),$s) || strpos(strtolower($l['url']),$s) || strpos(strtolower($l['tags']),$s);
+            $found=   (strpos(strtolower($l['title']),$s)!==false)
+                   || (strpos(strtolower($l['description']),$s)!==false)
+                   || (strpos(strtolower($l['url']),$s)!==false)
+                   || (strpos(strtolower($l['tags']),$s)!==false);
             if ($found) $filtered[$l['linkdate']] = $l;
         }
         krsort($filtered);
@@ -644,16 +665,29 @@ function showRSS()
     $pageaddr=htmlspecialchars(serverUrl().$_SERVER["SCRIPT_NAME"]);
     echo '<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">';
     echo '<channel><title>'.htmlspecialchars($GLOBALS['title']).'</title><link>'.$pageaddr.'</link>';
-    echo '<description>Shared links</description><language></language><copyright>'.$pageaddr.'</copyright>'."\n\n";
+    echo '<description>Shared links</description><language>en-en</language><copyright>'.$pageaddr.'</copyright>'."\n\n";
+    if (!empty($GLOBALS['config']['PUBSUBHUB_URL']))
+    {
+        echo '<!-- PubSubHubbub Discovery -->';
+        echo '<link rel="hub" href="'.htmlspecialchars($GLOBALS['config']['PUBSUBHUB_URL']).'" xmlns="http://www.w3.org/2005/Atom" />';
+        echo '<link rel="self" href="'.htmlspecialchars($pageaddr).'?do=rss" xmlns="http://www.w3.org/2005/Atom" />';
+        echo '<!-- End Of PubSubHubbub Discovery -->';
+    }
     $i=0;
     $keys=array(); foreach($linksToDisplay as $key=>$value) { $keys[]=$key; }  // No, I can't use array_keys().
     while ($i<50 && $i<count($keys))
     {
         $link = $linksToDisplay[$keys[$i]];
         $rfc822date = linkdate2rfc822($link['linkdate']);
-        echo '<item><title>'.htmlspecialchars($link['title']).'</title><guid>'.htmlspecialchars($link['url']).'</guid><link>'.htmlspecialchars($link['url']).'</link>';
-        if (!$GLOBALS['config']['HIDE_TIMESTAMPS'] || isLoggedIn()) echo '<pubDate>'.htmlspecialchars($rfc822date).'</pubDate>';
-        echo '<description><![CDATA['.nl2br(htmlspecialchars($link['description'])).']]></description></item>'."\n";      
+        $absurl = htmlspecialchars($link['url']);
+        if (startsWith($absurl,'?')) $absurl=$pageaddr.$absurl;  // make permalink URL absolute
+        echo '<item><title>'.htmlspecialchars($link['title']).'</title><guid>'.$absurl.'</guid><link>'.$absurl.'</link>';
+        if (!$GLOBALS['config']['HIDE_TIMESTAMPS'] || isLoggedIn()) echo '<pubDate>'.htmlspecialchars($rfc822date)."</pubDate>\n";
+        if ($link['tags']!='') // Adding tags to each RSS entry (as mentioned in RSS specification)
+        {     
+            foreach(explode(' ',$link['tags']) as $tag) { echo '<category domain="'.htmlspecialchars($pageaddr).'">'.htmlspecialchars($tag).'</category>'."\n"; }
+        }          
+        echo '<description><![CDATA['.nl2br(text2clickable(htmlspecialchars($link['description']))).']]></description>'."\n</item>\n";      
         $i++;
     }
     echo '</channel></rss>';
@@ -683,15 +717,29 @@ function showATOM()
         $link = $linksToDisplay[$keys[$i]];
         $iso8601date = linkdate2iso8601($link['linkdate']);
         $latestDate = max($latestDate,$iso8601date);
-        $entries.='<entry><title>'.htmlspecialchars($link['title']).'</title><link href="'.htmlspecialchars($link['url']).'"/><id>'.htmlspecialchars($link['url']).'</id>';
+        $absurl = htmlspecialchars($link['url']);
+        if (startsWith($absurl,'?')) $absurl=$pageaddr.$absurl;  // make permalink URL absolute        
+        $entries.='<entry><title>'.htmlspecialchars($link['title']).'</title><link href="'.$absurl.'" /><id>'.$absurl.'</id>';
         if (!$GLOBALS['config']['HIDE_TIMESTAMPS'] || isLoggedIn()) $entries.='<updated>'.htmlspecialchars($iso8601date).'</updated>';
-        $entries.='<summary>'.nl2br(htmlspecialchars($link['description'])).'</summary></entry>'."\n";      
+        $entries.='<summary>'.nl2br(text2clickable(htmlspecialchars($link['description'])))."</summary>\n";
+        if ($link['tags']!='') // Adding tags to each ATOM entry (as mentioned in ATOM specification)
+        {     
+            foreach(explode(' ',$link['tags']) as $tag)
+                { $entries.='<category scheme="'.htmlspecialchars($pageaddr,ENT_QUOTES).'" term="'.htmlspecialchars($tag,ENT_QUOTES).'" />'."\n"; }
+        }  
+        $entries.="</entry>\n";      
         $i++;
     }
     $feed='<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.w3.org/2005/Atom">';
     $feed.='<title>'.htmlspecialchars($GLOBALS['title']).'</title>';
     if (!$GLOBALS['config']['HIDE_TIMESTAMPS'] || isLoggedIn()) $feed.='<updated>'.htmlspecialchars($latestDate).'</updated>';
-    $feed.='<link href="'.htmlspecialchars($pageaddr).'" />';
+    $feed.='<link rel="self" href="'.htmlspecialchars($pageaddr).'" />';
+    if (!empty($GLOBALS['config']['PUBSUBHUB_URL']))
+    {
+        $feed.='<!-- PubSubHubbub Discovery -->';
+        $feed.='<link rel="hub" href="'.htmlspecialchars($GLOBALS['config']['PUBSUBHUB_URL']).'" />';
+        $feed.='<!-- End Of PubSubHubbub Discovery -->';
+    }
     $feed.='<author><uri>'.htmlspecialchars($pageaddr).'</uri></author>';
     $feed.='<id>'.htmlspecialchars($pageaddr).'</id>'."\n\n"; // Yes, I know I should use a real IRI (RFC3987), but the site URL will do.
     $feed.=$entries;
@@ -747,13 +795,14 @@ function renderPage()
         elseif (!empty($_GET['searchtags']))   $linksToDisplay = $LINKSDB->filterTags(trim($_GET['searchtags']));
         else $linksToDisplay = $LINKSDB;
         $body='';
+        
         foreach($linksToDisplay as $link)
         {
-            $thumb=thumbnail($link['url']);
+               $href='?'.htmlspecialchars(smallhash($link['linkdate']),ENT_QUOTES);
+            $thumb=thumbnail($link['url'],$href);
             if ($thumb!='')
             {
-                $url=htmlspecialchars($link['url'],ENT_QUOTES);
-                $body.='<div class="picwall_pictureframe">'.$thumb.'<a href="'.$url.'"><span class="info">'.htmlspecialchars($link['title']).'</span></a></div>';
+                $body.='<div class="picwall_pictureframe">'.$thumb.'<a href="'.$href.'"><span class="info">'.htmlspecialchars($link['title']).'</span></a></div>';
                 
             }
         }
@@ -831,15 +880,15 @@ function renderPage()
         // Show login screen, then redirect to ?post=...
         if (isset($_GET['post'])) 
         {
-            header('Location: ?do=login&post='.urlencode($_GET['post']).(isset($_GET['title'])?'&title='.urlencode($_GET['title']):'').(isset($_GET['source'])?'&source='.urlencode($_GET['source']):'')); // Redirect to login page, then back to post link.
+            header('Location: ?do=login&post='.urlencode($_GET['post']).(iset($_GET['title'])?'&title='.urlencode($_GET['title']):'').(isset($_GET['source'])?'&source='.urlencode($_GET['source']):'')); // Redirect to login page, then back to post link.
             exit;
         }
         
         // Show search form and display list of links.
         $searchform=<<<HTML
 <div id="headerform" style="width:100%; white-space:nowrap;";>
-    <form method="GET" name="searchform" style="display:inline;"><input type="text" name="searchterm" style="width:50%" value=""> <input type="submit" value="Search" class="bigbutton"></form>
-    <form method="GET" name="tagfilter" style="display:inline;padding-left:24px;"><input type="text" name="searchtags" id="searchtags" style="width:20%" value=""> <input type="submit" value="Filter by tag" class="bigbutton"></form>
+    <form method="GET" class="searchform" name="searchform" style="display:inline;"><input type="text" name="searchterm" style="width:30%" value=""> <input type="submit" value="Search" class="bigbutton"></form>
+    <form method="GET" class="tagfilter" name="tagfilter" style="display:inline;margin-left:24px;"><input type="text" name="searchtags" id="searchtags" style="width:10%" value=""> <input type="submit" value="Filter by tag" class="bigbutton"></form>
 </div>
 HTML;
         $data = array('pageheader'=>$searchform,'body'=>templateLinkList(),'onload'=>''); 
@@ -856,13 +905,13 @@ HTML;
         // The javascript code for the bookmarklet:
         $changepwd = ($GLOBALS['config']['OPEN_SHAARLI'] ? '' : '<a href="?do=changepasswd"><b>Change password</b></a> - Change your password.<br><br>' );
         $toolbar= <<<HTML
-<div id="headerform"><br>
+<div id="toolsdiv"><br>
     {$changepwd}        
     <a href="?do=configure"><b>Configure your Shaarli</b></a> - Change Title, timezone...<br><br>
     <a href="?do=changetag"><b>Rename/delete tags</b></a> - Rename or delete a tag in all links.<br><br>
     <a href="?do=import"><b>Import</b></a> - Import Netscape html bookmarks (as exported from Firefox, Chrome, Opera, delicious...)<br><br>
     <a href="?do=export"><b>Export</b></a> - Export Netscape html bookmarks (which can be imported in Firefox, Chrome, Opera, delicious...)<br><br>
-    <a class="smallbutton" style="color:black;" onclick="alert('Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link...');return false;" href="javascript:javascript:(function(){var%20url%20=%20location.href;var%20title%20=%20document.title%20||%20url;window.open('{$pageabsaddr}?post='%20+%20encodeURIComponent(url)+'&amp;title='%20+%20encodeURIComponent(title)+'&amp;source=bookmarklet','_blank','menubar=no,height=400,width=608,toolbar=no,scrollbars=no,status=no');})();">Shaare link</a> - Drag this link to your bookmarks toolbar (or right-click it and choose Bookmark This Link....). Then click "Shaare link" button in any page you want to share.<br><br>
+    <a class="smallbutton"  onclick="alert('Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link...');return false;" href="javascript:javascript:(function(){var%20url%20=%20location.href;var%20title%20=%20document.title%20||%20url;window.open('{$pageabsaddr}?post='%20+%20encodeURIComponent(url)+'&amp;title='%20+%20encodeURIComponent(title)+'&amp;source=bookmarklet','_blank','menubar=no,height=400,width=608,toolbar=no,scrollbars=no,status=no');})();">Shaare link</a> - Drag this link to your bookmarks toolbar (or right-click it and choose Bookmark This Link....). Then click "Shaare link" button in any page you want to share.<br><br>
 </div>
 HTML;
         $data = array('pageheader'=>$toolbar,'body'=>'','onload'=>''); 
@@ -892,7 +941,7 @@ HTML;
         {
             $token = getToken();
             $changepwdform= <<<HTML
-<form method="POST" action="" name="changepasswordform" style="padding:10 10 10 10;">
+<form method="POST" action="" name="changepasswordform" id="changepasswordform">
 Old password: <input type="password" name="oldpassword">&nbsp; &nbsp;
 New password: <input type="password" name="setpassword">
 <input type="hidden" name="token" value="{$token}">
@@ -951,7 +1000,7 @@ HTML;
         {
             $token = getToken();
             $changetagform = <<<HTML
-<form method="POST" action="" name="changetag" style="padding:10 10 10 10;">
+<form method="POST" action="" name="changetag" id="changetag">
 <input type="hidden" name="token" value="{$token}">
 Tag: <input type="text" name="fromtag" id="fromtag">
 <input type="text" name="totag" style="margin-left:40px;"><input type="submit" name="renametag" value="Rename tag" class="bigbutton">      
@@ -976,6 +1025,7 @@ HTML;
                 $LINKSDB[$key]=$value;
             }
             $LINKSDB->savedb(); // save to disk
+            pubsubhub();
             invalidateCaches();
             echo '<script language="JavaScript">alert("Tag was removed from '.count($linksToAlter).' links.");document.location=\'?\';</script>';
             exit;
@@ -1004,7 +1054,7 @@ HTML;
     if (startswith($_SERVER["QUERY_STRING"],'do=addlink'))
     {
         $onload = 'onload="document.addform.post.focus();"';
-        $addform= '<div id="headerform"><form method="GET" action="" name="addform"><input type="text" name="post" style="width:70%;"> <input type="submit" value="Add link" class="bigbutton"></div>';
+        $addform= '<div id="headerform"><form method="GET" action="" name="addform" class="addform"><input type="text" name="post" style="width:50%;"> <input type="submit" value="Add link" class="bigbutton"></div>';
         $data = array('pageheader'=>$addform,'body'=>'','onload'=>$onload); 
         templatePage($data);
         exit;
@@ -1075,9 +1125,9 @@ HTML;
         $url=$_GET['post'];
 
         // We remove the annoying parameters added by FeedBurner and GoogleFeedProxy (?utm_source=...)
-        $i=strpos($url,'&utm_source='); if ($i) $url=substr($url,0,$i);
-        $i=strpos($url,'?utm_source='); if ($i) $url=substr($url,0,$i);
-        $i=strpos($url,'#xtor=RSS-'); if ($i) $url=substr($url,0,$i);
+        $i=strpos($url,'&utm_source='); if ($i!==false) $url=substr($url,0,$i);
+        $i=strpos($url,'?utm_source='); if ($i!==false) $url=substr($url,0,$i);
+        $i=strpos($url,'#xtor=RSS-'); if ($i!==false) $url=substr($url,0,$i);
         
         $link_is_new = false;
         $link = $LINKSDB->getLinkFromUrl($url); // Check if URL is not already in database (in this case, we will edit the existing link)
@@ -1093,7 +1143,7 @@ HTML;
             {
                 list($status,$headers,$data) = getHTTP($url,4); // Short timeout to keep the application responsive.
                 // FIXME: Decode charset according to specified in either 1) HTTP response headers or 2) <head> in html 
-                if (strpos($status,'200 OK')) $title=html_entity_decode(html_extract_title($data),ENT_QUOTES,'UTF-8');
+                if (strpos($status,'200 OK')!==false) $title=html_entity_decode(html_extract_title($data),ENT_QUOTES,'UTF-8');
             }
             if ($url=='') $url='?'.smallHash($linkdate); // In case of empty URL, this is just a text (with a link that point to itself)
             $link = array('linkdate'=>$linkdate,'title'=>$title,'url'=>$url,'description'=>$description,'tags'=>$tags,'private'=>0); 
@@ -1110,7 +1160,7 @@ HTML;
         if (empty($_GET['what']))
         {
             $toolbar= <<<HTML
-<div id="headerform"><br>
+<div id="toolsdiv">
     <a href="?do=export&what=all"><b>Export all</b></a> - Export all links<br><br>
     <a href="?do=export&what=public"><b>Export public</b></a> - Export public links only<br><br>
     <a href="?do=export&what=private"><b>Export private</b></a> - Export private links only<br><br>
@@ -1172,9 +1222,9 @@ HTML;
         $maxfilesize=getMaxFileSize();
         $onload = 'onload="document.uploadform.filetoupload.focus();"';
         $uploadform=<<<HTML
-<div id="headerform">
+<div id="uploaddiv">
 Import Netscape html bookmarks (as exported from Firefox/Chrome/Opera/delicious/diigo...) (Max: {$maxfilesize} bytes).
-<form method="POST" action="?do=upload" enctype="multipart/form-data" name="uploadform">
+<form method="POST" action="?do=upload" enctype="multipart/form-data" name="uploadform" id="uploadform">
     <input type="hidden" name="token" value="{$token}">
     <input type="file" name="filetoupload" size="80">
     <input type="hidden" name="MAX_FILE_SIZE" value="{$maxfilesize}">
@@ -1192,8 +1242,8 @@ HTML;
     // -------- Otherwise, simply display search form and links:
     $searchform=<<<HTML
 <div id="headerform" style="width:100%; white-space:nowrap;";>
-    <form method="GET" name="searchform" style="display:inline;"><input type="text" name="searchterm" style="width:50%" value=""> <input type="submit" value="Search" class="bigbutton"></form>
-    <form method="GET" name="tagfilter" style="display:inline;padding-left:24px;"><input type="text" name="searchtags" id="searchtags" style="width:20%" value=""> <input type="submit" value="Filter by tag" class="bigbutton"></form>
+    <form method="GET" class="searchform" name="searchform"><input type="text" name="searchterm" style="width:30%" value=""> <input type="submit" value="Search" class="bigbutton"></form>
+    <form method="GET" class="tagfilter" name="tagfilter" style="margin-left:24px;"><input type="text" name="searchtags" id="searchtags" style="width:10%" value=""> <input type="submit" value="Filter by tag" class="bigbutton"></form>
 </div>
 HTML;
     $data = array('pageheader'=>$searchform,'body'=>templateLinkList(),'onload'=>''); 
@@ -1362,7 +1412,8 @@ function templateLinkList()
         $link = $linksToDisplay[$keys[$i]];
         $description=text2clickable(htmlspecialchars($link['description']));
         $title=$link['title'];
-        $classprivate = ($link['private']==0 ? '' : 'class="private"');
+        $classLi =  $i%2!=0 ? '' : 'class="publicLinkHightLight"';
+        $classprivate = ($link['private']==0 ? $classLi : 'class="private"');
         if (isLoggedIn()) $actions=' <form method="GET" class="buttoneditform"><input type="hidden" name="edit_link" value="'.$link['linkdate'].'"><input type="submit" value="Edit" class="smallbutton"></form>';
         $tags='';
         if ($link['tags']!='')
@@ -1389,19 +1440,24 @@ function templateLinkList()
     $linksperpage = <<<HTML
 <div style="float:right; padding-right:5px;">
 Links per page: <a href="?linksperpage=20">20</a> <a href="?linksperpage=50">50</a> <a href="?linksperpage=100">100</a>
- <form method="GET" style="display:inline;"><input type="text" name="linksperpage" size="2" style="height:15px;"></form></div>
+ <form method="GET" style="display:inline;" class="linksperpage"><input type="text" name="linksperpage" size="2" style="height:15px;"></form></div>
 HTML;
     $paging = '<div class="paging">'.$linksperpage.$paging.'</div>';
     $linklist='<div id="linklist">'.$paging.$searched.'<ul>'.$linklist.'</ul>'.$paging.'</div>';
     return $linklist;
 }
 
-// Returns the HTML code to display a thumbnail for a link.
+// Returns the HTML code to display a thumbnail for a link
+// with a link to the original URL.
 // Understands various services (youtube.com...)
-function thumbnail($url)
+// Input: $url = url for which the thumbnail must be found.
+//        $href = if provided, this URL will be followed instead of $url 
+function thumbnail($url,$href=false)
 {
     if (!$GLOBALS['config']['ENABLE_THUMBNAILS']) return '';
     
+    if ($href==false) $href=$url;
+    
     // For most hosts, the URL of the thumbnail can be easily deduced from the URL of the link.
     // (eg. http://www.youtube.com/watch?v=spVypYk4kto --->  http://img.youtube.com/vi/spVypYk4kto/default.jpg )
     //                                     ^^^^^^^^^^^                                 ^^^^^^^^^^^
@@ -1409,26 +1465,32 @@ function thumbnail($url)
     if ($domain=='youtube.com' || $domain=='www.youtube.com')
     {
         parse_str(parse_url($url,PHP_URL_QUERY), $params); // Extract video ID and get thumbnail
-        if (!empty($params['v'])) return '<a href="'.htmlspecialchars($url).'"><img src="http://img.youtube.com/vi/'.htmlspecialchars($params['v']).'/default.jpg" width="120" height="90"></a>';
+        if (!empty($params['v'])) return '<a href="'.htmlspecialchars($href).'"><img src="http://img.youtube.com/vi/'.htmlspecialchars($params['v']).'/default.jpg" width="120" height="90"></a>';
     }
+    if ($domain=='youtu.be') // Youtube short links
+    {
+        $path = parse_url($url,PHP_URL_PATH);
+        return '<a href="'.htmlspecialchars($href).'"><img src="http://img.youtube.com/vi'.htmlspecialchars($path).'/default.jpg" width="120" height="90"></a>';
+    } 
     if ($domain=='imgur.com')
     {
         $path = parse_url($url,PHP_URL_PATH);
-        if (strpos($path,'/r/')==0) return '<a href="'.htmlspecialchars($url).'"><img src="http://i.imgur.com/'.htmlspecialchars(basename($path)).'s.jpg" width="90" height="90"></a>';
-        if (strpos($path,'/gallery/')==0) return '<a href="'.htmlspecialchars($url).'"><img src="http://i.imgur.com'.htmlspecialchars(substr($path,8)).'s.jpg" width="90" height="90"></a>';
-        if (substr_count($path,'/')==1) return '<a href="'.htmlspecialchars($url).'"><img src="http://i.imgur.com/'.htmlspecialchars(substr($path,1)).'s.jpg" width="90" height="90"></a>';
+        if (startsWith($path,'/a/')) return ''; // Thumbnails for albums are not available.
+        if (startsWith($path,'/r/')) return '<a href="'.htmlspecialchars($href).'"><img src="http://i.imgur.com/'.htmlspecialchars(basename($path)).'s.jpg" width="90" height="90"></a>';
+        if (startsWith($path,'/gallery/')) return '<a href="'.htmlspecialchars($href).'"><img src="http://i.imgur.com'.htmlspecialchars(substr($path,8)).'s.jpg" width="90" height="90"></a>';
+        if (substr_count($path,'/')==1) return '<a href="'.htmlspecialchars($href).'"><img src="http://i.imgur.com/'.htmlspecialchars(substr($path,1)).'s.jpg" width="90" height="90"></a>';
     }
     if ($domain=='i.imgur.com')
     {
         $pi = pathinfo(parse_url($url,PHP_URL_PATH));
-        if (!empty($pi['filename'])) return '<a href="'.htmlspecialchars($url).'"><img src="http://i.imgur.com/'.htmlspecialchars($pi['filename']).'s.jpg" width="90" height="90"></a>';
+        if (!empty($pi['filename'])) return '<a href="'.htmlspecialchars($href).'"><img src="http://i.imgur.com/'.htmlspecialchars($pi['filename']).'s.jpg" width="90" height="90"></a>';
     } 
     if ($domain=='dailymotion.com' || $domain=='www.dailymotion.com')
     {
-        if (strpos($url,'dailymotion.com/video/'))
+        if (strpos($url,'dailymotion.com/video/')!==false)
         {
             $thumburl=str_replace('dailymotion.com/video/','dailymotion.com/thumbnail/video/',$url);
-            return '<a href="'.htmlspecialchars($url).'"><img src="'.htmlspecialchars($thumburl).'" width="120" style="height:auto;"></a>';
+            return '<a href="'.htmlspecialchars($href).'"><img src="'.htmlspecialchars($thumburl).'" width="120" style="height:auto;"></a>';
         }
     } 
     if (endsWith($domain,'.imageshack.us'))
@@ -1437,11 +1499,10 @@ function thumbnail($url)
         if ($ext=='jpg' || $ext=='jpeg' || $ext=='png' || $ext=='gif')
         {
             $thumburl = substr($url,0,strlen($url)-strlen($ext)).'th.'.$ext;
-            return '<a href="'.htmlspecialchars($url).'"><img src="'.htmlspecialchars($thumburl).'" width="120" style="height:auto;"></a>';
+            return '<a href="'.htmlspecialchars($href).'"><img src="'.htmlspecialchars($thumburl).'" width="120" style="height:auto;"></a>';
         }
     }
-   
-   
+
     // Some other hosts are SLOW AS HELL and usually require an extra HTTP request to get the thumbnail URL.
     // So we deport the thumbnail generation in order not to slow down page generation
     // (and we also cache the thumbnail)
@@ -1450,8 +1511,13 @@ function thumbnail($url)
     
     if ($domain=='flickr.com' || endsWith($domain,'.flickr.com') || $domain=='vimeo.com')
     {
+       if ($domain=='vimeo.com')
+       {   // Make sure this vimeo url points to a video (/xxx... where xxx is numeric)
+               $path = parse_url($url,PHP_URL_PATH); 
+               if (!preg_match('!/\d+.+?!',$path)) return ''; // This is not a single video URL.
+       }
         $sign = hash_hmac('sha256', $url, $GLOBALS['salt']); // We use the salt to sign data (it's random, secret, and specific to each installation)
-        return '<a href="'.htmlspecialchars($url).'"><img src="?do=genthumbnail&hmac='.htmlspecialchars($sign).'&url='.urlencode($url).'" width="120" style="height:auto;"></a>';
+        return '<a href="'.htmlspecialchars($href).'"><img src="?do=genthumbnail&hmac='.htmlspecialchars($sign).'&url='.urlencode($url).'" width="120" style="height:auto;"></a>';
     }
 
     // For all other, we try to make a thumbnail of links ending with .jpg/jpeg/png/gif
@@ -1461,7 +1527,7 @@ function thumbnail($url)
     if ($ext=='jpg' || $ext=='jpeg' || $ext=='png' || $ext=='gif')
     {
         $sign = hash_hmac('sha256', $url, $GLOBALS['salt']); // We use the salt to sign data (it's random, secret, and specific to each installation)
-        return '<a href="'.htmlspecialchars($url).'"><img src="?do=genthumbnail&hmac='.htmlspecialchars($sign).'&url='.urlencode($url).'" width="120" style="height:auto;"></a>';        
+        return '<a href="'.htmlspecialchars($href).'"><img src="?do=genthumbnail&hmac='.htmlspecialchars($sign).'&url='.urlencode($url).'" width="120" style="height:auto;"></a>';        
     }
     return ''; // No thumbnail.
 
@@ -1527,12 +1593,13 @@ JS;
 <title>{$pagetitle}</title>
 <link rel="alternate" type="application/rss+xml" href="{$feedurl}?do=rss{$searchcrits}" title="{$filtered_feed}RSS Feed" />
 <link rel="alternate" type="application/atom+xml" href="{$feedurl}?do=atom{$searchcrits}" title="{$filtered_feed}ATOM Feed" />
+<link href="./images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
 <link type="text/css" rel="stylesheet" href="shaarli.css?version={$version}" />
 {$jsincludes}
 </head>
 <body {$data['onload']}>{$newversion}
-<div id="pageheader"><div style="float:right; font-style:italic; color:#bbb; text-align:right; padding:0 5 0 0;">Shaare your links...<br>{$linkcount} links</div>
-    <span id="shaarli_title"><a href="?">{$title}</a></span> - <a href="?">Home</a>&nbsp;{$menu}&nbsp;<a href="{$feedurl}?do=rss{$searchcrits}" style="padding-left:30px;">RSS Feed</a> <a href="{$feedurl}?do=atom{$searchcrits}" style="padding-left:10px;">ATOM Feed</a>
+<div id="pageheader"><div id="logo" title="Share your links !"></div><div style="float:right; font-style:italic; color:#bbb; text-align:right; padding:0 5 0 0;">Shaare your links...<br>{$linkcount} links</div>
+    <span id="shaarli_title"><a href="?">{$title}</a></span> - <a href="?">Home</a>&nbsp;{$menu}&nbsp;<a href="{$feedurl}?do=rss{$searchcrits}">RSS Feed</a> <a href="{$feedurl}?do=atom{$searchcrits}" style="padding-left:10px;">ATOM Feed</a>
 &nbsp;&nbsp; <a href="?do=tagcloud">Tag cloud</a>&nbsp;&nbsp; <a href="?do=picwall{$searchcrits}">Picture wall</a>
 {$data['pageheader']}
 </div>
@@ -1540,7 +1607,7 @@ JS;
 
 HTML;
     $exectime = round(microtime(true)-$STARTTIME,4);
-    echo '<div id="footer"><b><a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli">Shaarli '.shaarli_version.'</a></b> - The personal, minimalist, super-fast, no-database delicious clone. By sebsauvage.net<br>Who gives a shit that this page was generated in '.$exectime.' seconds&nbsp;?</div>';
+    echo '<div id="footer"><b><a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli">Shaarli '.shaarli_version.'</a></b> - The personal, minimalist, super-fast, no-database delicious clone. By sebsauvage.net. Theme by idleman.fr.<br>Who gives a shit that this page was generated in '.$exectime.' seconds&nbsp;?</div>';
     if (isLoggedIn()) echo '<script language="JavaScript">function confirmDeleteLink() { var agree=confirm("Are you sure you want to delete this link ?"); if (agree) return true ; else return false ; }</script>';
     echo $jsincludes_bottom.'</body></html>';
 }
@@ -1614,7 +1681,7 @@ function templateTZform($ptz=false)
         {
             if ($tz=='UTC') $tz='UTC/UTC';
             $spos = strpos($tz,'/');
-            if ($spos)
+            if ($spos!==false)
             {
                 $continent=substr($tz,0,$spos); $city=substr($tz,$spos+1);
                 $continents[$continent]=1;
@@ -1768,7 +1835,7 @@ function genThumbnail()
         else // this is a flickr page (html)
         {
             list($httpstatus,$headers,$data) = getHTTP($url,20); // Get the flickr html page.
-            if (strpos($httpstatus,'200 OK'))
+            if (strpos($httpstatus,'200 OK')!==false)
             {
                 preg_match('!(http://farm\d+.static.flickr.com/\d+/\d+_\w+_)[^s].jpg!',$data,$matches);
                 if (!empty($matches[1])) $imageurl=$matches[1].'m.jpg';  
@@ -1777,7 +1844,7 @@ function genThumbnail()
         if ($imageurl!='')
         {   // Let's download the image.
             list($httpstatus,$headers,$data) = getHTTP($imageurl,10); // Image is 240x120, so 10 seconds to download should be enough.
-            if (strpos($httpstatus,'200 OK'))
+            if (strpos($httpstatus,'200 OK')!==false)
             {
                 file_put_contents($GLOBALS['config']['CACHEDIR'].'/'.$thumbname,$data); // Save image to cache.
                 header('Content-Type: image/jpeg');
@@ -1793,13 +1860,13 @@ function genThumbnail()
         // Maybe we should deport this to javascript ? Example: http://stackoverflow.com/questions/1361149/get-img-thumbnails-from-vimeo/4285098#4285098
         $vid = substr(parse_url($url,PHP_URL_PATH),1);
         list($httpstatus,$headers,$data) = getHTTP('http://vimeo.com/api/v2/video/'.htmlspecialchars($vid).'.php',5);
-        if (strpos($httpstatus,'200 OK'))
+        if (strpos($httpstatus,'200 OK')!==false)
         {
             $t = unserialize($data);
             $imageurl = $t[0]['thumbnail_medium'];
             // Then we download the image and serve it to our client.
             list($httpstatus,$headers,$data) = getHTTP($imageurl,10);
-            if (strpos($httpstatus,'200 OK'))
+            if (strpos($httpstatus,'200 OK')!==false)
             {
                 file_put_contents($GLOBALS['config']['CACHEDIR'].'/'.$thumbname,$data); // Save image to cache.
                 header('Content-Type: image/jpeg');
@@ -1811,7 +1878,7 @@ function genThumbnail()
     
     // For all other domains, we try to download the image and make a thumbnail.
     list($httpstatus,$headers,$data) = getHTTP($url,30);  // We allow 30 seconds max to download (and downloads are limited to 4 Mb)
-    if (strpos($httpstatus,'200 OK'))
+    if (strpos($httpstatus,'200 OK')!==false)
     {
         $filepath=$GLOBALS['config']['CACHEDIR'].'/'.$thumbname;
         file_put_contents($filepath,$data); // Save image to cache.
@@ -1841,9 +1908,9 @@ function resizeImage($filepath)
     // So we really try to open each image type whatever the extension is.
     $header=file_get_contents($filepath,false,NULL,0,256); // Read first 256 bytes and try to sniff file type.
     $im=false;
-    if (strpos($header,'GIF8')==0) $im = imagecreatefromgif($filepath); // Well this is crude, but it should be enough.
-    if (strpos($header,'PNG')==1) $im = imagecreatefrompng($filepath);
-    if (strpos($header,'JFIF')) $im = imagecreatefromjpeg($filepath);
+    $i=strpos($header,'GIF8'); if (($i!==false) && ($i==0)) $im = imagecreatefromgif($filepath); // Well this is crude, but it should be enough.
+    $i=strpos($header,'PNG'); if (($i!==false) && ($i==1)) $im = imagecreatefrompng($filepath);
+    $i=strpos($header,'JFIF'); if ($i!==false) $im = imagecreatefromjpeg($filepath);
     if (!$im) return false;  // Unable to open image (corrupted or not an image)
     $w = imagesx($im);
     $h = imagesy($im);
index e511e0eb7412d0c4f161a442d8cc9c057249bbc9..4fc40e5f3d42aa14b2f72d075c56e901ff5ce8bd 100644 (file)
@@ -8,60 +8,221 @@ version: 2.8.2r1
 html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:baseline;}sub{vertical-align:baseline;}legend{color:#000;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}input,button,textarea,select{*font-size:100%;}
 
 body { font-family: "Trebuchet MS",Verdana,Arial,Helvetica,sans-serif; font-size:10pt; background-color: #ffffff; } 
-input { border: 1px solid #aaa; background-color:#F0F0FF; padding: 2 5 2 5; -moz-box-shadow: inset 2px 2px 3px #aaaaaa; -webkit-box-shadow: inset 2px 2px 3px #aaaaaa; box-shadow: inset 2px 2px 3px #aaaaaa; } 
-textarea { border: 1px solid #aaa; background-color:#F0F0FF; padding: 2 5 2 5; -moz-box-shadow: inset 2px 2px 3px #B2B2C4; -webkit-box-shadow: inset 2px 2px 3px #B2B2C4; box-shadow: inset 2px 2px 3px #B2B2C4; } 
+input, textarea {
+       
+       background-color: #dedede;
+       background: -webkit-gradient(linear, 0 0, 0 bottom, from(#dedede), to(#ffffff));
+       background: -webkit-linear-gradient(#dedede, #ffffff);
+       background: -moz-linear-gradient(#dedede, #ffffff);
+       background: -ms-linear-gradient(#dedede, #ffffff);
+       background: -o-linear-gradient(#dedede, #ffffff);
+       background: linear-gradient(#dedede, #ffffff);
+       box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
+       padding:5px;
+       border-radius: 5px 5px 5px 5px;
+       border: none;
+       color:#000;
+       
+       } 
+
 h1 { font-size:20pt; font-weight:bold; font-style:italic; margin-bottom:20px; }
 /* I don't give a shit about IE. He can't understand selectors such as input[type='submit']. */
 
 /* Buttons */
-.bigbutton {border-style:outset;border-width:2px;padding:3px 6px;background-color:rgb(212,212,212);font-family:Tahoma,Verdana,Arial,Helvetica,sans-serif;font-size:8pt;-moz-border-radius:0.5em;border-radius:0.5em;} 
-.smallbutton {border-style:outset;border-width:2px;padding:0px 4px;background-color:rgb(212,212,212);font-family:Tahoma,Verdana,Arial,Helvetica,sans-serif;font-size:8pt;-moz-border-radius:0.5em;border-radius:0.5em;}
+.bigbutton {
+       background-color: #a0a0a0;
+       background: -webkit-gradient(linear, 0 0, 0 bottom, from(#a0a0a0), to(#d4d4d4));
+       background: -webkit-linear-gradient(#a0a0a0, #d4d4d4);
+       background: -moz-linear-gradient(#a0a0a0, #d4d4d4);
+       background: -ms-linear-gradient(#a0a0a0, #d4d4d4);
+       background: -o-linear-gradient(#a0a0a0, #d4d4d4);
+       background: linear-gradient(#a0a0a0, #d4d4d4);
+       box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
+       padding:0 5px 0 5px;
+       margin:5px 0 5px 0;
+       height:25px;
 
+       border-radius: 5px 5px 5px 5px;
+    -moz-border-radius:5px 5px 5px 5px;        
+       cursor:pointer; 
+       border:none;
+       border-style:outset;
+       border-width:2px;
+       } 
+.smallbutton {
+       background-color: #a0a0a0;
+       background: -webkit-gradient(linear, 0 0, 0 bottom, from(#a0a0a0), to(#d4d4d4));
+       background: -webkit-linear-gradient(#a0a0a0, #d4d4d4);
+       background: -moz-linear-gradient(#a0a0a0, #d4d4d4);
+       background: -ms-linear-gradient(#a0a0a0, #d4d4d4);
+       background: -o-linear-gradient(#a0a0a0, #d4d4d4);
+       background: linear-gradient(#a0a0a0, #d4d4d4);
+       box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
+       padding:0;
+       margin:5px 0 5px 0;
+       border-radius: 5px 5px 5px 5px;
+    -moz-border-radius:5px 5px 5px 5px;        
+       cursor:pointer; 
+       padding:0 3px 0 3px;
+       border-style:outset;
+       border-width:2px;
+       font-size:8pt;
+       }
 
+#pageheader #logo{
+background-image: url('./images/logo.png');
+background-repeat: no-repeat;
+float:left;
+margin:0 10px 0 10px;
+width:105px;
+height:55px;
+}
 #pageheader
 {
-color:#eee;
-border-bottom: 1px solid #aaa;    
-background-color: #6A6A6A;
-background-image: -webkit-gradient(linear, left top, left bottom, from(#6A6A6A), to(#303030)); /* Saf4+, Chrome */
-background-image: -webkit-linear-gradient(top, #6A6A6A, #303030); /* Chrome 10+, Saf5.1+ */
-background-image:    -moz-linear-gradient(top, #6A6A6A, #303030); /* FF3.6 */
-background-image:     -ms-linear-gradient(top, #6A6A6A, #303030); /* IE10 */
-background-image:      -o-linear-gradient(top, #6A6A6A, #303030); /* Opera 11.10+ */
-background-image:         linear-gradient(top, #6A6A6A, #303030);
-filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#6A6A6A', EndColorStr='#303030'); /* IE6-IE9 */
-padding: 0 10 5 10;
-margin: auto;
+
+       background: -webkit-gradient(linear, 0 0, 0 bottom, from(#333333), to(#111111));
+       background: -webkit-linear-gradient(#333333, #111111);
+       background: -moz-linear-gradient(#333333, #111111);
+       background: -ms-linear-gradient(#333333, #111111);
+       background: -o-linear-gradient(#333333, #111111);
+       background: linear-gradient(#333333, #111111);
+       
+    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
+       padding:5px 0 5px 0;
+    width: 100%;
+       margin: auto;
+}
+
+#pageheader a
+{
+       background: -webkit-gradient(linear, 0 0, 0 bottom, from(#333333), to(#000000));
+       background: -webkit-linear-gradient(#333333, #000000);
+       background: -moz-linear-gradient(#333333, #000000);
+       background: -ms-linear-gradient(#333333, #000000);
+       background: -o-linear-gradient(#333333, #000000);
+       background: linear-gradient(#333333, #000000);
+       
+    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
+       padding:5px;
+       border-radius: 5px 5px 5px 5px;
+       margin:10px 3px 3px 3px;
+       color:#A2DD42;
+       text-decoration:none;
+}
+
+.linksperpage,.tagfilter,.searchform,.addform {
+       background-color: #dedede;
+       background: -webkit-gradient(linear, 0 0, 0 bottom, from(#dedede), to(#ffffff));
+       background: -webkit-linear-gradient(#dedede, #ffffff);
+       background: -moz-linear-gradient(#dedede, #ffffff);
+       background: -ms-linear-gradient(#dedede, #ffffff);
+       background: -o-linear-gradient(#dedede, #ffffff);
+       background: linear-gradient(#dedede, #ffffff);
+       display:inline;
+       
+       box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
+       padding:5px;
+       border: none;
+       border-radius: 5px 5px 5px 5px;
+       margin:10px 3px 3px 3px;        
+       color:#cecece;
+}
+
+.linksperpage{
+       box-shadow: 0 0 0 rgba(0, 0, 0, 0.5);
+       padding:3px;
+}
+
+.linksperpage input,.tagfilter input, .searchform input, .addform input{
+       border:none;
+       color:#606060;
+       background:none;
+       box-shadow:none;
+       padding:5px;
+}
+
+.linksperpage input{
+       padding:0;
+}
+
+.tagfilter input.bigbutton,.searchform input.bigbutton,.addform input.bigbutton{
+       background: -webkit-gradient(linear, 0 0, 0 bottom, from(#dedede), to(#ffffff));
+       background: -webkit-linear-gradient(#dedede, #ffffff);
+       background: -moz-linear-gradient(#dedede, #ffffff);
+       background: -ms-linear-gradient(#dedede, #ffffff);
+       background: -o-linear-gradient(#dedede, #ffffff);
+       background: linear-gradient(#dedede, #ffffff);
+       box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
+       padding:0 5px 0 5px;
+       margin:5px 0 5px 0;
+       height:20px;
+       border-radius: 5px 5px 5px 5px;
+       cursor:pointer;
 }
+
 #shaarli_title { font-weight:bold; font-style:italic; }
 #shaarli_title a { color: #fff !important; }
-#pageheader a:link { color:#bbb; text-decoration:none;}
+
 #pageheader a:visited { color:#bbb; text-decoration:none;}
 #pageheader a:hover { color:#FFFFC9; text-decoration:none;}
 #pageheader a:active { color:#bbb; text-decoration:none;} 
 #searchcriteria { padding: 4 0 5 5; font-weight:bold;}
-.paging { background-color:#777; color:#ccc; text-align:center; padding:0 0 3 0; clear:both;}
+.paging { padding:5px;background-color:#777; color:#ccc; text-align:center;  clear:both;}
 .paging a:link { color:#ccc; text-decoration:none;}
 .paging a:visited { color:#ccc;  }
 .paging a:hover {  color:#FFFFC9;  }
 .paging a:active { color:#fff;  }
-#headerform { padding:5 5 5 5;  }
-#editlinkform {  padding:5 5 5 15px; width:80%; }
-#linklist li { padding:4 10 8 20; border-top: 1px solid #bbb; clear:both; }
+#headerform { color:#ffffff; padding:5 5 5 5; }
+#toolsdiv { color:#ffffff; padding:5 5 5 5; clear:left; }
+#uploaddiv { color:#ffffff; padding:5 5 5 5; clear:left; }
+#editlinkform { color:#ffffff; padding:5 5 5 15px; width:80%; clear:left; }
+#linklist li { 
+       padding:4 10 15 20; border-top: 1px solid #bbb; clear:both; 
+       background: -webkit-gradient(linear, 0 0, 0 bottom, from(#F2F2F2), to(#ffffff));
+       background: -webkit-linear-gradient(#F2F2F2, #ffffff);
+       background: -moz-linear-gradient(#F2F2F2, #ffffff);
+       background: -ms-linear-gradient(#F2F2F2, #ffffff);
+       background: -o-linear-gradient(#F2F2F2, #ffffff);
+       background: linear-gradient(#F2F2F2, #ffffff);
+}
+
+
+#linklist li.publicLinkHightLight:hover,#linklist li:hover{ 
+       background: #E9FFCE;
+}
 #linklist li.private { background-color: #ccc; border-left:8px solid #888; }
 .linktitle { font-size:14pt; font-weight:bold; }
-.linktitle a { text-decoration: none; color:#3465A4; }
+.linktitle a { text-decoration: none; color:#80AD48; }
 .linktitle a:hover { color:#F57900; }
 .linkdate { font-size:8pt; color:#888; }
-.linkdate a { text-decoration: none; color:#888;  }
+.linkdate a { background-image:url('./images/calendar.png');padding:2px 0 3px 20px;background-repeat:no-repeat;text-decoration: none; color:#E28E3F;  }
 .linkdate a:hover { color: #F57900 }
 .linkurl { font-size:8pt; color:#4BAA74; }
-.linkdescription { color:#000; margin-top:0px; margin-bottom:0px; font-weight:normal; }
+.linkdescription { color:#000; margin-top:0; margin-bottom:0; font-weight:normal; }
 .linkdescription a { text-decoration: none; color:#3465A4; }
 .linkdescription a:hover { color:#F57900; }
-.linktaglist { }
-.linktag { font-size:9pt; color:#777; background-color:#ddd; padding:0 6 0 6; -moz-box-shadow: inset 2px 2px 3px #ffffff; -webkit-box-shadow: inset 2px 2px 3px #ffffff; box-shadow: inset 2px 2px 3px ffffff;
-border-bottom:1px solid #aaa; border-right:1px solid #aaa; border-radius: 0.3em; }
+.linktaglist { padding-top:10px;}
+.linktag { 
+
+font-size:9pt; 
+       background: -webkit-gradient(linear, 0 0, 0 bottom, from(#F2F2F2), to(#ffffff));
+       background: -webkit-linear-gradient(#F2F2F2, #ffffff);
+       background: -moz-linear-gradient(#F2F2F2, #ffffff);
+       background: -ms-linear-gradient(#F2F2F2, #ffffff);
+       background: -o-linear-gradient(#F2F2F2, #ffffff);
+       background: linear-gradient(#F2F2F2, #ffffff);
+       
+       
+    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
+       padding:3px 3px 3px 20px;
+       height:20px;
+       border-radius: 3px 3px 3px 3px;
+       cursor:pointer;
+       background-image:url('./images/tag_blue.png');
+       background-repeat:no-repeat;
+       background-position:3px center;
+       background-color:#ffffff;
+}
 .linktag:hover { border-color: #555573; color:#000; }
 .linktag a { color:#777; text-decoration:none; }
 .linkshort { font-size:8pt; color:#888; }
@@ -72,14 +233,20 @@ border-bottom:1px solid #aaa; border-right:1px solid #aaa; border-radius: 0.3em;
 #newversion { background-color: #FFFFA0; color:#000; position:absolute; top:0;right:0; padding:2 7 2 7;  font-size:9pt;} 
 #cloudtag  { padding-left:10%; padding-right:10%; }
 #cloudtag a { color:black; text-decoration:none; }
-#installform td  { font-size: 10pt; padding:10 5 10 5; }
-#configform td  { color:#ccc; font-size: 10pt; padding:10 5 10 5; }
+#installform td  { font-size: 10pt; padding:10 5 10 5; clear:left; }
+#changepasswordform { color:#ccc; padding:10 5 10 5; clear:left; }
+#changetag { color:#ccc; padding:10 5 10 5; clear:left; }
+#configform td  { color:#ccc; font-size: 10pt; padding:10 5 10 5;  }
+#configform  { color:#ccc; padding:10 5 10 5; clear:left; }
 .thumbnail { float:right;  margin-left: 10px; }
 /* If you want thumbnails on the left:
 .thumbnail { float:left;  margin-right: 10px;   }
 .linkcontainer { position: static; margin-left:130px; }
 */
 
+
+
+
 /* --- Picture wall CSS --- */
 #picwall_container { color:#fff; background-color:#000; }
 .picwall_pictureframe { z-index:5; position:relative; display:table-cell; vertical-align:middle;width:90px; height:90px; overflow:hidden; text-align:center;  float:left; }
@@ -98,7 +265,7 @@ border-bottom:1px solid #aaa; border-right:1px solid #aaa; border-radius: 0.3em;
     text-align: left;
   background-color: transparent;
   background-color: rgba(0, 0, 0, 0.4);  /* FF3+, Saf3+, Opera 10.10+, Chrome, IE9 */
-            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#66000000,endColorstr=#66000000); /* IE6\96IE9 */
+            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#66000000,endColorstr=#66000000); /* IE6Â\96IE9 */
 text-shadow:2px 2px 1px #000000;    
 }
 
@@ -106,6 +273,10 @@ text-shadow:2px 2px 1px #000000;
 .ui-autocomplete { background-color:#fff; padding-left:5px;}
 .ui-state-hover { background-color: #604dff; color:#fff; }
 
+#linklist li.publicLinkHightLight{
+       background: #ffffff;
+}
+
 @media print {
 html {border:none;background:#fff!important;color:#000!important;}
 body {font-size:12pt;width:auto!important;margin:auto!important;}
@@ -119,4 +290,6 @@ a {color:#000!important;text-decoration:none!important;}
 .linkdescription { font-size:10pt;}
 .linktag { border: 1px solid black; font-style:italic;  font-size:8pt;}
 
+
+
 }
\ No newline at end of file