Improve authors (#2025)

* Links for authors and multiple authors

Favour ';' as a separator instead of ',' to better cope with
multi-author scientific articles.
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/1997 ,
https://github.com/FreshRSS/FreshRSS/issues/1968,
https://github.com/FreshRSS/FreshRSS/pull/2023

* Change i18n authors

* Update layout

* Unicode-compatible search

Example for `author:Loïc`

* author <em> styling

* Final details

* Minor spacing
This commit is contained in:
Alexandre Alapetite
2018-09-16 10:46:27 +02:00
committed by GitHub
parent 9fa2122d4a
commit b323ed0846
26 changed files with 98 additions and 53 deletions

View File

@@ -68,7 +68,7 @@ class FreshRSS_Category extends Minz_Model {
$this->id = $value; $this->id = $value;
} }
public function _name($value) { public function _name($value) {
$this->name = mb_strcut(trim($value), 0, 255, 'UTF-8'); $this->name = trim($value);
} }
public function _feeds($values) { public function _feeds($values) {
if (!is_array($values)) { if (!is_array($values)) {

View File

@@ -10,7 +10,7 @@ class FreshRSS_Entry extends Minz_Model {
private $id = 0; private $id = 0;
private $guid; private $guid;
private $title; private $title;
private $author; private $authors;
private $content; private $content;
private $link; private $link;
private $date; private $date;
@@ -21,17 +21,16 @@ class FreshRSS_Entry extends Minz_Model {
private $feed; private $feed;
private $tags; private $tags;
public function __construct($feedId = '', $guid = '', $title = '', $author = '', $content = '', public function __construct($feedId = '', $guid = '', $title = '', $authors = '', $content = '',
$link = '', $pubdate = 0, $is_read = false, $is_favorite = false, $tags = '') { $link = '', $pubdate = 0, $is_read = false, $is_favorite = false, $tags = '') {
$this->_title($title); $this->_title($title);
$this->_author($author); $this->_authors($authors);
$this->_content($content); $this->_content($content);
$this->_link($link); $this->_link($link);
$this->_date($pubdate); $this->_date($pubdate);
$this->_isRead($is_read); $this->_isRead($is_read);
$this->_isFavorite($is_favorite); $this->_isFavorite($is_favorite);
$this->_feedId($feedId); $this->_feedId($feedId);
$tags = mb_strcut($tags, 0, 1023, 'UTF-8');
$this->_tags($tags); $this->_tags($tags);
$this->_guid($guid); $this->_guid($guid);
} }
@@ -45,8 +44,12 @@ class FreshRSS_Entry extends Minz_Model {
public function title() { public function title() {
return $this->title; return $this->title;
} }
public function author() { public function authors($asString = false) {
return $this->author === null ? '' : $this->author; if ($asString) {
return $this->authors == null ? '' : ';' . implode('; ', $this->authors);
} else {
return $this->authors;
}
} }
public function content() { public function content() {
return $this->content; return $this->content;
@@ -88,7 +91,7 @@ class FreshRSS_Entry extends Minz_Model {
} }
public function tags($asString = false) { public function tags($asString = false) {
if ($asString) { if ($asString) {
return $this->tags == '' ? '' : '#' . implode(' #', $this->tags); return $this->tags == null ? '' : '#' . implode(' #', $this->tags);
} else { } else {
return $this->tags; return $this->tags;
} }
@@ -97,7 +100,7 @@ class FreshRSS_Entry extends Minz_Model {
public function hash() { public function hash() {
if ($this->hash === null) { if ($this->hash === null) {
//Do not include $this->date because it may be automatically generated when lacking //Do not include $this->date because it may be automatically generated when lacking
$this->hash = md5($this->link . $this->title . $this->author . $this->content . $this->tags(true)); $this->hash = md5($this->link . $this->title . $this->authors(true) . $this->content . $this->tags(true));
} }
return $this->hash; return $this->hash;
} }
@@ -124,11 +127,18 @@ class FreshRSS_Entry extends Minz_Model {
} }
public function _title($value) { public function _title($value) {
$this->hash = null; $this->hash = null;
$this->title = mb_strcut($value, 0, 255, 'UTF-8'); $this->title = $value;
} }
public function _author($value) { public function _authors($value) {
$this->hash = null; $this->hash = null;
$this->author = mb_strcut($value, 0, 255, 'UTF-8'); if (!is_array($value)) {
if (strpos($value, ';') !== false) {
$value = preg_split('/\s*[;]\s*/', $value, -1, PREG_SPLIT_NO_EMPTY);
} else {
$value = preg_split('/\s*[,]\s*/', $value, -1, PREG_SPLIT_NO_EMPTY);
}
}
$this->authors = $value;
} }
public function _content($value) { public function _content($value) {
$this->hash = null; $this->hash = null;
@@ -280,7 +290,7 @@ class FreshRSS_Entry extends Minz_Model {
'id' => $this->id(), 'id' => $this->id(),
'guid' => $this->guid(), 'guid' => $this->guid(),
'title' => $this->title(), 'title' => $this->title(),
'author' => $this->author(), 'author' => $this->authors(true),
'content' => $this->content(), 'content' => $this->content(),
'link' => $this->link(), 'link' => $this->link(),
'date' => $this->date(true), 'date' => $this->date(true),

View File

@@ -420,7 +420,7 @@ class FreshRSS_Feed extends Minz_Model {
$author_names = ''; $author_names = '';
if (is_array($authors)) { if (is_array($authors)) {
foreach ($authors as $author) { foreach ($authors as $author) {
$author_names .= html_only_entity_decode(strip_tags($author->name == '' ? $author->email : $author->name)) . ', '; $author_names .= html_only_entity_decode(strip_tags($author->name == '' ? $author->email : $author->name)) . '; ';
} }
} }
$author_names = substr($author_names, 0, -2); $author_names = substr($author_names, 0, -2);

View File

@@ -141,7 +141,7 @@ class FreshRSS_Search {
$this->intitle = $matches['search']; $this->intitle = $matches['search'];
$input = str_replace($matches[0], '', $input); $input = str_replace($matches[0], '', $input);
} }
if (preg_match_all('/\bintitle:(?P<search>[\w+]*)/', $input, $matches)) { if (preg_match_all('/\bintitle:(?P<search>[^\s"]*)/', $input, $matches)) {
$this->intitle = array_merge($this->intitle ? $this->intitle : array(), $matches['search']); $this->intitle = array_merge($this->intitle ? $this->intitle : array(), $matches['search']);
$input = str_replace($matches[0], '', $input); $input = str_replace($matches[0], '', $input);
} }
@@ -155,7 +155,7 @@ class FreshRSS_Search {
$this->not_intitle = $matches['search']; $this->not_intitle = $matches['search'];
$input = str_replace($matches[0], '', $input); $input = str_replace($matches[0], '', $input);
} }
if (preg_match_all('/[!-]intitle:(?P<search>[\w+]*)/', $input, $matches)) { if (preg_match_all('/[!-]intitle:(?P<search>[^\s"]*)/', $input, $matches)) {
$this->not_intitle = array_merge($this->not_intitle ? $this->not_intitle : array(), $matches['search']); $this->not_intitle = array_merge($this->not_intitle ? $this->not_intitle : array(), $matches['search']);
$input = str_replace($matches[0], '', $input); $input = str_replace($matches[0], '', $input);
} }
@@ -179,7 +179,7 @@ class FreshRSS_Search {
$this->author = $matches['search']; $this->author = $matches['search'];
$input = str_replace($matches[0], '', $input); $input = str_replace($matches[0], '', $input);
} }
if (preg_match_all('/\bauthor:(?P<search>[\w+]*)/', $input, $matches)) { if (preg_match_all('/\bauthor:(?P<search>[^\s"]*)/', $input, $matches)) {
$this->author = array_merge($this->author ? $this->author : array(), $matches['search']); $this->author = array_merge($this->author ? $this->author : array(), $matches['search']);
$input = str_replace($matches[0], '', $input); $input = str_replace($matches[0], '', $input);
} }
@@ -193,7 +193,7 @@ class FreshRSS_Search {
$this->not_author = $matches['search']; $this->not_author = $matches['search'];
$input = str_replace($matches[0], '', $input); $input = str_replace($matches[0], '', $input);
} }
if (preg_match_all('/[!-]author:(?P<search>[\w+]*)/', $input, $matches)) { if (preg_match_all('/[!-]author:(?P<search>[^\s"]*)/', $input, $matches)) {
$this->not_author = array_merge($this->not_author ? $this->not_author : array(), $matches['search']); $this->not_author = array_merge($this->not_author ? $this->not_author : array(), $matches['search']);
$input = str_replace($matches[0], '', $input); $input = str_replace($matches[0], '', $input);
} }

View File

@@ -181,7 +181,7 @@ return array(
'short' => array( 'short' => array(
'attention' => 'Upozornění!', 'attention' => 'Upozornění!',
'blank_to_disable' => 'Zakázat - ponechte prázdné', 'blank_to_disable' => 'Zakázat - ponechte prázdné',
'by_author' => 'Od <em>%s</em>', 'by_author' => 'Od:',
'by_default' => 'Výchozí', 'by_default' => 'Výchozí',
'damn' => 'Sakra!', 'damn' => 'Sakra!',
'default_category' => 'Nezařazeno', 'default_category' => 'Nezařazeno',

View File

@@ -180,7 +180,7 @@ return array(
'short' => array( 'short' => array(
'attention' => 'Achtung!', 'attention' => 'Achtung!',
'blank_to_disable' => 'Zum Deaktivieren frei lassen', 'blank_to_disable' => 'Zum Deaktivieren frei lassen',
'by_author' => 'Von <em>%s</em>', 'by_author' => 'Von:',
'by_default' => 'standardmäßig', 'by_default' => 'standardmäßig',
'damn' => 'Verdammt!', 'damn' => 'Verdammt!',
'default_category' => 'Unkategorisiert', 'default_category' => 'Unkategorisiert',

View File

@@ -181,7 +181,7 @@ return array(
'short' => array( 'short' => array(
'attention' => 'Warning!', 'attention' => 'Warning!',
'blank_to_disable' => 'Leave blank to disable', 'blank_to_disable' => 'Leave blank to disable',
'by_author' => 'By <em>%s</em>', 'by_author' => 'By:',
'by_default' => 'By default', 'by_default' => 'By default',
'damn' => 'Blast!', 'damn' => 'Blast!',
'default_category' => 'Uncategorized', 'default_category' => 'Uncategorized',

View File

@@ -181,7 +181,7 @@ return array(
'short' => array( 'short' => array(
'attention' => '¡Aviso!', 'attention' => '¡Aviso!',
'blank_to_disable' => 'Deja en blanco para desactivar', 'blank_to_disable' => 'Deja en blanco para desactivar',
'by_author' => 'Por <em>%s</em>', 'by_author' => 'Por:',
'by_default' => 'Por defecto', 'by_default' => 'Por defecto',
'damn' => '¡Córcholis!', 'damn' => '¡Córcholis!',
'default_category' => 'Sin categorizar', 'default_category' => 'Sin categorizar',

View File

@@ -181,7 +181,7 @@ return array(
'short' => array( 'short' => array(
'attention' => 'Attention !', 'attention' => 'Attention !',
'blank_to_disable' => 'Laissez vide pour désactiver', 'blank_to_disable' => 'Laissez vide pour désactiver',
'by_author' => 'Par <em>%s</em>', 'by_author' => 'Par :',
'by_default' => 'Par défaut', 'by_default' => 'Par défaut',
'damn' => 'Arf !', 'damn' => 'Arf !',
'default_category' => 'Sans catégorie', 'default_category' => 'Sans catégorie',

View File

@@ -181,7 +181,7 @@ return array(
'short' => array( 'short' => array(
'attention' => 'זהירות!', 'attention' => 'זהירות!',
'blank_to_disable' => 'יש להשאיר ריק על מנת לנטרל', 'blank_to_disable' => 'יש להשאיר ריק על מנת לנטרל',
'by_author' => 'מאת <em>%s</em>', 'by_author' => 'מאת :',
'by_default' => 'ברירת מחדל', 'by_default' => 'ברירת מחדל',
'damn' => 'הו לא!', 'damn' => 'הו לא!',
'default_category' => 'ללא קטגוריה', 'default_category' => 'ללא קטגוריה',

View File

@@ -181,7 +181,7 @@ return array(
'short' => array( 'short' => array(
'attention' => 'Attenzione!', 'attention' => 'Attenzione!',
'blank_to_disable' => 'Lascia vuoto per disabilitare', 'blank_to_disable' => 'Lascia vuoto per disabilitare',
'by_author' => 'di <em>%s</em>', 'by_author' => 'di:',
'by_default' => 'predefinito', 'by_default' => 'predefinito',
'damn' => 'Ops!', 'damn' => 'Ops!',
'default_category' => 'Senza categoria', 'default_category' => 'Senza categoria',

View File

@@ -181,7 +181,7 @@ return array(
'short' => array( 'short' => array(
'attention' => '경고!', 'attention' => '경고!',
'blank_to_disable' => '빈 칸으로 두면 비활성화', 'blank_to_disable' => '빈 칸으로 두면 비활성화',
'by_author' => 'By <em>%s</em>', 'by_author' => 'By:',
'by_default' => '기본값', 'by_default' => '기본값',
'damn' => '이런!', 'damn' => '이런!',
'default_category' => '분류 없음', 'default_category' => '분류 없음',

View File

@@ -181,7 +181,7 @@ return array(
'short' => array( 'short' => array(
'attention' => 'Attentie!', 'attention' => 'Attentie!',
'blank_to_disable' => 'Laat leeg om uit te zetten', 'blank_to_disable' => 'Laat leeg om uit te zetten',
'by_author' => 'Door <em>%s</em>', 'by_author' => 'Door:',
'by_default' => 'Door standaard', 'by_default' => 'Door standaard',
'damn' => 'Potverdorie!', 'damn' => 'Potverdorie!',
'default_category' => 'Niet ingedeeld', 'default_category' => 'Niet ingedeeld',

View File

@@ -180,7 +180,7 @@ return array(
'short' => array( 'short' => array(
'attention' => 'Atencão!', 'attention' => 'Atencão!',
'blank_to_disable' => 'Deixe em branco para desativar', 'blank_to_disable' => 'Deixe em branco para desativar',
'by_author' => 'Por <em>%s</em>', 'by_author' => 'Por:',
'by_default' => 'Por padrão', 'by_default' => 'Por padrão',
'damn' => 'Buumm!', 'damn' => 'Buumm!',
'default_category' => 'Sem categoria', 'default_category' => 'Sem categoria',

View File

@@ -181,7 +181,7 @@ return array(
'short' => array( 'short' => array(
'attention' => 'Warning!', 'attention' => 'Warning!',
'blank_to_disable' => 'Leave blank to disable', 'blank_to_disable' => 'Leave blank to disable',
'by_author' => 'By <em>%s</em>', 'by_author' => 'By:',
'by_default' => 'By default', 'by_default' => 'By default',
'damn' => 'Damn!', 'damn' => 'Damn!',
'default_category' => 'Uncategorized', 'default_category' => 'Uncategorized',

View File

@@ -181,7 +181,7 @@ return array(
'short' => array( 'short' => array(
'attention' => 'Tehlike!', 'attention' => 'Tehlike!',
'blank_to_disable' => 'Devredışı bırakmak için boş bırakın', 'blank_to_disable' => 'Devredışı bırakmak için boş bırakın',
'by_author' => '<em>%s</em> tarafından', 'by_author' => 'Tarafından:',
'by_default' => 'Öntanımlı', 'by_default' => 'Öntanımlı',
'damn' => 'Hay aksi!', 'damn' => 'Hay aksi!',
'default_category' => 'Kategorisiz', 'default_category' => 'Kategorisiz',

View File

@@ -181,7 +181,7 @@ return array(
'short' => array( 'short' => array(
'attention' => '警告!', 'attention' => '警告!',
'blank_to_disable' => '留空以禁用', 'blank_to_disable' => '留空以禁用',
'by_author' => '作者 <em>%s</em>', 'by_author' => '作者',
'by_default' => '默认', 'by_default' => '默认',
'damn' => '错误!', 'damn' => '错误!',
'default_category' => '未分类', 'default_category' => '未分类',

View File

@@ -39,7 +39,7 @@
<?php } ?> <?php } ?>
</div> </div>
<div class="properties"> <div class="properties">
<div><?php echo sprintf('%s — %s', $theme['name'], _t('gen.short.by_author', $theme['author'])); ?></div> <div><?php echo sprintf('%s — %s %s', $theme['name'], _t('gen.short.by_author'), $theme['author']); ?></div>
<div><?php echo $theme['description'] ?></div> <div><?php echo $theme['description'] ?></div>
<div class="page-number"><?php echo sprintf('%d/%d', $i, $slides) ?></div> <div class="page-number"><?php echo sprintf('%d/%d', $i, $slides) ?></div>
</div> </div>

View File

@@ -34,7 +34,7 @@ foreach ($this->entriesRaw as $entryRaw) {
'id' => $entry->guid(), 'id' => $entry->guid(),
'categories' => array_values($entry->tags()), 'categories' => array_values($entry->tags()),
'title' => $entry->title(), 'title' => $entry->title(),
'author' => $entry->author(), 'author' => $entry->authors(true), //TODO: Make an array like tags?
'published' => $entry->date(true), 'published' => $entry->date(true),
'updated' => $entry->date(true), 'updated' => $entry->date(true),
'alternate' => array(array( 'alternate' => array(array(

View File

@@ -5,7 +5,7 @@
: _t('admin.extensions.disabled'); ?> : _t('admin.extensions.disabled'); ?>
</h1> </h1>
<p class="alert alert-warn"><?php echo $this->extension->getDescription(); ?><?php echo _t('gen.short.by_author', $this->extension->getAuthor()); ?></p> <p class="alert alert-warn"><?php echo $this->extension->getDescription(); ?><?php echo _t('gen.short.by_author'), ' ', $this->extension->getAuthor(); ?></p>
<h2><?php echo _t('gen.action.manage'); ?></h2> <h2><?php echo _t('gen.action.manage'); ?></h2>
<?php <?php

View File

@@ -67,10 +67,19 @@ if (!empty($this->entries)) {
?><div class="flux_content"> ?><div class="flux_content">
<div class="content <?php echo $content_width; ?>"> <div class="content <?php echo $content_width; ?>">
<h1 class="title"><a target="_blank" rel="noreferrer" class="go_website" href="<?php echo $this->entry->link(); ?>"><?php echo $this->entry->title(); ?></a></h1> <h1 class="title"><a target="_blank" rel="noreferrer" class="go_website" href="<?php echo $this->entry->link(); ?>"><?php echo $this->entry->title(); ?></a></h1>
<?php <div class="author"><?php
$author = $this->entry->author(); $authors = $this->entry->authors();
echo $author != '' ? '<div class="author">' . _t('gen.short.by_author', $author) . '</div>' : '', if (is_array($authors)):
$lazyload && $hidePosts ? lazyimg($this->entry->content()) : $this->entry->content(); $first = true;
foreach ($authors as $author):
echo $first ? _t('gen.short.by_author') . ' ' : '· ';
$first = false;
?>
<em><a href="<?php echo _url('index', 'index', 'search', 'author:' . str_replace(' ', '+', htmlspecialchars_decode($author, ENT_QUOTES))); ?>"><?php echo $author; ?></a></em>
<?php endforeach; ?>
</div><?php
endif;
echo $lazyload && $hidePosts ? lazyimg($this->entry->content()) : $this->entry->content();
?> ?>
</div><?php </div><?php

View File

@@ -39,9 +39,19 @@ if (!empty($this->entries)) {
<h1 class="title"><a target="_blank" rel="noreferrer" class="go_website" href="<?php echo $item->link(); ?>"><?php echo $item->title(); ?></a></h1> <h1 class="title"><a target="_blank" rel="noreferrer" class="go_website" href="<?php echo $item->link(); ?>"><?php echo $item->title(); ?></a></h1>
<div class="author"><?php <div class="author"><?php
$author = $item->author(); $authors = $item->authors();
echo $author != '' ? _t('gen.short.by_author', $author) . ' — ' : '', if (is_array($authors)):
$item->date(); $first = true;
foreach ($authors as $author):
echo $first ? _t('gen.short.by_author') . ' ' : '· ';
$first = false;
?>
<em><a href="<?php echo _url('index', 'index', 'search', 'author:' . str_replace(' ', '+', htmlspecialchars_decode($author, ENT_QUOTES))); ?>"><?php echo $author; ?></a></em>
<?php
endforeach;
echo ' — ';
endif;
echo $item->date();
?></div> ?></div>
<?php echo $item->content(); ?> <?php echo $item->content(); ?>

View File

@@ -13,10 +13,20 @@ foreach ($this->entries as $item) {
<item> <item>
<title><?php echo $item->title(); ?></title> <title><?php echo $item->title(); ?></title>
<link><?php echo $item->link(); ?></link> <link><?php echo $item->link(); ?></link>
<?php $author = $item->author(); ?> <?php
<?php if ($author != '') { ?> $authors = $item->authors();
<dc:creator><?php echo $author; ?></dc:creator> if (is_array($authors)) {
<?php } ?> foreach ($authors as $author) {
echo "\t\t\t" , '<author>', $author, '</author>', "\n";
}
}
$categories = $item->tags();
if (is_array($categories)) {
foreach ($categories as $category) {
echo "\t\t\t" , '<category>', $category, '</category>', "\n";
}
}
?>
<description><![CDATA[<?php <description><![CDATA[<?php
echo $item->content(); echo $item->content();
?>]]></description> ?>]]></description>

View File

@@ -3,6 +3,7 @@
* Fever API for FreshRSS * Fever API for FreshRSS
* Version 0.1 * Version 0.1
* Author: Kevin Papst / https://github.com/kevinpapst * Author: Kevin Papst / https://github.com/kevinpapst
* Documentation: https://feedafever.com/api
* *
* Inspired by: * Inspired by:
* TinyTinyRSS Fever API plugin @dasmurphy * TinyTinyRSS Fever API plugin @dasmurphy
@@ -63,7 +64,7 @@ class FeverDAO extends Minz_ModelPdo
$sql = 'SELECT id, guid, title, author, ' $sql = 'SELECT id, guid, title, author, '
. ($entryDAO->isCompressed() ? 'UNCOMPRESS(content_bin) AS content' : 'content') . ($entryDAO->isCompressed() ? 'UNCOMPRESS(content_bin) AS content' : 'content')
. ', link, date, is_read, is_favorite, id_feed, tags ' . ', link, date, is_read, is_favorite, id_feed '
. 'FROM `' . $this->prefix . 'entry` WHERE'; . 'FROM `' . $this->prefix . 'entry` WHERE';
if (!empty($entry_ids)) { if (!empty($entry_ids)) {
@@ -495,17 +496,17 @@ class FeverAPI
// Load list of extensions and enable the "system" ones. // Load list of extensions and enable the "system" ones.
Minz_ExtensionManager::init(); Minz_ExtensionManager::init();
foreach($entries as $item) { foreach ($entries as $item) {
/** @var FreshRSS_Entry $entry */ /** @var FreshRSS_Entry $entry */
$entry = Minz_ExtensionManager::callHook('entry_before_display', $item); $entry = Minz_ExtensionManager::callHook('entry_before_display', $item);
if (is_null($entry)) { if ($entry == null) {
continue; continue;
} }
$items[] = array( $items[] = array(
'id' => $entry->id(), 'id' => $entry->id(),
'feed_id' => $entry->feed(false), 'feed_id' => $entry->feed(false),
'title' => $entry->title(), 'title' => $entry->title(),
'author' => $entry->author(), 'author' => $entry->authors(true),
'html' => $entry->content(), 'html' => $entry->content(),
'url' => $entry->link(), 'url' => $entry->link(),
'is_saved' => $entry->isFavorite() ? 1 : 0, 'is_saved' => $entry->isFavorite() ? 1 : 0,

View File

@@ -18,6 +18,7 @@ Server-side API compatible with Google Reader API layer 2
* https://github.com/ericmann/gReader-Library/blob/master/greader.class.php * https://github.com/ericmann/gReader-Library/blob/master/greader.class.php
* https://github.com/devongovett/reader * https://github.com/devongovett/reader
* https://github.com/theoldreader/api * https://github.com/theoldreader/api
* https://www.inoreader.com/developers/
*/ */
require(__DIR__ . '/../../constants.php'); require(__DIR__ . '/../../constants.php');
@@ -471,6 +472,7 @@ function entriesToArray($entries) {
'categories' => array( 'categories' => array(
'user/-/state/com.google/reading-list', 'user/-/state/com.google/reading-list',
'user/-/label/' . $c_name, 'user/-/label/' . $c_name,
//TODO: Add other tags
), ),
'origin' => array( 'origin' => array(
'streamId' => 'feed/' . $f_id, 'streamId' => 'feed/' . $f_id,
@@ -478,8 +480,9 @@ function entriesToArray($entries) {
//'htmlUrl' => $line['f_website'], //'htmlUrl' => $line['f_website'],
), ),
); );
if ($entry->author() != '') { $author = $entry->authors(true);
$item['author'] = $entry->author(); if ($author != '') {
$item['author'] = $author;
} }
if ($entry->isRead()) { if ($entry->isRead()) {
$item['categories'][] = 'user/-/state/com.google/read'; $item['categories'][] = 'user/-/state/com.google/read';

View File

@@ -731,7 +731,7 @@ function init_shortcuts() {
function init_stream(divStream) { function init_stream(divStream) {
divStream.on('click', '.flux_header,.flux_content', function (e) { //flux_toggle divStream.on('click', '.flux_header,.flux_content', function (e) { //flux_toggle
if ($(e.target).closest('.content, .item.website, .item.link').length > 0) { if ($(e.target).closest('.keep_unread, .content, .item.website, .item.link, .dropdown-menu').length > 0) {
return; return;
} }
if (!context.sides_close_article && $(e.target).is('div.flux_content')) { if (!context.sides_close_article && $(e.target).is('div.flux_content')) {
@@ -788,7 +788,9 @@ function init_stream(divStream) {
}); });
divStream.on('click', '.flux .content a', function () { divStream.on('click', '.flux .content a', function () {
$(this).attr('target', '_blank').attr('rel', 'noreferrer'); if (!$(this).closest('div').hasClass('author')) {
$(this).attr('target', '_blank').attr('rel', 'noreferrer');
}
}); });
if (context.auto_mark_site) { if (context.auto_mark_site) {