Commit 45d7d97f authored by Malcolm Blaney's avatar Malcolm Blaney

Added css rules for reader-item author images now that they're

being used. Fixed typo in using feed title as author name. Always
link permalink to the date, just leave title as extra content.
parent 05d672cf
Pipeline #34394498 passed with stage
in 1 minute and 10 seconds
......@@ -380,13 +380,13 @@ class Reader extends Base {
$this->Log('Reader->Install 7: ' . $mysqli->error);
}
$format_with_title = '<h4 class="title">!title</h4>' .
$format_with_title = '<h5 class="author">!author !date</h5>' .
'<h4 class="title">!title</h4>' .
'<div class="content">!content</div>' .
'<div class="options">!category</div>';
$format_no_title = '<h5 class="author">!author !date</h5>';
'<div class="content">!content</div>' .
'<div class="options">!category</div>' .
'<h5 class="author">!author !date</h5>';
$format_no_title = '<div class="content">!content</div>' .
'<div class="options">!category</div>' .
'<h5 class="author">!author !date</h5>';
$template = ['"reader-item-count", "", "10"',
'"reader-format-with-title", "", ' .
'"' . $mysqli->escape_string($format_with_title) . '"',
......@@ -397,9 +397,12 @@ class Reader extends Base {
$this->AddTemplate($template);
$description = ['reader-item-count' => 'The number of items to return ' .
'when more are requested.',
'reader-format' => 'The template for a reader item, ' .
'substitutes: !title, !description, !author, ' .
'!category, !media and !date.'];
'reader-format-with-title' => 'The template for a reader ' .
'item with a title, substitutes: !title, !description, ' .
'!author, !category, !media and !date.',
'reader-format-no-title' => 'The template for a reader ' .
'item with no title, substitutes: !description, ' .
'!author, !category, !media and !date.'];
$this->AddTemplateDescription($description);
$site_style = ['"",".reader .feed-item","padding","5px"',
......@@ -438,7 +441,14 @@ class Reader extends Base {
'"",".reader-item","margin-left","10px"',
'"",".reader-item","overflow","hidden"',
'"",".reader-item","clear","both"',
'"",".reader-item .author","margin","10px 0"',
'"",".reader-item .author img","max-height","50px"',
'"",".reader-item .author img","max-width","70px"',
'"",".reader-item .author img","float","left"',
'"",".reader-item .author img","border-radius","2px"',
'"",".reader-item .author img","margin","0 10px 10px 0"',
'"",".reader-item a.author-name","font-size","1.2em"',
'"",".reader-item a.author-name ","color","#222222"',
'"",".reader-item a.author-name:hover","color","#999999"',
'"",".reader-reset","float","right"',
'"",".reader-clear","clear","both"',
'"",".reader h4","margin","10px 0"',
......@@ -446,6 +456,8 @@ class Reader extends Base {
'"",".reader a:hover","color","#999999"',
'"",".reader","font-family","Verdana,Arial"',
'"",".reader-actions","padding-bottom","15px"',
'"",".reader-actions","margin-left","10px"',
'"",".reader-actions","clear","both"',
'"",".reader-actions a","margin","5px"',
'"","label[for=reader-toggle-import]","float","right"',
'"","label[for=reader-toggle-import]","margin-top","8px"',
......@@ -630,9 +642,11 @@ class Reader extends Base {
// item should be automatically syndicated to the silos they came from.
if (strpos($xml_url, 'https://facebook-atom.appspot.com') === 0) {
$html_url = 'https://facebook-atom.appspot.com';
$image_url = '/images/facebook.png';
}
else if (strpos($xml_url, 'https://twitter-atom.appspot.com') === 0) {
$html_url = 'https://twitter-atom.appspot.com';
$image_url = '/images/twitter.png';
}
$language = $mysqli->escape_string($feed->get_language());
$image_url = $mysqli->escape_string($feed->get_image_url());
......@@ -1069,7 +1083,7 @@ class Reader extends Base {
$this->LookupNickname($item['author'], $permalink);
// If author name or photo wasn't found try using the feed title or image.
if ($author_name === '') {
$author_name = $item['image_title'];
$author_name = $item['feed_title'];
}
if ($author_photo === '') {
$author_photo = $item['image_url'];
......@@ -1102,28 +1116,20 @@ class Reader extends Base {
$title = $item['title'];
$content = content_markup($item['content']);
$date = date('j F Y, g:ia', $item['timestamp']);
$reader_format = 'reader-format-with-title';
$reader_format = $title === '' || $config['hide-titles'] ?
'reader-format-no-title' : 'reader-format-with-title';
$author = '';
if ($author_photo !== '') {
$author .= '<a href="' . $author_url . '">' .
'<img class="thumb" src="' . $author_photo . '"></a> ';
}
$author .= '<a href="' . $author_url . '"><span class="author-name">' .
$author_name . '</span></a>';
$author .= '<a href="' . $author_url . '" class="author-name">' .
$author_name . '</a>';
if ($category !== '') {
$category = '<span class="reader-tag-label">tags: </span>' . $category;
}
if ($title !== '' && !$config['hide-titles']) {
$title = '<a href="' . $permalink . '" class="permalink">' .
$title . '</a>';
}
else {
// When there is no title, link the permalink page to the date.
if (!$config['hide-permalinks']) {
$date = '<a href="' . $permalink . '" class="permalink">' . $date .
'</a>';
}
$reader_format = 'reader-format-no-title';
if (!$config['hide-permalinks']) {
$date = '<a href="' . $permalink . '" class="permalink">' . $date .'</a>';
}
// If the content is too long, show an excerpt and add a link so that
// the real content can be expanded.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment