mirror of
https://github.com/YunoHost-Apps/freshrss_ynh.git
synced 2024-09-03 18:36:33 +02:00
[enh] update to 0.8.1
This commit is contained in:
parent
c6d61d6f90
commit
b135694ce8
17 changed files with 100 additions and 30 deletions
|
@ -1,6 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
#backup data folder
|
#backup data folder
|
||||||
final_path=/var/www/freshrss
|
final_path=/var/www/freshrss
|
||||||
sudo cp -a $final_path/data /tmp/freshrss-data.bak
|
sudo cp -a $final_path/data /tmp/freshrss-data.bak
|
||||||
|
|
|
@ -1,5 +1,20 @@
|
||||||
# Journal des modifications
|
# Journal des modifications
|
||||||
|
|
||||||
|
## 2014-10-09 FreshRSS 0.8.1 / 0.9.1 (beta)
|
||||||
|
|
||||||
|
* UI
|
||||||
|
* Add a space after tag icon
|
||||||
|
* Statistics
|
||||||
|
* Add an average per day on the 30 day period graph
|
||||||
|
* Add percent of total on top 10 feed
|
||||||
|
* Bug fixes
|
||||||
|
* Fix "mark as read" in global view
|
||||||
|
* Fix "read all" shortcut
|
||||||
|
* Fix categories not appearing when adding a new feed (GET action)
|
||||||
|
* Fix enclosure problem
|
||||||
|
* Fix getExtension() on PHP < 5.3.7
|
||||||
|
|
||||||
|
|
||||||
## 2014-09-26 FreshRSS 0.8.0 / 0.9.0 (beta)
|
## 2014-09-26 FreshRSS 0.8.0 / 0.9.0 (beta)
|
||||||
|
|
||||||
* UI
|
* UI
|
||||||
|
|
|
@ -10,8 +10,8 @@ Il permet de gérer plusieurs utilisateurs, et dispose d’un mode de lecture an
|
||||||
* Site officiel : http://freshrss.org
|
* Site officiel : http://freshrss.org
|
||||||
* Démo : http://demo.freshrss.org/
|
* Démo : http://demo.freshrss.org/
|
||||||
* Développeur : Marien Fressinaud <dev@marienfressinaud.fr>
|
* Développeur : Marien Fressinaud <dev@marienfressinaud.fr>
|
||||||
* Version actuelle : 0.8.0
|
* Version actuelle : 0.8.1
|
||||||
* Date de publication 2014-09-26
|
* Date de publication : 2014-10-09
|
||||||
* License [GNU AGPL 3](http://www.gnu.org/licenses/agpl-3.0.html)
|
* License [GNU AGPL 3](http://www.gnu.org/licenses/agpl-3.0.html)
|
||||||
|
|
||||||
![Logo de FreshRSS](http://marienfressinaud.fr/data/images/freshrss/freshrss_title.png)
|
![Logo de FreshRSS](http://marienfressinaud.fr/data/images/freshrss/freshrss_title.png)
|
||||||
|
|
|
@ -10,8 +10,8 @@ It is a multi-user application with an anonymous reading mode.
|
||||||
* Official website: http://freshrss.org
|
* Official website: http://freshrss.org
|
||||||
* Demo: http://demo.freshrss.org/
|
* Demo: http://demo.freshrss.org/
|
||||||
* Developer: Marien Fressinaud <dev@marienfressinaud.fr>
|
* Developer: Marien Fressinaud <dev@marienfressinaud.fr>
|
||||||
* Current version: 0.8.0
|
* Current version: 0.8.1
|
||||||
* Publication date: 2014-09-26
|
* Publication date: 2014-10-09
|
||||||
* License [GNU AGPL 3](http://www.gnu.org/licenses/agpl-3.0.html)
|
* License [GNU AGPL 3](http://www.gnu.org/licenses/agpl-3.0.html)
|
||||||
|
|
||||||
![FreshRSS logo](http://marienfressinaud.fr/data/images/freshrss/freshrss_title.png)
|
![FreshRSS logo](http://marienfressinaud.fr/data/images/freshrss/freshrss_title.png)
|
||||||
|
|
|
@ -171,7 +171,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
|
||||||
|
|
||||||
// GET request so we must ask confirmation to user
|
// GET request so we must ask confirmation to user
|
||||||
Minz_View::prependTitle(Minz_Translate::t('add_rss_feed') . ' · ');
|
Minz_View::prependTitle(Minz_Translate::t('add_rss_feed') . ' · ');
|
||||||
$this->view->categories = $this->catDAO->listCategories();
|
$this->view->categories = $this->catDAO->listCategories(false);
|
||||||
$this->view->feed = new FreshRSS_Feed($url);
|
$this->view->feed = new FreshRSS_Feed($url);
|
||||||
try {
|
try {
|
||||||
// We try to get some more information about the feed
|
// We try to get some more information about the feed
|
||||||
|
|
|
@ -330,7 +330,8 @@ class FreshRSS_index_Controller extends Minz_ActionController {
|
||||||
private static function purgeTokens() {
|
private static function purgeTokens() {
|
||||||
$oldest = time() - 2629744; //1 month //TODO: Use a configuration instead
|
$oldest = time() - 2629744; //1 month //TODO: Use a configuration instead
|
||||||
foreach (new DirectoryIterator(DATA_PATH . '/tokens/') as $fileInfo) {
|
foreach (new DirectoryIterator(DATA_PATH . '/tokens/') as $fileInfo) {
|
||||||
if ($fileInfo->getExtension() === 'txt' && $fileInfo->getMTime() < $oldest) {
|
$extension = pathinfo($fileInfo->getFilename(), PATHINFO_EXTENSION);
|
||||||
|
if ($extension === 'txt' && $fileInfo->getMTime() < $oldest) {
|
||||||
@unlink($fileInfo->getPathname());
|
@unlink($fileInfo->getPathname());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
|
||||||
Minz_View::appendScript(Minz_Url::display('/scripts/flotr2.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/flotr2.min.js')));
|
Minz_View::appendScript(Minz_Url::display('/scripts/flotr2.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/flotr2.min.js')));
|
||||||
$this->view->repartition = $statsDAO->calculateEntryRepartition();
|
$this->view->repartition = $statsDAO->calculateEntryRepartition();
|
||||||
$this->view->count = $statsDAO->calculateEntryCount();
|
$this->view->count = $statsDAO->calculateEntryCount();
|
||||||
|
$this->view->average = $statsDAO->calculateEntryAverage();
|
||||||
$this->view->feedByCategory = $statsDAO->calculateFeedByCategory();
|
$this->view->feedByCategory = $statsDAO->calculateFeedByCategory();
|
||||||
$this->view->entryByCategory = $statsDAO->calculateEntryByCategory();
|
$this->view->entryByCategory = $statsDAO->calculateEntryByCategory();
|
||||||
$this->view->topFeed = $statsDAO->calculateTopFeed();
|
$this->view->topFeed = $statsDAO->calculateTopFeed();
|
||||||
|
|
|
@ -288,6 +288,8 @@ class FreshRSS_Feed extends Minz_Model {
|
||||||
$content .= '<br /><audio lazyload="" postpone="" preload="none" src="' . $elink . '" controls="controls" />';
|
$content .= '<br /><audio lazyload="" postpone="" preload="none" src="' . $elink . '" controls="controls" />';
|
||||||
} elseif (strpos($mime, 'video/') === 0) {
|
} elseif (strpos($mime, 'video/') === 0) {
|
||||||
$content .= '<br /><video lazyload="" postpone="" preload="none" src="' . $elink . '" controls="controls" />';
|
$content .= '<br /><video lazyload="" postpone="" preload="none" src="' . $elink . '" controls="controls" />';
|
||||||
|
} else {
|
||||||
|
unset($elinks[$elink]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,6 +79,27 @@ SQL;
|
||||||
return $this->convertToSerie($count);
|
return $this->convertToSerie($count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates entry average per day on a 30 days period.
|
||||||
|
*
|
||||||
|
* @return integer
|
||||||
|
*/
|
||||||
|
public function calculateEntryAverage() {
|
||||||
|
$period = self::ENTRY_COUNT_PERIOD;
|
||||||
|
|
||||||
|
// Get stats per day for the last 30 days
|
||||||
|
$sql = <<<SQL
|
||||||
|
SELECT COUNT(1) / {$period} AS average
|
||||||
|
FROM {$this->prefix}entry AS e
|
||||||
|
WHERE FROM_UNIXTIME(e.date, '%Y%m%d') BETWEEN DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -{$period} DAY), '%Y%m%d') AND DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -1 DAY), '%Y%m%d')
|
||||||
|
SQL;
|
||||||
|
$stm = $this->bd->prepare($sql);
|
||||||
|
$stm->execute();
|
||||||
|
$res = $stm->fetch(PDO::FETCH_NAMED);
|
||||||
|
|
||||||
|
return round($res['average'], 2);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize an array for the entry count.
|
* Initialize an array for the entry count.
|
||||||
*
|
*
|
||||||
|
|
|
@ -34,6 +34,29 @@ SQL;
|
||||||
return $this->convertToSerie($count);
|
return $this->convertToSerie($count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates entry average per day on a 30 days period.
|
||||||
|
*
|
||||||
|
* @return integer
|
||||||
|
*/
|
||||||
|
public function calculateEntryAverage() {
|
||||||
|
$period = self::ENTRY_COUNT_PERIOD;
|
||||||
|
|
||||||
|
// Get stats per day for the last 30 days
|
||||||
|
$sql = <<<SQL
|
||||||
|
SELECT COUNT(1) / {$period} AS average
|
||||||
|
FROM {$this->prefix}entry AS e
|
||||||
|
WHERE strftime('%Y%m%d', e.date, 'unixepoch')
|
||||||
|
BETWEEN strftime('%Y%m%d', 'now', '-{$period} days')
|
||||||
|
AND strftime('%Y%m%d', 'now', '-1 day')
|
||||||
|
SQL;
|
||||||
|
$stm = $this->bd->prepare($sql);
|
||||||
|
$stm->execute();
|
||||||
|
$res = $stm->fetch(PDO::FETCH_NAMED);
|
||||||
|
|
||||||
|
return round($res['average'], 2);
|
||||||
|
}
|
||||||
|
|
||||||
protected function calculateEntryRepartitionPerFeedPerPeriod($period, $feed = null) {
|
protected function calculateEntryRepartitionPerFeedPerPeriod($period, $feed = null) {
|
||||||
if ($feed) {
|
if ($feed) {
|
||||||
$restrict = "WHERE e.id_feed = {$feed}";
|
$restrict = "WHERE e.id_feed = {$feed}";
|
||||||
|
|
|
@ -56,6 +56,7 @@ return array (
|
||||||
'stats_entry_per_hour' => 'Per hour',
|
'stats_entry_per_hour' => 'Per hour',
|
||||||
'stats_entry_per_day_of_week' => 'Per day of week',
|
'stats_entry_per_day_of_week' => 'Per day of week',
|
||||||
'stats_entry_per_month' => 'Per month',
|
'stats_entry_per_month' => 'Per month',
|
||||||
|
'stats_percent_of_total' => '%% of total',
|
||||||
|
|
||||||
'last_week' => 'Last week',
|
'last_week' => 'Last week',
|
||||||
'last_month' => 'Last month',
|
'last_month' => 'Last month',
|
||||||
|
|
|
@ -56,6 +56,7 @@ return array (
|
||||||
'stats_entry_per_hour' => 'Par heure',
|
'stats_entry_per_hour' => 'Par heure',
|
||||||
'stats_entry_per_day_of_week' => 'Par jour de la semaine',
|
'stats_entry_per_day_of_week' => 'Par jour de la semaine',
|
||||||
'stats_entry_per_month' => 'Par mois',
|
'stats_entry_per_month' => 'Par mois',
|
||||||
|
'stats_percent_of_total' => '%% du total',
|
||||||
|
|
||||||
'last_week' => 'Depuis la semaine dernière',
|
'last_week' => 'Depuis la semaine dernière',
|
||||||
'last_month' => 'Depuis le mois dernier',
|
'last_month' => 'Depuis le mois dernier',
|
||||||
|
|
|
@ -154,8 +154,9 @@ if (!empty($this->entries)) {
|
||||||
?><li class="item">
|
?><li class="item">
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<div id="dropdown-tags-<?php echo $item->id();?>" class="dropdown-target"></div>
|
<div id="dropdown-tags-<?php echo $item->id();?>" class="dropdown-target"></div>
|
||||||
|
<?php echo _i('tag'); ?>
|
||||||
<a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id();?>"><?php
|
<a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id();?>"><?php
|
||||||
echo FreshRSS_Themes::icon('tag'), Minz_Translate::t ('related_tags');
|
echo _t('related_tags');
|
||||||
?></a>
|
?></a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li class="dropdown-close"><a href="#close">❌</a></li><?php
|
<li class="dropdown-close"><a href="#close">❌</a></li><?php
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
<th><?php echo _t ('feed'); ?></th>
|
<th><?php echo _t ('feed'); ?></th>
|
||||||
<th><?php echo _t ('category'); ?></th>
|
<th><?php echo _t ('category'); ?></th>
|
||||||
<th><?php echo _t ('stats_entry_count'); ?></th>
|
<th><?php echo _t ('stats_entry_count'); ?></th>
|
||||||
|
<th><?php echo _t ('stats_percent_of_total'); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -56,6 +57,7 @@
|
||||||
<td><a href="<?php echo _url('stats', 'repartition', 'id', $feed['id']); ?>"><?php echo $feed['name']; ?></a></td>
|
<td><a href="<?php echo _url('stats', 'repartition', 'id', $feed['id']); ?>"><?php echo $feed['name']; ?></a></td>
|
||||||
<td><?php echo $feed['category']; ?></td>
|
<td><?php echo $feed['category']; ?></td>
|
||||||
<td class="numeric"><?php echo formatNumber($feed['count']); ?></td>
|
<td class="numeric"><?php echo formatNumber($feed['count']); ?></td>
|
||||||
|
<td class="numeric"><?php echo formatNumber($feed['count'] / $this->repartition['all_feeds']['total'] * 100, 1);?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach;?>
|
<?php endforeach;?>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -91,12 +93,22 @@ function initStats() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Entry per day
|
// Entry per day
|
||||||
|
var avg = [];
|
||||||
|
for (var i = -31; i <= 0; i++) {
|
||||||
|
avg.push([i, <?php echo $this->average?>]);
|
||||||
|
}
|
||||||
Flotr.draw(document.getElementById('statsEntryPerDay'),
|
Flotr.draw(document.getElementById('statsEntryPerDay'),
|
||||||
[<?php echo $this->count ?>],
|
[{
|
||||||
|
data: <?php echo $this->count ?>,
|
||||||
|
bars: {horizontal: false, show: true}
|
||||||
|
},{
|
||||||
|
data: avg,
|
||||||
|
lines: {show: true},
|
||||||
|
label: "<?php echo $this->average?>"
|
||||||
|
}],
|
||||||
{
|
{
|
||||||
grid: {verticalLines: false},
|
grid: {verticalLines: false},
|
||||||
bars: {horizontal: false, show: true},
|
xaxis: {noTicks: 6, showLabels: false, tickDecimals: 0, min: -30.75, max: -0.25},
|
||||||
xaxis: {noTicks: 6, showLabels: false, tickDecimals: 0},
|
|
||||||
yaxis: {min: 0},
|
yaxis: {min: 0},
|
||||||
mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}}
|
mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}}
|
||||||
});
|
});
|
||||||
|
|
|
@ -67,7 +67,7 @@ function initStats() {
|
||||||
}, {
|
}, {
|
||||||
data: avg_h,
|
data: avg_h,
|
||||||
lines: {show: true},
|
lines: {show: true},
|
||||||
label: <?php echo $this->averageHour?>,
|
label: "<?php echo $this->averageHour?>",
|
||||||
yaxis: 2
|
yaxis: 2
|
||||||
}],
|
}],
|
||||||
{
|
{
|
||||||
|
@ -96,7 +96,7 @@ function initStats() {
|
||||||
}, {
|
}, {
|
||||||
data: avg_dow,
|
data: avg_dow,
|
||||||
lines: {show: true},
|
lines: {show: true},
|
||||||
label: <?php echo $this->averageDayOfWeek?>,
|
label: "<?php echo $this->averageDayOfWeek?>",
|
||||||
yaxis: 2
|
yaxis: 2
|
||||||
}],
|
}],
|
||||||
{
|
{
|
||||||
|
@ -126,7 +126,7 @@ function initStats() {
|
||||||
}, {
|
}, {
|
||||||
data: avg_m,
|
data: avg_m,
|
||||||
lines: {show: true},
|
lines: {show: true},
|
||||||
label: <?php echo $this->averageMonth?>,
|
label: "<?php echo $this->averageMonth?>",
|
||||||
yaxis: 2
|
yaxis: 2
|
||||||
}],
|
}],
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
define('FRESHRSS_VERSION', '0.8.0');
|
define('FRESHRSS_VERSION', '0.8.1');
|
||||||
define('FRESHRSS_WEBSITE', 'http://freshrss.org');
|
define('FRESHRSS_WEBSITE', 'http://freshrss.org');
|
||||||
define('FRESHRSS_UPDATE_WEBSITE', 'https://update.freshrss.org?v=' . FRESHRSS_VERSION);
|
define('FRESHRSS_UPDATE_WEBSITE', 'https://update.freshrss.org?v=' . FRESHRSS_VERSION);
|
||||||
define('FRESHRSS_WIKI', 'http://doc.freshrss.org');
|
define('FRESHRSS_WIKI', 'http://doc.freshrss.org');
|
||||||
|
|
|
@ -33,7 +33,7 @@ function needsScroll($elem) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function str2int(str) {
|
function str2int(str) {
|
||||||
if (str == '') {
|
if (str == '' || str === undefined) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return parseInt(str.replace(/\D/g, ''), 10) || 0;
|
return parseInt(str.replace(/\D/g, ''), 10) || 0;
|
||||||
|
@ -538,14 +538,7 @@ function init_shortcuts() {
|
||||||
});
|
});
|
||||||
shortcut.add("shift+" + shortcuts.mark_read, function () {
|
shortcut.add("shift+" + shortcuts.mark_read, function () {
|
||||||
// on marque tout comme lu
|
// on marque tout comme lu
|
||||||
var btn = $(".nav_menu .read_all");
|
$(".nav_menu .read_all").click();
|
||||||
if (btn.hasClass('confirm')) {
|
|
||||||
if (confirm(str_confirmation)) {
|
|
||||||
btn.click();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
btn.click();
|
|
||||||
}
|
|
||||||
}, {
|
}, {
|
||||||
'disable_in_input': true
|
'disable_in_input': true
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue