From d5d3f6dcfa21e7defb26f3d470289e957bdb3dde Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 23 Jul 2014 23:56:16 +0200 Subject: Fix bugs in import/export - EntryDAO.php: add a missing "FreshRSS_EntryDAO::" - Fix htmlspecialchars in opml export --- app/Models/EntryDAO.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/Models/EntryDAO.php') diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index 8c001e73b..74b5306e9 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -17,7 +17,9 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { } public function addEntry($valuesTmp, $preparedStatement = null) { - $stm = $preparedStatement === null ? addEntryPrepare() : $preparedStatement; + $stm = $preparedStatement === null ? + FreshRSS_EntryDAO::addEntryPrepare() : + $preparedStatement; $values = array( $valuesTmp['id'], -- cgit v1.2.3 From 65d6796e9244bbc94f5d04cf47723a533b6a5351 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 7 Aug 2014 11:29:19 +0200 Subject: First bug for old articles first https://github.com/marienfressinaud/FreshRSS/issues/495 --- app/Models/EntryDAO.php | 6 +++--- app/Models/EntryDAOSQLite.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'app/Models/EntryDAO.php') diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index 74b5306e9..a9ffa138b 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -175,7 +175,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { public function markReadEntries($idMax = 0, $onlyFavorites = false, $priorityMin = 0) { if ($idMax == 0) { $idMax = time() . '000000'; - Minz_Log::record($nb . 'Calling markReadEntries(0) is deprecated!', Minz_Log::DEBUG); + Minz_Log::record('Calling markReadEntries(0) is deprecated!', Minz_Log::DEBUG); } $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id ' @@ -203,7 +203,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { public function markReadCat($id, $idMax = 0) { if ($idMax == 0) { $idMax = time() . '000000'; - Minz_Log::record($nb . 'Calling markReadCat(0) is deprecated!', Minz_Log::DEBUG); + Minz_Log::record('Calling markReadCat(0) is deprecated!', Minz_Log::DEBUG); } $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id ' @@ -226,7 +226,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { public function markReadFeed($id, $idMax = 0) { if ($idMax == 0) { $idMax = time() . '000000'; - Minz_Log::record($nb . 'Calling markReadFeed(0) is deprecated!', Minz_Log::DEBUG); + Minz_Log::record('Calling markReadFeed(0) is deprecated!', Minz_Log::DEBUG); } $this->bd->beginTransaction(); diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php index 3dabce4b2..9dc395c3c 100644 --- a/app/Models/EntryDAOSQLite.php +++ b/app/Models/EntryDAOSQLite.php @@ -72,7 +72,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO { public function markReadEntries($idMax = 0, $onlyFavorites = false, $priorityMin = 0) { if ($idMax == 0) { $idMax = time() . '000000'; - Minz_Log::record($nb . 'Calling markReadEntries(0) is deprecated!', Minz_Log::DEBUG); + Minz_Log::record('Calling markReadEntries(0) is deprecated!', Minz_Log::DEBUG); } $sql = 'UPDATE `' . $this->prefix . 'entry` SET is_read=1 WHERE is_read=0 AND id <= ?'; @@ -98,7 +98,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO { public function markReadCat($id, $idMax = 0) { if ($idMax == 0) { $idMax = time() . '000000'; - Minz_Log::record($nb . 'Calling markReadCat(0) is deprecated!', Minz_Log::DEBUG); + Minz_Log::record('Calling markReadCat(0) is deprecated!', Minz_Log::DEBUG); } $sql = 'UPDATE `' . $this->prefix . 'entry` ' -- cgit v1.2.3 From 50075bfbdcd6a7be010eb82ce1fffac0ea283de7 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 19 Aug 2014 20:58:18 +0200 Subject: Improvement for ASC order https://github.com/marienfressinaud/FreshRSS/issues/495 --- app/Models/EntryDAO.php | 2 +- app/layout/nav_menu.phtml | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'app/Models/EntryDAO.php') diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index a9ffa138b..488b70fb6 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -230,7 +230,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { } $this->bd->beginTransaction(); - $sql = 'UPDATE `' . $this->prefix . 'entry` ' + $sql = 'UPDATE `' . $this->prefix . 'entry` ' . 'SET is_read=1 ' . 'WHERE id_feed=? AND is_read=0 AND id <= ?'; $values = array($id, $idMax); diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 73a921c5d..25833c16d 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -164,11 +164,15 @@ break; } } - if ($this->order === 'ASC') { - $idMax = 0; - } else { - $p = isset($this->entries[0]) ? $this->entries[0] : null; - $idMax = $p === null ? '0' : $p->id(); + + $p = isset($this->entries[0]) ? $this->entries[0] : null; + $idMax = $p === null ? (time() - 1) . '000000' : $p->id(); + + if ($this->order === 'ASC') { //In this case we do not know but we guess idMax + $idMax2 = (time() - 1) . '000000'; + if (strcmp($idMax2, $idMax) > 0) { + $idMax = $idMax2; + } } $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('get' => $get, 'nextGet' => $nextGet, 'idMax' => $idMax)); -- cgit v1.2.3 From 1316ada15260e8f2fdb486595d5953bef9badc50 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 23 Aug 2014 22:02:22 +0200 Subject: Fix bug add favorite entry See https://github.com/marienfressinaud/FreshRSS/issues/494 --- app/Controllers/importExportController.php | 2 +- app/Models/EntryDAO.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app/Models/EntryDAO.php') diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index b3683f385..5adf3878a 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -284,7 +284,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { $url = $origin[$key]; $name = $origin['title']; $website = $origin['htmlUrl']; - $error = false; + try { // Create a Feed object and add it in DB $feed = new FreshRSS_Feed($url); diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index 488b70fb6..75a8aeba4 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -65,7 +65,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { } if (!isset($existingGuids[$entry->guid()]) && - ($feedHistory != 0 || $eDate >= $date_min)) { + ($feedHistory != 0 || $eDate >= $date_min || $entry->isFavorite())) { $values = $entry->toArray(); $useDeclaredDate = empty($existingGuids); -- cgit v1.2.3