News:

Wondering if this will always be free?  See why free is better.

Main Menu

how to make my topics to be generated alphabetical?

Started by Sven17, May 13, 2009, 08:43:17 AM

Previous topic - Next topic

Sven17

how to make my topics to be generated alphabetical?
e.g

A topic
B topic
C Topic

and not by the newest to older
for all users

Kermit

Quote from: Sven17 on May 13, 2009, 08:43:17 AM
how to make my topics to be generated alphabetical?
e.g

A topic
B topic
C Topic

and not by the newest to older
for all users


To achieve both of them is not possible,also either you should sort them alphabetical or from the oldest to the newest

For an alphabetical sort,you can do this

in ./Sources/MessageIndex.php

Code (find) Select

// They didn't pick one, default to by last post descending.
if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
{
$context['sort_by'] = 'last_post';
$_REQUEST['sort'] = 'ID_LAST_MSG';
$ascending = isset($_REQUEST['asc']);
}


Code (replace with) Select

// They didn't pick one, default to by last post descending.
if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
{
$context['sort_by'] = 'subject';
$_REQUEST['sort'] = 'mf.subject';
$ascending = !isset($_REQUEST['desc']);
}






for the oldest to the newest

Code (find) Select

   // They didn't pick one, default to by last post descending.
   if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
   {
      $context['sort_by'] = 'last_post';
      $_REQUEST['sort'] = 'ID_LAST_MSG';
      $ascending = isset($_REQUEST['asc']);
   }



Code (replace with) Select

   // They didn't pick one, default to by last post descending.
   if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
{
$context['sort_by'] = 'first_post';
$_REQUEST['sort'] = 'ID_TOPIC';
$ascending = isset($_REQUEST['asc']);
}
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein


Sven17

Quote from: Duncan85 on May 13, 2009, 10:09:52 AM

To achieve both of them is not possible,also either you should sort them alphabetical or from the oldest to the newest

For an alphabetical sort,you can do this

in ./Sources/MessageIndex.php

Code (find) Select

// They didn't pick one, default to by last post descending.
if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
{
$context['sort_by'] = 'last_post';
$_REQUEST['sort'] = 'ID_LAST_MSG';
$ascending = isset($_REQUEST['asc']);
}


Code (replace with) Select

// They didn't pick one, default to by last post descending.
if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
{
$context['sort_by'] = 'subject';
$_REQUEST['sort'] = 'mf.subject';
$ascending = !isset($_REQUEST['desc']);
}






for the oldest to the newest

Code (find) Select

   // They didn't pick one, default to by last post descending.
   if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
   {
      $context['sort_by'] = 'last_post';
      $_REQUEST['sort'] = 'ID_LAST_MSG';
      $ascending = isset($_REQUEST['asc']);
   }



Code (replace with) Select

   // They didn't pick one, default to by last post descending.
   if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
{
$context['sort_by'] = 'first_post';
$_REQUEST['sort'] = 'ID_TOPIC';
$ascending = isset($_REQUEST['asc']);
}

Thanks man that works,but it sorts them this way:

D
C
B
A

Can you make it

A
B
C
D

I tryed to change the 'desc' to 'asc' but it doesnt work

Kermit

Try this

Code (find) Select

   // They didn't pick one, default to by last post descending.
   if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
   {
      $context['sort_by'] = 'subject';
      $_REQUEST['sort'] = 'mf.subject';
      $ascending = !isset($_REQUEST['desc']);
   }


Code (replace with) Select

   // They didn't pick one, default to by last post descending.
   if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
   {
      $context['sort_by'] = 'subject';
      $_REQUEST['sort'] = 'mf.subject';
      $ascending = isset($_REQUEST['asc']);
   }
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

Sven17


Kermit

My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

Blinker

This mod allows you to sort alphabetically - http://custom.simplemachines.org/mods/index.php?mod=965

I can't remember if you can force a global setting, pretty sure it's user choice only but check it out.

JBlaze

Sven17, is this issue now resolved?

Have you tried doing what Duncan85 suggested?
Jason Clemons
Former Team Member 2009 - 2012

Advertisement: