]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Version 0.0.37 beta
authorSeb Sauvage <sebsauvage@sebsauvage.net>
Wed, 1 Feb 2012 22:07:32 +0000 (23:07 +0100)
committerEmilien Klein <emilien@klein.st>
Wed, 1 Feb 2012 22:07:32 +0000 (23:07 +0100)
- Added: Basic CSS for mobiles, which makes Shaarli much more usable on mobile devices.
- Added: Picture wall no more instantly kills your browser. Now it uses lazy image loading [0]: The picture are loaded only as you scroll the page. This will reduce browser memory usage (especially on mobile devices) and will reduce server load. If you have javascript disabled, the page will still work as before (all images loaded at once).
- Added: RSS feed for the “Daily” page. 1 RSS entry per day, with all links of that day. RSS feed provides the last 7 days (only non-empty days are returned).
- Added: In link list, added an icon to see only private links. Click to toggle (only private / all).

[0] http://www.appelsiini.net/projects/lazyload

12 files changed:
images/feed-icon-14x14.png [new file with mode: 0644]
images/private_16x16.png [new file with mode: 0644]
inc/jquery.lazyload.min.js [new file with mode: 0644]
inc/shaarli.css
index.php
tpl/daily.html
tpl/dailyrss.html [new file with mode: 0644]
tpl/includes.html
tpl/linklist.html
tpl/linklist.paging.html
tpl/page.header.html
tpl/picwall.html

