Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: Reorder Articles in a Category  (Read 2340 times)

birgi

  • Newbie
  • *
  • Karma: 0
  • Posts: 12
Reorder Articles in a Category
« on: June 20, 2007, 10:16:32 pm »

Hi everyone,

Is it possible to reorder articles in a category?

It looks like sNews currently displays the articles ascending in order of date posted. (Most recent at the bottom).

I would like to have the most recent articles show up at the top.

Please let me know how...
Logged

bramsyuur

  • Hero Member
  • *****
  • Karma: 23
  • Posts: 873
    • http://snews.vietbee.net
Reorder Articles in a Category
« Reply #1 on: June 21, 2007, 12:07:44 am »

In sNews, by default, the contents of any category (including home) are displayed in descending (DESC) manner like:
Quote
... ORDER BY date DESC";
And, if you're using this mod: http://www.solucija.com/forum/viewtopic.php?pid=33340#p33340
you need to modify this line:
Quote
$query = "SELECT * FROM ".db('prefix')."articles WHERE position = 1 AND category = $categoryName AND published = 1";
to:
Quote
$query = "SELECT * FROM ".db('prefix')."articles WHERE position = 1 AND category = $categoryName AND published = 1 ORDER BY date DESC";
« Last Edit: August 22, 2007, 01:31:15 am by Phil Martin »
Logged
La comunidad sNews en tu idioma!
Comunidad sNews en Espaņol

Joost

  • Guest
Reorder Articles in a Category
« Reply #2 on: June 21, 2007, 12:12:20 am »

By default most recent articles are displayed at the top and it is not possible to change that through the admin panel. It requires modding.
Logged

birgi

  • Newbie
  • *
  • Karma: 0
  • Posts: 12
Reorder Articles in a Category
« Reply #3 on: June 27, 2007, 04:17:22 pm »

Fixed it thanks for the solution!
Logged

lessismore

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 67
Reorder Articles in a Category
« Reply #4 on: August 11, 2007, 11:51:29 am »

One can re-order articles in a category by clicking on the "Publish Date", checking the "Enable" box and modifying the date/time (at least in snews 1.6).

I doubt if back-dating was the intended use of this feature because of the "Enable" checkbox - but it appears to work - the "enable" goes away after backdating - cool - probably just a "one-time" trivial performance hit to back-date.

Intuitive - beats a mod or phpmyadmin date hacking.

Warning - I have only two days experience with snews 1.6 - rookie alert.
Logged