Sort topics Alphabetically

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Scam Warning
User avatar
Volksdevil
Registered User
Posts: 2414
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Sort topics Alphabetically

Post by Volksdevil » Sat Nov 08, 2014 9:49 pm

Hi,

On my old 3.0.12 I had a simple snippet in the viewforum.php file that sorted Alphabetically in chosen forums

Code: Select all

// Sort topics alphabetically
if ($forum_id == 13 || $forum_id == 14 || $forum_id == 22)
{
    $sort_by_text = array('t' => $user->lang['SUBJECT']);
    $sort_by_sql = array('t' => 't.topic_title');
    $sort_dir = 'a';
}
Note the forum ID's ($forum_id == 13 || $forum_id == 14 || $forum_id == 22)

I've just tried it on 3.1.1 and it works perfectly, but is it worth having an extension for this rather than this small tweak to the core php?
Last edited by Volksdevil on Sun Jan 08, 2017 12:51 pm, edited 5 times in total.
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60

User avatar
Volksdevil
Registered User
Posts: 2414
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: Sort topics Alphabetically

Post by Volksdevil » Tue Nov 11, 2014 7:57 pm

Well just in case no extension is made for this, I can confirm that the above code still works on 3.1.1 and now on 3.1.4 and still on 3.1.6
Last edited by Volksdevil on Tue Nov 17, 2015 12:32 am, edited 2 times in total.
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60

divingbrit
Registered User
Posts: 86
Joined: Fri Mar 21, 2003 3:18 pm

Re: Sort topics Alphabetically

Post by divingbrit » Mon Dec 29, 2014 4:24 pm

How many times can I post 'Thank you' that is just what I want to do :D
Shy but working at it

ReinerKnudsen
Registered User
Posts: 6
Joined: Tue Dec 09, 2014 5:29 pm

Re: Sort topics Alphabetically

Post by ReinerKnudsen » Wed Mar 04, 2015 7:27 pm

Hi, thanks for the snippet.

Where exactly in the viewforum.php would I place this code?

Thx. Reiner

User avatar
Volksdevil
Registered User
Posts: 2414
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: Sort topics Alphabetically

Post by Volksdevil » Wed Mar 04, 2015 8:05 pm

Hi,

Add the above code in my first post before:
// Limit topics to certain time frame, obtain correct topic count
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60

ReinerKnudsen
Registered User
Posts: 6
Joined: Tue Dec 09, 2014 5:29 pm

Re: Sort topics Alphabetically

Post by ReinerKnudsen » Thu Mar 05, 2015 9:21 pm

Works like a charm. Thank you ever so much! Whoohoo!

Reiner

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Sort topics Alphabetically

Post by RMcGirr83 » Thu Mar 05, 2015 10:24 pm

I would probably place it before this line

Code: Select all

$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
because gen_sort_selects uses the variables that you are over riding.

There is no event set for changing those variables so no extension is possible.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

divingbrit
Registered User
Posts: 86
Joined: Fri Mar 21, 2003 3:18 pm

Re: Sort topics Alphabetically

Post by divingbrit » Thu Mar 05, 2015 11:18 pm

Thanks again to Volksdevil, but also to RMcGirr83, for explanation why an extension would not be viable.
Shy but working at it

systemcrack
Registered User
Posts: 158
Joined: Thu Jun 24, 2010 4:35 pm
Location: Italy
Contact:

Re: Sort topics Alphabetically

Post by systemcrack » Fri Mar 20, 2015 1:50 pm

Volksdevil wrote:Hi,

On my old 3.0.12 I had a simple snippet in the viewforum.php file that sorted Alphabetically in chosen forums

Code: Select all

// Sort topics alphabetically
if ($forum_id == 13 || $forum_id == 14 || $forum_id == 22)
{
    $sort_by_text = array('t' => $user->lang['SUBJECT']);
    $sort_by_sql = array('t' => 't.topic_title');
    $sort_dir = 'a';
}
Note the forum ID's ($forum_id == [color=#BF0000][b]13[/b][/color] || $forum_id == [color=#BF0000][b]14[/b][/color] || $forum_id == [color=#BF0000][b]22[/b][/color])