diff --git a/images/feed-icon-14x14.png b/images/feed-icon-14x14.png
new file mode 100644 (file)
index 0000000..b3c949d
Binary files /dev/null and b/images/feed-icon-14x14.png differ
diff --git a/images/private_16x16.png b/images/private_16x16.png
new file mode 100644 (file)
index 0000000..d58c482
Binary files /dev/null and b/images/private_16x16.png differ
diff --git a/inc/jquery.lazyload.min.js b/inc/jquery.lazyload.min.js
new file mode 100644 (file)
index 0000000..2364d8d
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * Lazy Load - jQuery plugin for lazy loading images
+ *
+ * Copyright (c) 2007-2012 Mika Tuupola
+ *
+ * Licensed under the MIT license:
+ *   http://www.opensource.org/licenses/mit-license.php
+ *
+ * Project home:
+ *   http://www.appelsiini.net/projects/lazyload
+ *
+ * Version:  1.7.0
+ *
+ */
+(function(a,b){$window=a(b),a.fn.lazyload=function(c){var d={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!0,appear:null,load:null};c&&(undefined!==c.failurelimit&&(c.failure_limit=c.failurelimit,delete c.failurelimit),undefined!==c.effectspeed&&(c.effect_speed=c.effectspeed,delete c.effectspeed),a.extend(d,c));var e=this;return 0==d.event.indexOf("scroll")&&a(d.container).bind(d.event,function(b){var c=0;e.each(function(){$this=a(this);if(d.skip_invisible&&!$this.is(":visible"))return;if(!a.abovethetop(this,d)&&!a.leftofbegin(this,d))if(!a.belowthefold(this,d)&&!a.rightoffold(this,d))$this.trigger("appear");else if(++c>d.failure_limit)return!1})}),this.each(function(){var b=this,c=a(b);b.loaded=!1,c.one("appear",function(){if(!this.loaded){if(d.appear){var f=e.length;d.appear.call(b,f,d)}a("<img />").bind("load",function(){c.hide().attr("src",c.data(d.data_attribute))[d.effect](d.effect_speed),b.loaded=!0;var f=a.grep(e,function(a){return!a.loaded});e=a(f);if(d.load){var g=e.length;d.load.call(b,g,d)}}).attr("src",c.data(d.data_attribute))}}),0!=d.event.indexOf("scroll")&&c.bind(d.event,function(a){b.loaded||c.trigger("appear")})}),$window.bind("resize",function(b){a(d.container).trigger(d.event)}),a(d.container).trigger(d.event),this},a.belowthefold=function(c,d){if(d.container===undefined||d.container===b)var e=$window.height()+$window.scrollTop();else var e=a(d.container).offset().top+a(d.container).height();return e<=a(c).offset().top-d.threshold},a.rightoffold=function(c,d){if(d.container===undefined||d.container===b)var e=$window.width()+$window.scrollLeft();else var e=a(d.container).offset().left+a(d.container).width();return e<=a(c).offset().left-d.threshold},a.abovethetop=function(c,d){if(d.container===undefined||d.container===b)var e=$window.scrollTop();else var e=a(d.container).offset().top;return e>=a(c).offset().top+d.threshold+a(c).height()},a.leftofbegin=function(c,d){if(d.container===undefined||d.container===b)var e=$window.scrollLeft();else var e=a(d.container).offset().left;return e>=a(c).offset().left+d.threshold+a(c).width()},a.inviewport=function(b,c){return!a.rightofscreen(b,c)&&!a.leftofscreen(b,c)&&!a.belowthefold(b,c)&&!a.abovethetop(b,c)},a.extend(a.expr[":"],{"below-the-fold":function(c){return a.belowthefold(c,{threshold:0,container:b})},"above-the-top":function(c){return!a.belowthefold(c,{threshold:0,container:b})},"right-of-screen":function(c){return a.rightoffold(c,{threshold:0,container:b})},"left-of-screen":function(c){return!a.rightoffold(c,{threshold:0,container:b})},"in-viewport":function(c){return!a.inviewport(c,{threshold:0,container:b})},"above-the-fold":function(c){return!a.belowthefold(c,{threshold:0,container:b})},"right-of-fold":function(c){return a.rightoffold(c,{threshold:0,container:b})},"left-of-fold":function(c){return!a.rightoffold(c,{threshold:0,container:b})}})})(jQuery,window)
index a949666e3ffe67afd9098c69f52268e08c45d62f..5b4b88b6bbf848f6393d12da65688263f5897b7c 100644 (file)
@@ -184,6 +184,12 @@ cursor:pointer;
 .paging a:visited { color:#ccc;  }
 .paging a:hover {  color:#FFFFC9;  }
 .paging a:active { color:#fff;  }
+#paging_privatelinks { float:left; }
+#paging_linksperpage { float:right; padding-right:5px; }
+#paging_current { display:inline; color:#fff; padding:0 20 0 20; }
+#paging_older { margin-right:15px; }
+#paging_newer { margin-left:15px; }
+
 #headerform { color:#ffffff; padding:5px 5px 5px 5px; clear: both;}
 #toolsdiv { color:#ffffff; padding:5px 5px 5px 5px; clear:left; }
 #uploaddiv { color:#ffffff; padding:5px 5px 5px 5px; clear:left; }
@@ -325,6 +331,11 @@ div.daily
     position:relative;
     border-bottom: 2px solid black;
 }
+
+#daily_col1 { float:left;position:relative; width:33%; padding-left:1%; }
+#daily_col2 { float:left;position:relative; width:33%; }
+#daily_col3 { float:left;position:relative; width:33%;}
+
 div.dailyAbout
 { 
     float:left;
@@ -383,6 +394,11 @@ div.dailyEntryDescription
        clear:both;
 }
 
+/* For lazy images loading in picture wall.
+   using http://www.appelsiini.net/projects/lazyload 
+ */
+.lazyimage { display:none; }
+
 @media print {
 html {border:none;background:#fff!important;color:#000!important;}
 body {font-size:12pt;width:auto!important;margin:auto!important;}
@@ -397,3 +413,36 @@ a {color:#000!important;text-decoration:none!important;}
 .linktag { border: 1px solid black; font-style:italic;  font-size:8pt;}
 
 }
+
+
+@media handheld, only screen and (max-width: 480px), only screen and (max-device-width: 854px)
+{
+/* A few fixes for mobile devices (far from perfect). */
+.nomobile  { display:none; }
+#logo { display:none; }
+#pageheader a
+{
+       padding:5px;
+       border-radius: 5px 5px 5px 5px;
+       margin:3px;
+}
+.searchform,.tagfilter  { display:block !important; margin:0px !important; padding:0px !important; width:100% !important; }
+.searchform input,.tagfilter input  { margin:0px !important; padding:0px !important; display:inline !important; }
+.tagfilter input.bigbutton,.searchform input.bigbutton,.addform input.bigbutton{  width:30%; font-size:smaller;}
+#searchform_value { width:70% !important; }
+#tagfilter_value { width:70% !important; }
+div.qrcode { position:relative; float:left; top:-10px; left:0px; }
+#paging_privatelinks { float;none; }
+#paging_linksperpage { float:none; margin-bottom:10px; font-size:smaller;}
+#paging_older,#paging_newer,#paging_linksperpage a { border: 1px solid black; padding:3px 5px 3px 5px; background-color:#666; color:#fff; border-radius: 5px 5px 5px 5px;}
+.thumbnail { float:none; height:auto; margin: 0px; text-align:center;}
+#cloudtag  { padding:0px; }
+div.dailyAbout {  float:none; position:relative; width:100%; clear:both; padding:0px; top:0px; left:0px; }
+#daily_col1,#daily_col2,#daily_col3 { float:none; width:100%; padding:0px;}
+div.dailyTitle  { font-size: 18pt; margin-top:5px; padding:0px;}
+div.dailyDate  {  font-size: 11pt;padding:0px; display:block; }
+div.dailyEntryTitle { font-size:16pt; font-weight:bold;}
+div.dailyEntryDescription { font-size:10pt; }
+
+} 
+
index 9dd6483eee9750f81e653cdc4c6edad4be18b487..936d6129b16c4f1f6e01d3ee1207c00b238a82c9 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,5 +1,5 @@
 <?php
-// Shaarli 0.0.36 beta - Shaare your links...
+// Shaarli 0.0.37 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
@@ -58,7 +58,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.36 beta');
+define('shaarli_version','0.0.37 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'])
@@ -153,8 +153,8 @@ function text2clickable($url)
 // even in the absence of <pre>  (This is used in description to keep text formatting)
 function keepMultipleSpaces($text)
 {
-       return str_replace('  ',' &nbsp;',$text);
-       
+    return str_replace('  ',' &nbsp;',$text);
+    
 }
 // ------------------------------------------------------------------------------------------
 // Sniff browser language to display dates in the right format automatically.
@@ -849,6 +849,75 @@ function showATOM()
     exit;
 }
 
+// ------------------------------------------------------------------------------------------
+// Daily RSS feed: 1 RSS entry per day giving all the links on that day.
+// Gives the last 7 days (which have links).
+// This RSS feed cannot be filtered.
+function showDailyRSS()
+{
+    global $LINKSDB;
+    
+    /* Some Shaarlies may have very few links, so we need to look
+       back in time (rsort()) until we have enough days ($nb_of_days).
+    */
+    $linkdates=array(); foreach($LINKSDB as $linkdate=>$value) { $linkdates[]=$linkdate; } 
+    rsort($linkdates);
+    $nb_of_days=7; // We take 7 days.
+    $today=Date('Ymd');
+    $days=array();
+    foreach($linkdates as $linkdate)
+    {
+        $day=substr($linkdate,0,8); // Extract day (without time)
+        if (strcmp($day,$today)<0)
+        {
+            if (empty($days[$day])) $days[$day]=array();
+            $days[$day][]=$linkdate;
+        }
+        if (count($days)>$nb_of_days) break; // Have we collected enough days ?
+    }
+    
+    // Build the RSS feed.
+    header('Content-Type: application/rss+xml; charset=utf-8');
+    $pageaddr=htmlspecialchars(indexUrl());
+    echo '<?xml version="1.0" encoding="UTF-8"?><rss version="2.0">';
+    echo '<channel><title>Daily - '.htmlspecialchars($GLOBALS['title']).'</title><link>'.$pageaddr.'</link>';
+    echo '<description>Daily shared links</description><language>en-en</language><copyright>'.$pageaddr.'</copyright>'."\n";
+    
+    foreach($days as $day=>$linkdates) // For each day.
+    {
+        $daydate = utf8_encode(strftime('%A %d, %B %Y',linkdate2timestamp($day.'_000000'))); // Full text date
+        $rfc822date = linkdate2rfc822($day.'_000000');
+        $absurl=htmlspecialchars(indexUrl().'?do=daily&day='.$day);  // Absolute URL of the corresponding "Daily" page.
+        echo '<item><title>'.htmlspecialchars($GLOBALS['title'].' - '.$daydate).'</title><guid>'.$absurl.'</guid><link>'.$absurl.'</link>';
+        echo '<pubDate>'.htmlspecialchars($rfc822date)."</pubDate>";
+        
+        // Build the HTML body of this RSS entry.
+        $html='';
+        $href='';
+        $links=array();
+        // We pre-format some fields for proper output.
+        foreach($linkdates as $linkdate)
+        {
+            $l = $LINKSDB[$linkdate];
+            $l['formatedDescription']=nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($l['description']))));
+            $l['thumbnail'] = thumbnail($l['url']);  
+            $l['localdate']=linkdate2locale($l['linkdate']);            
+            if (startsWith($l['url'],'?')) $l['url']=indexUrl().$l['url'];  // make permalink URL absolute
+            $links[$linkdate]=$l;    
+        }
+        // Then build the HTML for this day:
+        $tpl = new RainTPL;    
+        $tpl->assign('links',$links);
+        $html = $tpl->draw('dailyrss',$return_string=true);
+        echo "\n";
+        echo '<description><![CDATA['.$html.']]></description>'."\n</item>\n\n";
+
+    }    
+    echo '</channel></rss>';
+    exit;
+}
+
+
 // ------------------------------------------------------------------------------------------
 // Render HTML page (according to URL parameters and user rights)
 function renderPage()
