]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Fix fatal error on daily page: use new thumbnail system 1191/head
authorArthurHoaro <arthur@hoa.ro>
Sun, 29 Jul 2018 15:40:05 +0000 (17:40 +0200)
committerArthurHoaro <arthur@hoa.ro>
Sun, 29 Jul 2018 15:49:53 +0000 (17:49 +0200)
Also fix:

  * include the login manager in the daily RSS feed function
  * remove redirector setting in the vintage theme

Fixes #1190

index.php
tpl/default/daily.html
tpl/default/dailyrss.html
tpl/vintage/configure.html
tpl/vintage/daily.html
tpl/vintage/dailyrss.html

index 1480bbc5aeaa80456c2f84f89d7ebaad426f59f7..925d47a5e476b55260e9cda84fbfa33e554b66cc 100644 (file)
--- a/index.php
+++ b/index.php
@@ -356,7 +356,6 @@ function showDailyRSS($conf, $loginManager) {
                 $conf->get('redirector.url'),
                 $conf->get('redirector.encode_url')
             );
-            $link['thumbnail'] = thumbnail($conf, $link['url']);
             $link['timestamp'] = $link['created']->getTimestamp();
             if (startsWith($link['url'], '?')) {
                 $link['url'] = index_url($_SERVER) . $link['url'];  // make permalink URL absolute
@@ -371,6 +370,7 @@ function showDailyRSS($conf, $loginManager) {
         $tpl->assign('links', $links);
         $tpl->assign('rssdate', escape($dayDate->format(DateTime::RSS)));
         $tpl->assign('hide_timestamps', $conf->get('privacy.hide_timestamps', false));
+        $tpl->assign('index_url', $pageaddr);
         $html = $tpl->draw('dailyrss', true);
 
         echo $html . PHP_EOL;
@@ -433,7 +433,6 @@ function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager)
             $conf->get('redirector.url'),
             $conf->get('redirector.encode_url')
         );
-        $linksToDisplay[$key]['thumbnail'] = thumbnail($conf, $link['url']);
         $linksToDisplay[$key]['timestamp'] =  $link['created']->getTimestamp();
     }
 
@@ -1812,7 +1811,11 @@ function install($conf, $sessionManager, $loginManager) {
     exit;
 }
 
-if (isset($_SERVER['QUERY_STRING']) && startsWith($_SERVER['QUERY_STRING'], 'do=dailyrss')) { showDailyRSS($conf); exit; }
+if (isset($_SERVER['QUERY_STRING']) && startsWith($_SERVER['QUERY_STRING'], 'do=dailyrss')) {
+    showDailyRSS($conf, $loginManager);
+    exit;
+}
+
 if (!isset($_SESSION['LINKS_PER_PAGE'])) {
     $_SESSION['LINKS_PER_PAGE'] = $conf->get('general.links_per_page', 20);
 }
index 29d845d5307231d1337e3964837d8931a89736e0..816e5d0a8bd342cdb200fdb34525a6dbce5865d9 100644 (file)
                     </a>
                     <a href="{$link.real_url}">{$link.title}</a>
                   </div>
-                  {$thumb=thumbnail($value.url)}
-                  {if="$thumb!=false"}
-                    <div class="daily-entry-thumbnail">{$thumb}</div>
+                  {if="$thumbnails_enabled && !empty($link.thumbnail)"}
+                    <div class="daily-entry-thumbnail">
+                      <img data-src="{$link.thumbnail}#" class="b-lazy"
+                           src="#"
+                           alt="thumbnail" width="{$thumbnails_width}" height="{$thumbnails_height}" />
+                    </div>
                   {/if}
                   <div class="daily-entry-description">{$link.formatedDescription}</div>
                   {if="$link.tags"}
@@ -83,7 +86,7 @@
                       {/loop}
                     </div>
                   {/if}
-                  <div class="dailyEntryFooter">
+                  <div class="dailyEntryFooter clear">
                     {loop="$link.link_plugin"}
                       {$value}
                     {/loop}
   </div>
 </div>
 {include="page.footer"}
+<script src="js/thumbnails.min.js?v={$version_hash}"></script>
 </body>
 </html>
 
index b14a38595c6038620317cea2d0d8157e1261658e..f589b06ead8b0f675c67f347c6b9360437d1bdb9 100644 (file)
@@ -8,7 +8,7 @@
                <h3><a href="{$value.url}">{$value.title}</a></h3>
                <small>{if="!$hide_timestamps"}{function="strftime('%c', $value.timestamp)"} - {/if}{if="$value.tags"}{$value.tags}{/if}<br>
                {$value.url}</small><br>
-               {if="$value.thumbnail"}{$value.thumbnail}{/if}<br>
+               {if="$value.thumbnail"}<img src="{$index_url}{$value.thumbnail}#" alt="thumbnail" />{/if}<br>
                {if="$value.description"}{$value.formatedDescription}{/if}
                <br><br><hr>
         {/loop}
index 9466c2354780cbdb8a8f7805041d733a4b7025fc..f1892fa1a1de1954249b54a1c8d06215f51f5ec3 100644 (file)
         </td>
       </tr>
 
-      <tr>
-        <td><b>Redirector</b></td>
-        <td>
-          <input type="text" name="redirector" id="redirector" size="50" value="{$redirector}"><br>
-          (e.g. <i>http://anonym.to/?</i> will mask the HTTP_REFERER)
-        </td>
-      </tr>
-
       <tr>
         <td><b>Security:</b></td>
         <td>
index ede359106d30e107422c884b59bf494ae316092c..00148a585b88ebcd1a16db3f35aebf83246dfc29 100644 (file)
                         <div class="dailyEntryTitle">
                             <a href="{$link.real_url}">{$link.title}</a>
                         </div>
-                        {if="$link.thumbnail"}
-                            <div class="dailyEntryThumbnail">{$link.thumbnail}</div>
+                        {if="$thumbnails_enabled && !empty($link.thumbnail)"}
+                            <div class="dailyEntryThumbnail">
+                              <img data-src="{$link.thumbnail}#" class="b-lazy"
+                                   src="#"
+                                   alt="thumbnail" width="{$thumbnails_width}" height="{$thumbnails_height}" />
+                            </div>
                         {/if}
                         <div class="dailyEntryDescription">{$link.formatedDescription}</div>
 
     <div id="closing"><img src="img/squiggle_closing.png" width="66" height="61" alt="-"></div>
 </div>
 {include="page.footer"}
+<script src="js/thumbnails.min.js?v={$version_hash}"></script>
 </body>
 </html>
index ddbd6c5ea49ba5a0d3b68238471a7c06d3f42e41..f589b06ead8b0f675c67f347c6b9360437d1bdb9 100644 (file)
@@ -4,11 +4,11 @@
     <link>{$absurl}</link>
     <pubDate>{$rssdate}</pubDate>
     <description><![CDATA[
-        {loop="$links"}
+        {loop="links"}
                <h3><a href="{$value.url}">{$value.title}</a></h3>
                <small>{if="!$hide_timestamps"}{function="strftime('%c', $value.timestamp)"} - {/if}{if="$value.tags"}{$value.tags}{/if}<br>
                {$value.url}</small><br>
-               {if="$value.thumbnail"}{$value.thumbnail}{/if}<br>
+               {if="$value.thumbnail"}<img src="{$index_url}{$value.thumbnail}#" alt="thumbnail" />{/if}<br>
                {if="$value.description"}{$value.formatedDescription}{/if}
                <br><br><hr>
         {/loop}