I've just tried it on 3.1.1 and it works perfectly, but is it worth having an extension for this rather than this small tweak to the core php?
Excuse me.. I'm not very good with the codes, you could be more specific in describing the process in order to add it too, this change.

P.S.
is it possible to put the alphabetical order by default in all forums without stating the id?
Sorry for my bad English ..

divingbrit
Registered User
Posts: 86
Joined: Fri Mar 21, 2003 3:18 pm

Re: Sort topics Alphabetically

Post by divingbrit » Sat Mar 21, 2015 8:54 am

You need a text editor, I use Notepad++, you must not use something like 'word' if you look at https://www.phpbb.com/mods/installing/ which gives you an overview.
So you change a file, then upload it via ftp, and overwrite the original file

As for "is it possible to put the alphabetical order by default in all forums without stating the id?" that would be nice, but I did change 79 forums

// Sort topics alphabetically
if ($forum_id == 15 || $forum_id == 16 || $forum_id == 17|| $forum_id == 18|| $forum_id == 21|| $forum_id == 22|| $forum_id == 23|| $forum_id == 24|| $forum_id == 25|| $forum_id == 26|| $forum_id == 27|| $forum_id == 28|| $forum_id == 29|| $forum_id == 30|| $forum_id == 31| etc etc etc
Shy but working at it

systemcrack
Registered User
Posts: 158
Joined: Thu Jun 24, 2010 4:35 pm
Location: Italy
Contact:

Re: Sort topics Alphabetically

Post by systemcrack » Sat Mar 21, 2015 4:08 pm

divingbrit wrote:You need a text editor, I use Notepad++, you must not use something like 'word' if you look at https://www.phpbb.com/mods/installing/ which gives you an overview.
So you change a file, then upload it via ftp, and overwrite the original file

As for "is it possible to put the alphabetical order by default in all forums without stating the id?" that would be nice, but I did change 79 forums

// Sort topics alphabetically
if ($forum_id == 15 || $forum_id == 16 || $forum_id == 17|| $forum_id == 18|| $forum_id == 21|| $forum_id == 22|| $forum_id == 23|| $forum_id == 24|| $forum_id == 25|| $forum_id == 26|| $forum_id == 27|| $forum_id == 28|| $forum_id == 29|| $forum_id == 30|| $forum_id == 31| etc etc etc
:lol: ok thank's... maybe I had not explained well.. I know how to install a mod, I have a forum for 2 years.. I wanted to know which file to add the code, and where in the file enter the code.

Edit:
Only now I see that he speak of the file viewforum.php

Sorry... my bad english
Sorry for my bad English ..

MadCon88
Registered User
Posts: 17
Joined: Mon Apr 13, 2015 3:14 pm

Re: Sort topics Alphabetically

Post by MadCon88 » Mon Apr 13, 2015 3:20 pm

This would be great as extension, please someone...

https://www.phpbb.com/customise/db/mod/ ... betically/ ( viewtopic.php?t=981865 )

systemcrack
Registered User
Posts: 158
Joined: Thu Jun 24, 2010 4:35 pm
Location: Italy
Contact:

Re: Sort topics Alphabetically

Post by systemcrack » Mon Apr 13, 2015 8:40 pm

+1
Sorry for my bad English ..

systemcrack
Registered User
Posts: 158
Joined: Thu Jun 24, 2010 4:35 pm
Location: Italy
Contact:

Re: Sort topics Alphabetically

Post by systemcrack » Thu Apr 23, 2015 12:56 pm

sorry error.. delete
Last edited by systemcrack on Thu Apr 23, 2015 12:57 pm, edited 1 time in total.
Sorry for my bad English ..

systemcrack
Registered User
Posts: 158
Joined: Thu Jun 24, 2010 4:35 pm
Location: Italy
Contact:

Re: Sort topics Alphabetically

Post by systemcrack » Thu Apr 23, 2015 12:56 pm

Sorry for my bad English ..

Post Reply

Return to “Extension Requests”