@@ -861,7 +930,7 @@ function renderPage()
         if ($GLOBALS['config']['OPEN_SHAARLI']) { header('Location: ?'); exit; }  // No need to login for open Shaarli
         $token=''; if (ban_canLogin()) $token=getToken(); // Do not waste token generation if not useful.
         $PAGE = new pageBuilder;
-           $PAGE->assign('token',$token);
+        $PAGE->assign('token',$token);
         $PAGE->assign('returnurl',(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER']:''));
         $PAGE->renderPage('loginform');
         exit;
@@ -890,17 +959,17 @@ function renderPage()
         foreach($links as $link)
         {
             $permalink='?'.htmlspecialchars(smallhash($link['linkdate']),ENT_QUOTES);
-            $thumb=thumbnail($link['url'],$permalink);
+            $thumb=lazyThumbnail($link['url'],$permalink);
             if ($thumb!='') // Only output links which have a thumbnail.
             {
-                   $link['thumbnail']=$thumb; // Thumbnail HTML code.
-                   $link['permalink']=$permalink;
-                   $linksToDisplay[]=$link; // Add to array.
+                $link['thumbnail']=$thumb; // Thumbnail HTML code.
+                $link['permalink']=$permalink;
+                $linksToDisplay[]=$link; // Add to array.
             }
         }
         $PAGE = new pageBuilder;
-           $PAGE->assign('linksToDisplay',$linksToDisplay);
-           $PAGE->renderPage('picwall');
+        $PAGE->assign('linksToDisplay',$linksToDisplay);
+        $PAGE->renderPage('picwall');
         exit;
     }
 
@@ -915,12 +984,12 @@ function renderPage()
         $tagList=array();
         foreach($tags as $key=>$value)
         {
-               $tagList[$key] = array('count'=>$value,'size'=>max(40*$value/$maxcount,8));
+            $tagList[$key] = array('count'=>$value,'size'=>max(40*$value/$maxcount,8));
         }
         $PAGE = new pageBuilder;
-           $PAGE->assign('tags',$tagList);
-           $PAGE->renderPage('tagcloud');
-        exit;  
+        $PAGE->assign('tags',$tagList);
+        $PAGE->renderPage('tagcloud');
+        exit;    
     }
 
     // -------- User clicks on a tag in a link: The tag is added to the list of searched tags (searchtags=...)
@@ -960,6 +1029,21 @@ function renderPage()
         exit;
     }
     
+    // -------- User wants to see only private links (toggle)
+    if (isset($_GET['privateonly']))
+    {
+        if (empty($_SESSION['privateonly']))
+        {
+            $_SESSION['privateonly']=1; // See only private links
+        }
+        else
+        {
+            unset($_SESSION['privateonly']); // See all links
+        }
+        header('Location: '.(empty($_SERVER['HTTP_REFERER'])?'?':$_SERVER['HTTP_REFERER']));
+        exit;
+    }
+    
     // --------- Daily (all links form a specific day) ----------------------
     if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=daily'))
     { 
@@ -1000,7 +1084,7 @@ function renderPage()
             $fill[$index]+=$length;
         }
         $PAGE = new pageBuilder;
-           $PAGE->assign('linksToDisplay',$linksToDisplay);
+        $PAGE->assign('linksToDisplay',$linksToDisplay);
         $PAGE->assign('col1',$columns[0]);
         $PAGE->assign('col2',$columns[1]);
         $PAGE->assign('col3',$columns[2]);
@@ -1021,10 +1105,10 @@ function renderPage()
             header('Location: ?do=login&post='.urlencode($_GET['post']).(!empty($_GET['title'])?'&title='.urlencode($_GET['title']):'').(!empty($_GET['source'])?'&source='.urlencode($_GET['source']):'')); // Redirect to login page, then back to post link.
             exit;
         }
-           $PAGE = new pageBuilder;
-           buildLinkList($PAGE); // Compute list of links to display
-           $PAGE->renderPage('linklist');
-           exit; // Never remove this one ! All operations below are reserved for logged in user.
+        $PAGE = new pageBuilder;
+        buildLinkList($PAGE); // Compute list of links to display
+        $PAGE->renderPage('linklist');
+        exit; // Never remove this one ! All operations below are reserved for logged in user.
     }
 
     // -------- All other functions are reserved for the registered user:
