aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2018-07-29 17:40:05 +0200
committerArthurHoaro <arthur@hoa.ro>2018-07-29 17:49:53 +0200
commitbf3c9934d2dc02cead5995570239c5c6230ed5e5 (patch)
tree8add5495bf1080cfa09e5f8768d8ef2c558344d0
parenta4f0509a77a39d1ac834d4967e3e8f245de6d68d (diff)
downloadShaarli-bf3c9934d2dc02cead5995570239c5c6230ed5e5.tar.gz
Shaarli-bf3c9934d2dc02cead5995570239c5c6230ed5e5.tar.zst
Shaarli-bf3c9934d2dc02cead5995570239c5c6230ed5e5.zip
Fix fatal error on daily page: use new thumbnail system
Also fix: * include the login manager in the daily RSS feed function * remove redirector setting in the vintage theme Fixes #1190
-rw-r--r--index.php9
-rw-r--r--tpl/default/daily.html12
-rw-r--r--tpl/default/dailyrss.html2
-rw-r--r--tpl/vintage/configure.html8
-rw-r--r--tpl/vintage/daily.html9
-rw-r--r--tpl/vintage/dailyrss.html4
6 files changed, 24 insertions, 20 deletions
diff --git a/index.php b/index.php
index 1480bbc5..925d47a5 100644
--- a/index.php
+++ b/index.php
@@ -356,7 +356,6 @@ function showDailyRSS($conf, $loginManager) {
356 $conf->get('redirector.url'), 356 $conf->get('redirector.url'),
357 $conf->get('redirector.encode_url') 357 $conf->get('redirector.encode_url')
358 ); 358 );
359 $link['thumbnail'] = thumbnail($conf, $link['url']);
360 $link['timestamp'] = $link['created']->getTimestamp(); 359 $link['timestamp'] = $link['created']->getTimestamp();
361 if (startsWith($link['url'], '?')) { 360 if (startsWith($link['url'], '?')) {
362 $link['url'] = index_url($_SERVER) . $link['url']; // make permalink URL absolute 361 $link['url'] = index_url($_SERVER) . $link['url']; // make permalink URL absolute
@@ -371,6 +370,7 @@ function showDailyRSS($conf, $loginManager) {
371 $tpl->assign('links', $links); 370 $tpl->assign('links', $links);
372 $tpl->assign('rssdate', escape($dayDate->format(DateTime::RSS))); 371 $tpl->assign('rssdate', escape($dayDate->format(DateTime::RSS)));
373 $tpl->assign('hide_timestamps', $conf->get('privacy.hide_timestamps', false)); 372 $tpl->assign('hide_timestamps', $conf->get('privacy.hide_timestamps', false));
373 $tpl->assign('index_url', $pageaddr);
374 $html = $tpl->draw('dailyrss', true); 374 $html = $tpl->draw('dailyrss', true);
375 375
376 echo $html . PHP_EOL; 376 echo $html . PHP_EOL;
@@ -433,7 +433,6 @@ function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager)
433 $conf->get('redirector.url'), 433 $conf->get('redirector.url'),
434 $conf->get('redirector.encode_url') 434 $conf->get('redirector.encode_url')
435 ); 435 );
436 $linksToDisplay[$key]['thumbnail'] = thumbnail($conf, $link['url']);
437 $linksToDisplay[$key]['timestamp'] = $link['created']->getTimestamp(); 436 $linksToDisplay[$key]['timestamp'] = $link['created']->getTimestamp();
438 } 437 }
439 438
@@ -1812,7 +1811,11 @@ function install($conf, $sessionManager, $loginManager) {
1812 exit; 1811 exit;
1813} 1812}
1814 1813
1815if (isset($_SERVER['QUERY_STRING']) && startsWith($_SERVER['QUERY_STRING'], 'do=dailyrss')) { showDailyRSS($conf); exit; } 1814if (isset($_SERVER['QUERY_STRING']) && startsWith($_SERVER['QUERY_STRING'], 'do=dailyrss')) {
1815 showDailyRSS($conf, $loginManager);
1816 exit;
1817}
1818
1816if (!isset($_SESSION['LINKS_PER_PAGE'])) { 1819if (!isset($_SESSION['LINKS_PER_PAGE'])) {
1817 $_SESSION['LINKS_PER_PAGE'] = $conf->get('general.links_per_page', 20); 1820 $_SESSION['LINKS_PER_PAGE'] = $conf->get('general.links_per_page', 20);
1818} 1821}
diff --git a/tpl/default/daily.html b/tpl/default/daily.html
index 29d845d5..816e5d0a 100644
--- a/tpl/default/daily.html
+++ b/tpl/default/daily.html
@@ -69,9 +69,12 @@
69 </a> 69 </a>
70 <a href="{$link.real_url}">{$link.title}</a> 70 <a href="{$link.real_url}">{$link.title}</a>
71 </div> 71 </div>
72 {$thumb=thumbnail($value.url)} 72 {if="$thumbnails_enabled && !empty($link.thumbnail)"}
73 {if="$thumb!=false"} 73 <div class="daily-entry-thumbnail">
74 <div class="daily-entry-thumbnail">{$thumb}</div> 74 <img data-src="{$link.thumbnail}#" class="b-lazy"
75 src="#"
76 alt="thumbnail" width="{$thumbnails_width}" height="{$thumbnails_height}" />
77 </div>
75 {/if} 78 {/if}
76 <div class="daily-entry-description">{$link.formatedDescription}</div> 79 <div class="daily-entry-description">{$link.formatedDescription}</div>
77 {if="$link.tags"} 80 {if="$link.tags"}
@@ -83,7 +86,7 @@
83 {/loop} 86 {/loop}
84 </div> 87 </div>
85 {/if} 88 {/if}
86 <div class="dailyEntryFooter"> 89 <div class="dailyEntryFooter clear">
87 {loop="$link.link_plugin"} 90 {loop="$link.link_plugin"}
88 {$value} 91 {$value}
89 {/loop} 92 {/loop}
@@ -108,6 +111,7 @@
108 </div> 111 </div>
109</div> 112</div>
110{include="page.footer"} 113{include="page.footer"}
114<script src="js/thumbnails.min.js?v={$version_hash}"></script>
111</body> 115</body>
112</html> 116</html>
113 117
diff --git a/tpl/default/dailyrss.html b/tpl/default/dailyrss.html
index b14a3859..f589b06e 100644
--- a/tpl/default/dailyrss.html
+++ b/tpl/default/dailyrss.html
@@ -8,7 +8,7 @@
8 <h3><a href="{$value.url}">{$value.title}</a></h3> 8 <h3><a href="{$value.url}">{$value.title}</a></h3>
9 <small>{if="!$hide_timestamps"}{function="strftime('%c', $value.timestamp)"} - {/if}{if="$value.tags"}{$value.tags}{/if}<br> 9 <small>{if="!$hide_timestamps"}{function="strftime('%c', $value.timestamp)"} - {/if}{if="$value.tags"}{$value.tags}{/if}<br>
10 {$value.url}</small><br> 10 {$value.url}</small><br>
11 {if="$value.thumbnail"}{$value.thumbnail}{/if}<br> 11 {if="$value.thumbnail"}<img src="{$index_url}{$value.thumbnail}#" alt="thumbnail" />{/if}<br>
12 {if="$value.description"}{$value.formatedDescription}{/if} 12 {if="$value.description"}{$value.formatedDescription}{/if}
13 <br><br><hr> 13 <br><br><hr>
14 {/loop} 14 {/loop}
diff --git a/tpl/vintage/configure.html b/tpl/vintage/configure.html
index 9466c235..f1892fa1 100644
--- a/tpl/vintage/configure.html
+++ b/tpl/vintage/configure.html
@@ -59,14 +59,6 @@
59 </tr> 59 </tr>
60 60
61 <tr> 61 <tr>
62 <td><b>Redirector</b></td>
63 <td>
64 <input type="text" name="redirector" id="redirector" size="50" value="{$redirector}"><br>
65 (e.g. <i>http://anonym.to/?</i> will mask the HTTP_REFERER)
66 </td>
67 </tr>
68
69 <tr>
70 <td><b>Security:</b></td> 62 <td><b>Security:</b></td>
71 <td> 63 <td>
72 <input type="checkbox" name="disablesessionprotection" id="disablesessionprotection" 64 <input type="checkbox" name="disablesessionprotection" id="disablesessionprotection"
diff --git a/tpl/vintage/daily.html b/tpl/vintage/daily.html
index ede35910..00148a58 100644
--- a/tpl/vintage/daily.html
+++ b/tpl/vintage/daily.html
@@ -68,8 +68,12 @@
68 <div class="dailyEntryTitle"> 68 <div class="dailyEntryTitle">
69 <a href="{$link.real_url}">{$link.title}</a> 69 <a href="{$link.real_url}">{$link.title}</a>
70 </div> 70 </div>
71 {if="$link.thumbnail"} 71 {if="$thumbnails_enabled && !empty($link.thumbnail)"}
72 <div class="dailyEntryThumbnail">{$link.thumbnail}</div> 72 <div class="dailyEntryThumbnail">
73 <img data-src="{$link.thumbnail}#" class="b-lazy"
74 src="#"
75 alt="thumbnail" width="{$thumbnails_width}" height="{$thumbnails_height}" />
76 </div>
73 {/if} 77 {/if}
74 <div class="dailyEntryDescription">{$link.formatedDescription}</div> 78 <div class="dailyEntryDescription">{$link.formatedDescription}</div>
75 79
@@ -97,5 +101,6 @@
97 <div id="closing"><img src="img/squiggle_closing.png" width="66" height="61" alt="-"></div> 101 <div id="closing"><img src="img/squiggle_closing.png" width="66" height="61" alt="-"></div>
98</div> 102</div>
99{include="page.footer"} 103{include="page.footer"}
104<script src="js/thumbnails.min.js?v={$version_hash}"></script>
100</body> 105</body>
101</html> 106</html>
diff --git a/tpl/vintage/dailyrss.html b/tpl/vintage/dailyrss.html
index ddbd6c5e..f589b06e 100644
--- a/tpl/vintage/dailyrss.html
+++ b/tpl/vintage/dailyrss.html
@@ -4,11 +4,11 @@
4 <link>{$absurl}</link> 4 <link>{$absurl}</link>
5 <pubDate>{$rssdate}</pubDate> 5 <pubDate>{$rssdate}</pubDate>
6 <description><![CDATA[ 6 <description><![CDATA[
7 {loop="$links"} 7 {loop="links"}
8 <h3><a href="{$value.url}">{$value.title}</a></h3> 8 <h3><a href="{$value.url}">{$value.title}</a></h3>
9 <small>{if="!$hide_timestamps"}{function="strftime('%c', $value.timestamp)"} - {/if}{if="$value.tags"}{$value.tags}{/if}<br> 9 <small>{if="!$hide_timestamps"}{function="strftime('%c', $value.timestamp)"} - {/if}{if="$value.tags"}{$value.tags}{/if}<br>
10 {$value.url}</small><br> 10 {$value.url}</small><br>
11 {if="$value.thumbnail"}{$value.thumbnail}{/if}<br> 11 {if="$value.thumbnail"}<img src="{$index_url}{$value.thumbnail}#" alt="thumbnail" />{/if}<br>
12 {if="$value.description"}{$value.formatedDescription}{/if} 12 {if="$value.description"}{$value.formatedDescription}{/if}
13 <br><br><hr> 13 <br><br><hr>
14 {/loop} 14 {/loop}