Fix bad merge commit
Define date format in templates instead of index.php. Conflicts: index.php tpl/dailyrss.html
This commit is contained in:
parent
2f4ab7cae2
commit
a5752e776c
1 changed files with 6 additions and 23 deletions
29
index.php
29
index.php
|
@ -567,16 +567,6 @@ function linkdate2iso8601($linkdate)
|
|||
return date('c',linkdate2timestamp($linkdate)); // 'c' is for ISO 8601 date format.
|
||||
}
|
||||
|
||||
/* Converts a linkdate time (YYYYMMDD_HHMMSS) of an article to a localized date format.
|
||||
(used to display link date on screen)
|
||||
The date format is automatically chosen according to locale/languages sniffed from browser headers (see autoLocale()). */
|
||||
function linkdate2locale($linkdate)
|
||||
{
|
||||
return utf8_encode(strftime('%c',linkdate2timestamp($linkdate))); // %c is for automatic date format according to locale.
|
||||
// Note that if you use a locale which is not installed on your webserver,
|
||||
// the date will not be displayed in the chosen locale, but probably in US notation.
|
||||
}
|
||||
|
||||
// Parse HTTP response headers and return an associative array.
|
||||
function http_parse_headers_shaarli( $headers )
|
||||
{
|
||||
|
@ -1142,7 +1132,7 @@ function showDailyRSS()
|
|||
$l = $LINKSDB[$linkdate];
|
||||
$l['formatedDescription']=nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($l['description']))));
|
||||
$l['thumbnail'] = thumbnail($l['url']);
|
||||
$l['localdate']=linkdate2locale($l['linkdate']);
|
||||
$l['timestamp'] = linkdate2timestamp($l['linkdate']);
|
||||
if (startsWith($l['url'],'?')) $l['url']=indexUrl().$l['url']; // make permalink URL absolute
|
||||
$links[$linkdate]=$l;
|
||||
}
|
||||
|
@ -1190,7 +1180,7 @@ function showDaily()
|
|||
$linksToDisplay[$key]['taglist']=$taglist;
|
||||
$linksToDisplay[$key]['formatedDescription']=nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description']))));
|
||||
$linksToDisplay[$key]['thumbnail'] = thumbnail($link['url']);
|
||||
$linksToDisplay[$key]['localdate'] = linkdate2locale($link['linkdate']);
|
||||
$linksToDisplay[$key]['timestamp'] = linkdate2timestamp($link['linkdate']);
|
||||
}
|
||||
|
||||
/* We need to spread the articles on 3 columns.
|
||||
|
@ -1940,21 +1930,14 @@ function buildLinkList($PAGE,$LINKSDB)
|
|||
while ($i<$end && $i<count($keys))
|
||||
{
|
||||
$link = $linksToDisplay[$keys[$i]];
|
||||
$title = $link['title'];
|
||||
$taglist = explode(' ',$link['tags']);
|
||||
uasort($taglist, 'strcasecmp');
|
||||
$classLi = $i%2!=0 ? '' : 'publicLinkHightLight'; // This could really be done with just a css pseudoclass.
|
||||
$link['description']=nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description']))));
|
||||
$title=$link['title'];
|
||||
$classLi = $i%2!=0 ? '' : 'publicLinkHightLight';
|
||||
$link['class'] = ($link['private']==0 ? $classLi : 'private');
|
||||
$link['timestamp']=linkdate2timestamp($link['linkdate']);
|
||||
$taglist = explode(' ',$link['tags']);
|
||||
uasort($taglist, 'strcasecmp');
|
||||
$link['taglist']=$taglist;
|
||||
|
||||
// Convert notes to absolute URLs
|
||||
if ($link["url"][0] === '?' && // Check for both signs of a note: starting with ? and 7 chars long. I doubt that you'll post any links that look like this.
|
||||
strlen($link["url"]) === 7) {
|
||||
$link["url"] = indexUrl() . $link["url"];
|
||||
}
|
||||
|
||||
$linkDisp[$keys[$i]] = $link;
|
||||
$i++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue