Change feed order in a category (#3131)

Before, the sorting was not human readable. Lower-cased feed names were
displayed after upper-cased feed names.
Now, the sorting is human readable. The sorting is done without taking into
account the name case.

See #3128
pull/3148/head
Alexis Degrugillier 4 years ago committed by GitHub
parent c523f5a4e7
commit ee31722072
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      app/Models/FeedDAO.php

@ -357,14 +357,18 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable {
}
public function listByCategory($cat) {
$sql = 'SELECT * FROM `_feed` WHERE category=? ORDER BY name';
$sql = 'SELECT * FROM `_feed` WHERE category=?';
$stm = $this->pdo->prepare($sql);
$values = array($cat);
$stm->execute(array($cat));
$stm->execute($values);
$feeds = self::daoToFeed($stm->fetchAll(PDO::FETCH_ASSOC));
return self::daoToFeed($stm->fetchAll(PDO::FETCH_ASSOC));
usort($feeds, function ($a, $b) {
return strnatcasecmp($a->name(), $b->name());
});
return $feeds;
}
public function countEntries($id) {

Loading…
Cancel
Save