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
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
// 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']);
}
// 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
// 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']);
}
// 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']);
}
Not exactly what you need but there is this mod:
http://custom.simplemachines.org/mods/index.php?mod=1459
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
// 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']);
}
// 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
// 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']);
}
// 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
Try this
// 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']);
}
// 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']);
}
sorry but it doesnt work :/
Actually what i gave you here
http://www.simplemachines.org/community/index.php?topic=310175.msg2057761#msg2057761
should work,i've tested on my site and it works fine !
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.
Sven17, is this issue now resolved?
Have you tried doing what Duncan85 suggested?