@@ -1032,9 +1116,9 @@ function renderPage()
     // -------- Display the Tools menu if requested (import/export/bookmarklet...)
     if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=tools'))
     {
-           $PAGE = new pageBuilder;
-           $PAGE->assign('pageabsaddr',indexUrl());
-           $PAGE->renderPage('tools');
+        $PAGE = new pageBuilder;
+        $PAGE->assign('pageabsaddr',indexUrl());
+        $PAGE->renderPage('tools');
         exit;
     }
 
@@ -1058,10 +1142,10 @@ function renderPage()
         }
         else // show the change password form.
         {
-                   $PAGE = new pageBuilder;
-                   $PAGE->assign('token',getToken());
-                   $PAGE->renderPage('changepassword');
-               exit;
+            $PAGE = new pageBuilder;
+            $PAGE->assign('token',getToken());
+            $PAGE->renderPage('changepassword');
+            exit;
         }
     }
 
@@ -1084,15 +1168,15 @@ function renderPage()
         }
         else // Show the configuration form.
         {
-               $PAGE = new pageBuilder;
+            $PAGE = new pageBuilder;
             $PAGE->assign('token',getToken());
             $PAGE->assign('title',htmlspecialchars( empty($GLOBALS['title']) ? '' : $GLOBALS['title'] , ENT_QUOTES));
             $PAGE->assign('redirector',htmlspecialchars( empty($GLOBALS['redirector']) ? '' : $GLOBALS['redirector'] , ENT_QUOTES));
             list($timezone_form,$timezone_js) = templateTZform($GLOBALS['timezone']);
             $PAGE->assign('timezone_form',$timezone_form); // FIXME: put entire tz form generation in template ?
             $PAGE->assign('timezone_js',$timezone_js);
-                   $PAGE->renderPage('configure');
-               exit;
+            $PAGE->renderPage('configure');
+            exit;
         }
     }
 
@@ -1101,10 +1185,10 @@ function renderPage()
     {
         if (empty($_POST['fromtag']))
         {
-               $PAGE = new pageBuilder;
-                   $PAGE->assign('token',getToken());
-                   $PAGE->renderPage('changetag');
-               exit;
+            $PAGE = new pageBuilder;
+            $PAGE->assign('token',getToken());
+            $PAGE->renderPage('changetag');
+            exit;
         }
         if (!tokenOk($_POST['token'])) die('Wrong token.');
 
@@ -1148,8 +1232,8 @@ function renderPage()
     // -------- User wants to add a link without using the bookmarklet: show form.
     if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=addlink'))
     {
-           $PAGE = new pageBuilder;
-           $PAGE->renderPage('addlink');
+        $PAGE = new pageBuilder;
+        $PAGE->renderPage('addlink');
         exit;
     }
 
@@ -1207,12 +1291,12 @@ function renderPage()
     {
         $link = $LINKSDB[$_GET['edit_link']];  // Read database
         if (!$link) { header('Location: ?'); exit; } // Link not found in database.
-           $PAGE = new pageBuilder;
-           $PAGE->assign('link',$link);
-           $PAGE->assign('link_is_new',false);
-           $PAGE->assign('token',getToken()); // XSRF protection.
-           $PAGE->assign('http_referer',(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''));
-           $PAGE->renderPage('editlink');
+        $PAGE = new pageBuilder;
+        $PAGE->assign('link',$link);
+        $PAGE->assign('link_is_new',false);
+        $PAGE->assign('token',getToken()); // XSRF protection.
+        $PAGE->assign('http_referer',(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''));
+        $PAGE->renderPage('editlink');
         exit;
     }
 
@@ -1246,12 +1330,12 @@ function renderPage()
             $link = array('linkdate'=>$linkdate,'title'=>$title,'url'=>$url,'description'=>$description,'tags'=>$tags,'private'=>0);
         }
 
-           $PAGE = new pageBuilder;
-           $PAGE->assign('link',$link);
-           $PAGE->assign('link_is_new',$link_is_new);
-           $PAGE->assign('token',getToken()); // XSRF protection.
-           $PAGE->assign('http_referer',(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''));
-           $PAGE->renderPage('editlink');
+        $PAGE = new pageBuilder;
+        $PAGE->assign('link',$link);
+        $PAGE->assign('link_is_new',$link_is_new);
+        $PAGE->assign('token',getToken()); // XSRF protection.
+        $PAGE->assign('http_referer',(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''));
+        $PAGE->renderPage('editlink');
         exit;
     }
 
@@ -1260,9 +1344,9 @@ function renderPage()
     {
         if (empty($_GET['what']))
         {
-                   $PAGE = new pageBuilder;
-                   $PAGE->renderPage('export');
-               exit;
+            $PAGE = new pageBuilder;
+            $PAGE->renderPage('export');
+            exit;
         }
         $exportWhat=$_GET['what'];
         if (!array_intersect(array('all','public','private'),array($exportWhat))) die('What are you trying to export ???');
@@ -1313,10 +1397,10 @@ HTML;
     // -------- Show upload/import dialog:
     if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=import'))
     {
-           $PAGE = new pageBuilder;
+        $PAGE = new pageBuilder;
         $PAGE->assign('token',getToken());
         $PAGE->assign('maxfilesize',getMaxFileSize());
-           $PAGE->renderPage('import');
+        $PAGE->renderPage('import');
         exit;
     }
 
@@ -1430,14 +1514,24 @@ function buildLinkList($PAGE)
         $search_crits=explode(' ',trim($_GET['searchtags']));
         $search_type='tags';
     }
