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)
Get Involved
User avatar
Volksdevil
Registered User
Posts: 2415
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Sort topics Alphabetically

Post by Volksdevil »

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 :arrow: KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Twitch | My Volkswagen Corrado G60
User avatar
Volksdevil
Registered User
Posts: 2415
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: Sort topics Alphabetically

Post by Volksdevil »

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 :arrow: KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Twitch | My Volkswagen Corrado G60
divingbrit
Registered User
Posts: 86
Joined: Fri Mar 21, 2003 3:18 pm

Re: Sort topics Alphabetically

Post by divingbrit »

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 »

Hi, thanks for the snippet.

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

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

Re: Sort topics Alphabetically

Post by Volksdevil »

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 :arrow: KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Twitch | My Volkswagen Corrado G60
ReinerKnudsen
Registered User
Posts: 6
Joined: Tue Dec 09, 2014 5:29 pm

Re: Sort topics Alphabetically

Post by ReinerKnudsen »

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

Reiner
User avatar
RMcGirr83
Former Team Member
Posts: 22016
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Sort topics Alphabetically

Post by RMcGirr83 »

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.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
divingbrit
Registered User
Posts: 86
Joined: Fri Mar 21, 2003 3:18 pm

Re: Sort topics Alphabetically

Post by divingbrit »

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 »

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 »

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 »

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 »

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 »

+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 »

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 »

Sorry for my bad English ..
Post Reply

Return to “Extension Requests”