Welcome to Geeklog, Anonymous Monday, December 23 2024 @ 04:24 am EST

Geeklog Forums

Alphabetically Sorting Articles


Ryan B.

Anonymous
Is there a way to alphabetically sort articles?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Only if you change the code. And sort by what?

In index.php, there is a line that reads
Text Formatted Code
$sql .= "ORDER BY featured DESC, date DESC";
 
If you change that to, say,
Text Formatted Code
$sql .= "ORDER BY featured DESC, title ASC";
 
then it would sort the stories by their title (with the featured story still on top).

bye, Dirk
 Quote

Ryan B.

Anonymous
Is there a way to only do it on certain pages?
 Quote

Status: offline

Euan

Forum User
Full Member
Registered: 04/22/02
Posts: 292
If you coded in Dirk's comment above, with some check for, say, topic, then hacked the topic editor to allow an extra field for sort order for that topic by date, alphabetically, etc. you could have different sorting for each topic. Would require a bit of knowledge of PHP and an extra field on one core table though.

Cheers,

Euan.
-- Heather Engineering
-- No job too small
 Quote

Status: offline

pezastic

Forum User
Newbie
Registered: 09/28/04
Posts: 9
Is there a way to alphabetically sort the topics themselves?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Text Formatted Code
// Topics can be assigned a sort number so that you can control what order they
// appear in the 'Topics' block on the homepage.  If you prefer you can also  
// have this sort alphabetically by changing the value to 'alpha' (default is  
// by 'sortnum'

$_CONF['sortmethod'] = 'sortnum'; // or 'alpha'
 
 Quote

All times are EST. The time is now 04:24 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content