-    elseif (isset($_SERVER["QUERY_STRING"]) && preg_match('/[a-zA-Z0-9-_@]{6}(&.+?)?/',$_SERVER["QUERY_STRING"])) // Detect smallHashes in URL
+    elseif (isset($_SERVER['QUERY_STRING']) && preg_match('/[a-zA-Z0-9-_@]{6}(&.+?)?/',$_SERVER['QUERY_STRING'])) // Detect smallHashes in URL
     {
         $linksToDisplay = $LINKSDB->filterSmallHash(substr(trim($_SERVER["QUERY_STRING"], '/'),0,6));
         $search_type='permalink';
     }
     else
         $linksToDisplay = $LINKSDB;  // otherwise, display without filtering.
-        
+    
+    // Option: Show only private links
+    if (!empty($_SESSION['privateonly']))
+    {
+        $tmp = array();
+        foreach($linksToDisplay as $linkdate=>$link)
+        {
+            if ($link['private']!=0) $tmp[$linkdate]=$link;
+        }
+        $linksToDisplay=$tmp;
+    }
 
     // ---- Handle paging.
     /* Can someone explain to me why you get the following error when using array_keys() on an object which implements the interface ArrayAccess ???
@@ -1494,16 +1588,18 @@ function buildLinkList($PAGE)
     return;
 }
 
-// Returns the HTML code to display a thumbnail for a link
+// Compute the thumbnail for a link.
+// 
 // with a link to the original URL.
 // Understands various services (youtube.com...)
 // Input: $url = url for which the thumbnail must be found.
 //        $href = if provided, this URL will be followed instead of $url
-// Returns '' if no thumbnail available.
-function thumbnail($url,$href=false)
+// Returns an associative array with thumbnail attributes (src,href,width,height,style,alt)
+// Some of them may be missing.
+// Return an empty array if no thumbnail available.
+function computeThumbnail($url,$href=false)
 {
-    if (!$GLOBALS['config']['ENABLE_THUMBNAILS']) return '';
-
+    if (!$GLOBALS['config']['ENABLE_THUMBNAILS']) return array();
     if ($href==false) $href=$url;
 
     // For most hosts, the URL of the thumbnail can be easily deduced from the URL of the link.
@@ -1513,38 +1609,47 @@ function thumbnail($url,$href=false)
     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($href).'"><img src="http://img.youtube.com/vi/'.htmlspecialchars($params['v']).'/default.jpg" width="120" height="90" alt="YouTube thumbnail"></a>';
+        if (!empty($params['v'])) return array('src'=>'http://img.youtube.com/vi/'.$params['v'].'/default.jpg',
+                                               'href'=>$href,'width'=>'120','height'=>'90','alt'=>'YouTube thumbnail');
     }
     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"  alt="YouTube thumbnail"></a>';
+        return array('src'=>'http://img.youtube.com/vi'.$path.'/default.jpg',
+                     'href'=>$href,'width'=>'120','height'=>'90','alt'=>'YouTube thumbnail');        
     }
     if ($domain=='pix.toile-libre.org') // pix.toile-libre.org image hosting
     {
         parse_str(parse_url($url,PHP_URL_QUERY), $params); // Extract image filename.
-        if (!empty($params) && !empty($params['img'])) return '<a href="'.htmlspecialchars($href).'"><img src="http://pix.toile-libre.org/upload/thumb/'.urlencode($params['img']).'" style:"max-width:120px; max-height:150px" alt="pix.toile-libre.org thumbnail"></a>';
+        if (!empty($params) && !empty($params['img'])) return array('src'=>'http://pix.toile-libre.org/upload/thumb/'.urlencode($params['img']),
+                                                                    'href'=>$href,'style'=>'max-width:120px; max-height:150px','alt'=>'pix.toile-libre.org thumbnail');    
     }    
     
     if ($domain=='imgur.com')
     {
         $path = parse_url($url,PHP_URL_PATH);
-        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" alt="imgur.com thumbnail"></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" alt="imgur.com thumbnail"></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" alt="imgur.com thumbnail"></a>';
+        if (startsWith($path,'/a/')) return array(); // Thumbnails for albums are not available.
+        if (startsWith($path,'/r/')) return array('src'=>'http://i.imgur.com/'.basename($path).'s.jpg',
+                                                  'href'=>$href,'width'=>'90','height'=>'90','alt'=>'imgur.com thumbnail');
+        if (startsWith($path,'/gallery/')) return array('src'=>'http://i.imgur.com'.substr($path,8).'s.jpg',
+                                                        'href'=>$href,'width'=>'90','height'=>'90','alt'=>'imgur.com thumbnail');
+
+        if (substr_count($path,'/')==1) return array('src'=>'http://i.imgur.com/'.substr($path,1).'s.jpg',
+                                                     'href'=>$href,'width'=>'90','height'=>'90','alt'=>'imgur.com thumbnail');
     }
     if ($domain=='i.imgur.com')
     {
         $pi = pathinfo(parse_url($url,PHP_URL_PATH));
-        if (!empty($pi['filename'])) return '<a href="'.htmlspecialchars($href).'"><img src="http://i.imgur.com/'.htmlspecialchars($pi['filename']).'s.jpg" width="90" height="90" alt="imgur.com thumbnail"></a>';
+        if (!empty($pi['filename'])) return array('src'=>'http://i.imgur.com/'.$pi['filename'].'s.jpg',
+                                                  'href'=>$href,'width'=>'90','height'=>'90','alt'=>'imgur.com thumbnail');
     }
     if ($domain=='dailymotion.com' || $domain=='www.dailymotion.com')
     {
         if (strpos($url,'dailymotion.com/video/')!==false)
         {
             $thumburl=str_replace('dailymotion.com/video/','dailymotion.com/thumbnail/video/',$url);
-            return '<a href="'.htmlspecialchars($href).'"><img src="'.htmlspecialchars($thumburl).'" width="120" style="height:auto;" alt="DailyMotion thumbnail"></a>';
+            return array('src'=>$thumburl,
+                         'href'=>$href,'width'=>'120','style'=>'height:auto;','alt'=>'DailyMotion thumbnail');
         }
     }
     if (endsWith($domain,'.imageshack.us'))
@@ -1553,7 +1658,8 @@ function thumbnail($url,$href=false)
         if ($ext=='jpg' || $ext=='jpeg' || $ext=='png' || $ext=='gif')
         {
             $thumburl = substr($url,0,strlen($url)-strlen($ext)).'th.'.$ext;
-            return '<a href="'.htmlspecialchars($href).'"><img src="'.htmlspecialchars($thumburl).'" width="120" style="height:auto;" alt="imageshack.us thumbnail"></a>';
+            return array('src'=>$thumburl,
+                         'href'=>$href,'width'=>'120','style'=>'height:auto;','alt'=>'imageshack.us thumbnail');
         }
     }
 
@@ -1561,7 +1667,7 @@ function thumbnail($url,$href=false)
     // So we deport the thumbnail generation in order not to slow down page generation
     // (and we also cache the thumbnail)
 
-    if (!$GLOBALS['config']['ENABLE_LOCALCACHE']) return ''; // If local cache is disabled, no thumbnails for services which require the use a local cache.
+    if (!$GLOBALS['config']['ENABLE_LOCALCACHE']) return array(); // If local cache is disabled, no thumbnails for services which require the use a local cache.
 
     if ($domain=='flickr.com' || endsWith($domain,'.flickr.com')
         || $domain=='vimeo.com'
@@ -1572,20 +1678,21 @@ function thumbnail($url,$href=false)
         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.
+            if (!preg_match('!/\d+.+?!',$path)) return array(); // This is not a single video URL.
         }
         if ($domain=='xkcd.com' || endsWith($domain,'.xkcd.com'))
         {   // Make sure this url points to a single comic (/xxx... where xxx is numeric)
             $path = parse_url($url,PHP_URL_PATH);
-            if (!preg_match('!/\d+.+?!',$path)) return '';
+            if (!preg_match('!/\d+.+?!',$path)) return array();
         }
         if ($domain=='ted.com' || endsWith($domain,'.ted.com'))
         {   // Make sure this TED url points to a video (/talks/...)
             $path = parse_url($url,PHP_URL_PATH);
-            if ("/talks/" !== substr($path,0,7)) return ''; // This is not a single video URL.
+            if ("/talks/" !== substr($path,0,7)) return array(); // 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($href).'"><img src="?do=genthumbnail&hmac='.htmlspecialchars($sign).'&url='.urlencode($url).'" width="120" style="height:auto;" alt="thumbnail"></a>';
+        return array('src'=>indexUrl().'?do=genthumbnail&hmac='.htmlspecialchars($sign).'&url='.urlencode($url),
+                     'href'=>$href,'width'=>'120','style'=>'height:auto;','alt'=>'thumbnail');
     }
 
     // For all other, we try to make a thumbnail of links ending with .jpg/jpeg/png/gif
@@ -1595,12 +1702,68 @@ function thumbnail($url,$href=false)
     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($href).'"><img src="?do=genthumbnail&hmac='.htmlspecialchars($sign).'&url='.urlencode($url).'" width="120" style="height:auto;"></a>';
+        return array('src'=>indexUrl().'?do=genthumbnail&hmac='.htmlspecialchars($sign).'&url='.urlencode($url),
+                     'href'=>$href,'width'=>'120','style'=>'height:auto;','alt'=>'thumbnail');        
     }
-    return ''; // No thumbnail.
+    return array(); // No thumbnail.
+
+}
+
+
+// Returns the HTML code to display a thumbnail for a link
+// with a link to the original URL.
+// Understands various services (youtube.com...)
+// Input: $url = url for which the thumbnail must be found.
+//        $href = if provided, this URL will be followed instead of $url
+// Returns '' if no thumbnail available.
+function thumbnail($url,$href=false)
+{
+    $t = computeThumbnail($url,$href);
+    if (count($t)==0) return ''; // Empty array = no thumbnail for this URL.
+    
+    $html='<a href="'.htmlspecialchars($t['href']).'"><img src="'.htmlspecialchars($t['src']).'"';
+    if (!empty($t['width']))  $html.=' width="'.htmlspecialchars($t['width']).'"';
+    if (!empty($t['height'])) $html.=' height="'.htmlspecialchars($t['height']).'"';
+    if (!empty($t['style']))  $html.=' style="'.htmlspecialchars($t['style']).'"';
+    if (!empty($t['alt']))    $html.=' alt="'.htmlspecialchars($t['alt']).'"';
+    $html.='></a>';
+    return $html;
+}
+
 
+// Returns the HTML code to display a thumbnail for a link
+// for the picture wall (using lazy image loading)
+// Understands various services (youtube.com...)
+// Input: $url = url for which the thumbnail must be found.
+//        $href = if provided, this URL will be followed instead of $url
+// Returns '' if no thumbnail available.
+function lazyThumbnail($url,$href=false)
+{
+    $t = computeThumbnail($url,$href); 
+    if (count($t)==0) return ''; // Empty array = no thumbnail for this URL.
+
+    $html='<a href="'.htmlspecialchars($t['href']).'">';
+    
+    // Lazy image (only loaded by javascript when in the viewport).
+    $html.='<img class="lazyimage" src="#" data-original="'.htmlspecialchars($t['src']).'"';
+    if (!empty($t['width']))  $html.=' width="'.htmlspecialchars($t['width']).'"';
+    if (!empty($t['height'])) $html.=' height="'.htmlspecialchars($t['height']).'"';
+    if (!empty($t['style']))  $html.=' style="'.htmlspecialchars($t['style']).'"';
+    if (!empty($t['alt']))    $html.=' alt="'.htmlspecialchars($t['alt']).'"';
+    $html.='>';
+    
+    // No-javascript fallback:
+    $html.='<noscript><img src="'.htmlspecialchars($t['src']).'"';
+    if (!empty($t['width']))  $html.=' width="'.htmlspecialchars($t['width']).'"';
+    if (!empty($t['height'])) $html.=' height="'.htmlspecialchars($t['height']).'"';
+    if (!empty($t['style']))  $html.=' style="'.htmlspecialchars($t['style']).'"';
+    if (!empty($t['alt']))    $html.=' alt="'.htmlspecialchars($t['alt']).'"';
+    $html.='></noscript></a>';
+    
+    return $html;
 }
 
+
 // -----------------------------------------------------------------------------------------------
 // Installation
 // This function should NEVER be called if the file data/config.php exists.
@@ -1861,11 +2024,11 @@ function genThumbnail()
         // The thumbnail for TED talks is located in the <link rel="image_src" [...]> tag on that page
         // http://www.ted.com/talks/mikko_hypponen_fighting_viruses_defending_the_net.html
         // <link rel="image_src" href="http://images.ted.com/images/ted/28bced335898ba54d4441809c5b1112ffaf36781_389x292.jpg" />
-        list($httpstatus,$headers,$data) = getHTTP($url,5);
+        list($httpstatus,$headers,$data) = getHTTP($url,5); 
         if (strpos($httpstatus,'200 OK')!==false)
         {
             // Extract the link to the thumbnail
-            preg_match('!link rel="image_src" href="(http://images.ted.com/images/ted/.+_\d+x\d+\.jpg)[^s]!',$data,$matches);
+            preg_match('!link rel="image_src" href="(http://images.ted.com/images/ted/.+_\d+x\d+\.jpg)"!',$data,$matches);
             if (!empty($matches[1]))
             {   // Let's download the image.
                 $imageurl=$matches[1];
@@ -1982,6 +2145,7 @@ if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=g
 $LINKSDB=new linkdb(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);  // Read links from database (and filter private links if used it not logged in).
 if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'ws=')) { processWS(); exit; } // Webservices (for jQuery/jQueryUI)
 if (!isset($_SESSION['LINKS_PER_PAGE'])) $_SESSION['LINKS_PER_PAGE']=$GLOBALS['config']['LINKS_PER_PAGE'];
+if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=dailyrss')) { showDailyRSS(); exit; }
 if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=rss')) { showRSS(); exit; }
 if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=atom')) { showATOM(); exit; }
 renderPage();
index 9ee74739fcc1e9affa643961278713c1dbf5ba11..bdaf20327f2b4496e18dc8bdc020fe933d0c1325 100644 (file)
@@ -7,14 +7,15 @@
     <div class="dailyAbout">
       All links of one day<br>in a single page.<br>
       <a href="?do=daily&day={$previousday}"><b>&lt;</b>Previous day</a> - 
-      <a href="?do=daily&day={$nextday}">Next day<b>&gt;</b></a>
+      <a href="?do=daily&day={$nextday}">Next day<b>&gt;</b></a><br><br>
+         <a href="?do=dailyrss" title="1 RSS entry per day"><img src="images/feed-icon-14x14.png#" width="14" height="14" style="position:relative;top:3px; margin-right:4px;">Daily RSS Feed</a>
     </div>
-    <div class="dailyTitle"><img src="../images/floral_left.png" width="51" height="50"> The Shaarli Daily <img src="../images/floral_right.png" width="51" height="50"></div>
-    <div class="dailyDate">&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097; {$day} &#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;</div>
+    <div class="dailyTitle"><img src="../images/floral_left.png" width="51" height="50" class="nomobile"> The Shaarli Daily <img src="../images/floral_right.png" width="51" height="50" class="nomobile"></div>
+    <div class="dailyDate"><span class="nomobile">&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;</span> {$day} <span class="nomobile">&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;</span></div>
     <div style="clear:both;"></div>
     
     {if="$linksToDisplay"}
-        <div style="float:left;position:relative; width:33%; padding-left:1%;">
+        <div id="daily_col1">
         {loop="col1"}
         <div class="dailyEntry">
             <div style="float:right;position:relative;top:-1px;"><a href="?{$value.linkdate|smallHash}"><img src="../images/squiggle2.png" width="25" height="26" title="permalink" alt="permalink"></a></div>
@@ -26,7 +27,7 @@
         {/loop}
         </div>
 
-        <div style="float:left;position:relative; width:33%;">
+        <div id="daily_col2">
         {loop="col2"}
         <div class="dailyEntry">
             <div style="float:right;position:relative;top:-1px;"><a href="?{$value.linkdate|smallHash}"><img src="../images/squiggle2.png" width="25" height="26" title="permalink" alt="permalink"></a></div>
@@ -38,7 +39,7 @@
         {/loop}
         </div>    
 
-        <div style="float:left;position:relative; width:33%;">
+        <div id="daily_col3">
         {loop="col3"}
         <div class="dailyEntry">
             <div style="float:right;position:relative;top:-1px;"><a href="?{$value.linkdate|smallHash}"><img src="../images/squiggle2.png" width="25" height="26" title="permalink" alt="permalink"></a></div>
diff --git a/tpl/dailyrss.html b/tpl/dailyrss.html
new file mode 100644 (file)
index 0000000..436e1cd
--- /dev/null
@@ -0,0 +1,8 @@
+{loop="links"}
+       <h3><a href="{$value.url}">{$value.title|htmlspecialchars}</a></h3>
+       <small>{if="!$GLOBALS['config']['HIDE_TIMESTAMPS']"}{$value.localdate|htmlspecialchars} - {/if}{if="$value.tags"}{$value.tags|htmlspecialchars}{/if}<br>
+       {$value.url|htmlspecialchars}</small><br>
+       {if="$value.thumbnail"}{$value.thumbnail}{/if}<br>
+       {if="$value.description"}{$value.formatedDescription}{/if}
+       <br><br><hr>
+{/loop}
\ No newline at end of file
index 7cfb07f2bcd3160dfcac2002f1acc94efb9fa780..5319f452bf7683fdecde8ff0ca69a3ac6b0c15d9 100644 (file)
@@ -1,5 +1,7 @@
 <title>{$pagetitle}</title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="format-detection" content="telephone=no" />
+<meta name="viewport" content="width=device-width,initial-scale=1.0" />
 <link rel="alternate" type="application/rss+xml" href="{$feedurl}?do=rss{$searchcrits}#" title="RSS Feed" />
 <link rel="alternate" type="application/atom+xml" href="{$feedurl}?do=atom{$searchcrits}#" title="ATOM Feed" />
 <link href="images/favicon.ico#" rel="shortcut icon" type="image/x-icon" />
index dc5b53986eaaa24bf88f2ab9d32f3e2178856505..1067d6fcbd8d2a212bd35c2fbfa7ffd81101835a 100644 (file)
@@ -5,8 +5,8 @@
 <div id="pageheader">
        {include="page.header"}
        <div id="headerform" style="width:100%; white-space:nowrap;">
-           <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>
+           <form method="GET" class="searchform" name="searchform" style="display:inline;"><input type="text" id="searchform_value" 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="tagfilter_value" style="width:10%" value=""> <input type="submit" value="Filter by tag" class="bigbutton"></form>
        </div>
 </div>
 
 
     {include="page.footer"}
 <script>
-$('a.qrcode').click(function(){
-  hide_qrcode();
-  var link = $(this).attr('href');
-  $(this).after('<div class="qrcode" onclick="hide_qrcode();return false;"><img src="'+link+'#" width="200" height="200"><br>click to close</div>');
+$(document).ready(function() {
+       $('a.qrcode').click(function(){
+         hide_qrcode();
+         var link = $(this).attr('href');
+         $(this).after('<div class="qrcode" onclick="hide_qrcode();return false;"><img src="'+link+'#" width="200" height="200"><br>click to close</div>');
+       });
 });
-
-function hide_qrcode()
-{
-    $('div.qrcode').remove();
-}
+function hide_qrcode() { $('div.qrcode').remove(); }
 </script>
 </body>
 </html>
\ No newline at end of file
index 27e7440d02287d25382c87096025a6b240e5a0df..b1f9871f5907c26106bcc146d58f704a9253c82a 100644 (file)
@@ -1,9 +1,14 @@
-    <div class="paging">
-        <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;" class="linksperpage"><input type="text" name="linksperpage" size="2" style="height:15px;"></form>
-        </div>
-        {if="$previous_page_url"} <a href="{$previous_page_url}">&#x25C4;Older</a> {/if}
-        <span style="color:#fff; padding:0 20 0 20;">page {$page_current} / {$page_max} </span>
-        {if="$next_page_url"} <a href="{$next_page_url}">Newer&#x25BA;</a> {/if}
-    </div>
\ No newline at end of file
+<div class="paging">
+{if="isLoggedIn()"}
+    <div id="paging_privatelinks">
+        <a href="?privateonly"><img src="images/private_16x16.png#" width="16" height="16" title="See private links only (toggle)" alt="See private links only (toggle)"></a>
+    </div>
+{/if}
+    <div id="paging_linksperpage">
+        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;" class="linksperpage"><input type="text" name="linksperpage" size="2" style="height:15px;"></form>
+    </div>
+    {if="$previous_page_url"} <a href="{$previous_page_url}" id="paging_older">&#x25C4;Older</a> {/if}
+    <div id="paging_current">page {$page_current} / {$page_max} </div>
+    {if="$next_page_url"} <a href="{$next_page_url}" id="paging_newer">Newer&#x25BA;</a> {/if}
+</div>
\ No newline at end of file
index 0c3043672fe0f21e71c74f043ff2b991a3ba6f77..3ad2f205811d0bcdf24cc4638101bf81d573ffb2 100644 (file)
@@ -1,12 +1,12 @@
 
     <div id="logo" title="Share your links !" onclick="document.location='?';"></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>
+    <div style="float:right; font-style:italic; color:#bbb; text-align:right; padding:0 5 0 0;" class="nomobile">Shaare your links...<br>{$linkcount} links</div>
     <span id="shaarli_title"><a href="?">{$shaarlititle}</a></span>
   
 {if="!empty($_GET['source']) && $_GET['source']=='bookmarklet'"}
     {ignore} When called as a popup from bookmarklet, do not display menu. {/ignore}
 {else}
-    <a href="?">Home</a>
+    <a href="?" class="nomobile">Home</a>
     {if="isLoggedIn()"}
         <a href="?do=logout">Logout</a><a href="?do=tools">Tools</a><a href="?do=addlink"><b>Add link</b></a>
     {elseif="$GLOBALS['config']['OPEN_SHAARLI']"}
@@ -14,8 +14,8 @@
     {else}
         <a href="?do=login">Login</a>
     {/if}
-    <a href="{$feedurl}?do=rss{$searchcrits}">RSS Feed</a>
-    <a href="{$feedurl}?do=atom{$searchcrits}" style="padding-left:10px;">ATOM Feed</a>
+    <a href="{$feedurl}?do=rss{$searchcrits}" class="nomobile">RSS Feed</a>
+    <a href="{$feedurl}?do=atom{$searchcrits}" style="padding-left:10px;" class="nomobile">ATOM Feed</a>
     <a href="?do=tagcloud">Tag cloud</a>
     <a href="?do=picwall{$searchcrits}">Picture wall</a>
     <a href="?do=daily">Daily</a>
index da6df7623b75e873d1007391ffe8b9f55309f22a..2083a6292d45bb3708357f705ca89ecb1fbbe50b 100644 (file)
@@ -1,6 +1,8 @@
 <!DOCTYPE html>
 <html>
-<head>{include="includes"}</head>
+<head>{include="includes"}
+<script src="inc/jquery.lazyload.min.js#"></script>
+</head>
 <body>
 <div id="pageheader">{include="page.header"}</div>
 <center>
@@ -14,4 +16,9 @@
 </center>
 {include="page.footer"}
 </body>
+<script>
+$(document).ready(function() {
+    $("img.lazyimage").show().lazyload();
+});
+</script>
 </html>
\ No newline at end of file