Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Anguz on October 05, 2004, 09:52:23 PM

Title: Board Default Sort
Post by: Anguz on October 05, 2004, 09:52:23 PM
Link to Mod (http://mods.simplemachines.org/index.php?mod=37)

This mod allows you to set a different topic sorting for a board than the forum's default. It also sticks for the session, custom sorting a visitor does.
Title: Re: Board Default Sort
Post by: ADoomedMarine on October 06, 2004, 12:45:40 PM
I don't know if it's just me but it won't work on RC1 (blank white screen on all forums, instead of the forums).

Is this a RC2 only feature?  If so is there anyway to make one for RC1.. I've customised RC1 so much I don't know if it's possible for me to upgrade and I really need this feature.
Title: Re: Board Default Sort
Post by: Anguz on October 06, 2004, 01:40:06 PM
In the mod's page it's specified it's for RC2. I had not tried it with RC1. It is possible to make it work, but I haven't looked into it, so I'm not sure how much it'd need to be changed. I'll check it out and post here.
Title: Re: Board Default Sort
Post by: ADoomedMarine on October 06, 2004, 02:10:44 PM
Thanks :)
Title: Re: Board Default Sort
Post by: Anguz on October 06, 2004, 03:35:00 PM
For RC1, try this. Extract the mod files from the archive do the following changes in a text editor:


<edit file>
modification.xml
</edit file>

<search for>
<search position="before"><![CDATA[b.boardOrder, b.countPosts, b.memberGroups, b.ID_THEME, b.override_theme,
]]></search>
</search for>

<replace>
<search position="before"><![CDATA[b.ID_THEME, b.override_theme,
]]></search>
</replace>


All the other steps of the mod should go in without errors in RC1. Let me know how it goes.

Re-package the files, it can be .tar.gz or .zip (just the files, not the folder with the files).
Title: Re: Board Default Sort
Post by: ADoomedMarine on October 06, 2004, 03:49:45 PM
It says this when I go to install it:

Execute Modification     ./Themes/default/MessageIndex.template.php     Failure

Any idea why? The file is chmodded to 777 correct .. all the rest of the files are a success.
Title: Re: Board Default Sort
Post by: Anguz on October 06, 2004, 05:25:15 PM
It should work fine with an unmodified RC1 copy of that file. Perhaps one of your modifications is affecting the installation. Could you paste inside code tags the block between

// Are there actually any topics to show?


and

// Show a "select all" box for quick moderation?


please?
Title: Re: Board Default Sort
Post by: ADoomedMarine on October 06, 2004, 11:25:08 PM
Here we go:

if (!empty($context['topics']))
{
echo '
<td width="9%" colspan="2"></td>
<td><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[70], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
<td width="14%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=starter', $context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[109], $context['sort_by'] == 'starter' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
<td width="4%" align="center"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[110], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
<td width="4%" align="center"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[301], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
<td width="22%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[111], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>';
Title: Re: Board Default Sort
Post by: Anguz on October 06, 2004, 11:41:47 PM
That's odd, it should apply the modification fine. Oh well, you can do it by hand. Use this:

if (!empty($context['topics']))
{
echo '
<td width="9%" colspan="2">', ($context['sort_default'] ? '<a href="' . $scripturl . '?board=' . $context['current_board'] . '.' . $context['start'] . ';sort=default">' . $txt['sort_default'] . '</a>' : ''), '</td>
<td><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : ';asc', '">', $txt[70], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
<td width="14%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=starter', $context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ? ';desc' : ';asc', '">', $txt[109], $context['sort_by'] == 'starter' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
<td width="4%" align="center"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : ';asc', '">', $txt[110], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
<td width="4%" align="center"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : ';asc', '">', $txt[301], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
<td width="22%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : ';asc', '">', $txt[111], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>';
Title: Re: Board Default Sort
Post by: ADoomedMarine on October 07, 2004, 04:35:38 AM
Hmm.. still doesn't work.. I make the change to the MessageIndex file by hand and proceed with the other changes on the other files.. but it just shows up a blank page as well.

It might not work well with the custom changes I've done.

Basically all I want this mod for is to sort a specific board by "First post  . . . Time the topic's first message was posted." -- just for the boardNews forum the SSI is pulling from.
Title: Re: Board Default Sort
Post by: Anguz on October 07, 2004, 06:50:18 PM
Then read this topic in Tips and Tricks:

http://www.simplemachines.org/community/index.php?topic=16514.0

In [Unknown]'s code, just change 'subject' to 'first_post' and put the ID for the board you are referring to where he wrote BOARD ID HERE!!.

Title: Re: Board Default Sort
Post by: ADoomedMarine on October 08, 2004, 02:16:22 AM
How do I make it so newest topics are on the top though rather then at the bottom?
Title: Re: Board Default Sort
Post by: Anguz on October 08, 2004, 03:43:36 AM
Try this:

if ($board == BOARD ID HERE!!)
{
if (!isset($_REQUEST['sort']))
$_REQUEST['sort'] = 'first_post';
if (!isset($_REQUEST['desc']))
$_REQUEST['asc'] = '';
}
Title: Re: Board Default Sort
Post by: ADoomedMarine on October 08, 2004, 08:04:00 AM
I wanted something like this:

if ($board == 38)
{
if (!isset($_REQUEST['sort']))
$_REQUEST['sort'] = 'first_post';
if (!isset($_REQUEST['asc']))
$_REQUEST['desc'] = '';
}


But yeah as you can see easy fix ;) Works excellent, thanks!! :)
Title: Re: Board Default Sort
Post by: Anguz on October 08, 2004, 04:48:02 PM
Great :)

BTW, that will always sort your board desc, is that what you want? You have the problem that links to sort asc in the MessageIndex template don't have the asc value in the URL, it was assumed. So you need to add that ;asc part when it's not ;desc.
Title: Re: Board Default Sort
Post by: ADoomedMarine on October 08, 2004, 11:33:56 PM
Yeah it'll need to always be sorted like that.  It's the only board that does really, just want it sorted so newest at the top down to oldest at the bottom.

Thanks again, you helped out big time :)
Title: Re: Board Default Sort
Post by: Anguz on October 08, 2004, 11:48:11 PM
I know you want it sorted like that by default, what I mean is that even if someone clicks on the column headers, it won't be sorted asc, always desc.

if (!isset($_REQUEST['asc']))
$_REQUEST['desc'] = '';


If there's no asc or desc in the url, it'll be desc. If there's a desc, it'll be desc. Only with an asc in the url it'll be asc. The problem is that the urls don't have the asc at the end in the default theme's template. What I'm saying is that you have to add them if you ever want it be sorted asc.

Just find the five ? ';desc' : '', in MessageIndex.template.php and change them to ? ';desc' : ';asc',.

When you upgrade your forum, it'll be way easier for you to install the mod to manage this. ;)
Title: Re: Board Default Sort
Post by: ADoomedMarine on October 09, 2004, 04:29:59 PM
Ahh ok now I see.. I'll get that fixed up now.

Thanks for that.  :D
Title: Re: Board Default Sort
Post by: Anguz on October 25, 2004, 07:28:32 PM
Updated the mod  to 1.21

There was a problem with uninstallation where some modifications weren't reverted.

The default sorting link was still showing in some cases when it wasn't necessary.
Title: Re: Board Default Sort
Post by: Armada on January 19, 2005, 04:12:34 PM
I applied this mod about a week and a half ago (SMF 1.0 RC2) and it worked great,the users were very impressed with it -  BUT then I suddenly noticed today that it wan't working. Aaaarrgghh.

Over the last two days I've:
Applied the "php Vulnerability" patch to my RC2
Optimized the database in the admin section of SMF

I think the vulnerability patch alters load.php and search.php - coeld it be this Sort Mod has been wiped out in part by the vulnerabilty patch (or perhaps I've done something else wrong)

Thanks,
Trystan
Title: Re: Board Default Sort
Post by: Anguz on January 19, 2005, 06:31:00 PM
I know I've said this many times already, "I have to update my mods to the latest SMF version" and am sorry to do it again. I have been very busy with life these weeks, I apologize. I expect to post the new files soon. Sorry for the long wait.

BTW, I'm really glad you guys liked this mod! Thanks for letting me know. It's that kind of feedback that makes me want to work on mods and release them.
Title: Re: Board Default Sort
Post by: Armada on January 20, 2005, 05:31:16 AM
Anguz,

The alphabetical listing has been invaluable on some of the boars on our site, it's turned them from "a forum" into an alphabetical listing of resources which people can very easily look through. Keep up the good work. :) :)

Any idea which bits of (presumably) load.php and search.php (if either) to change to get mine working again? I don't want to uninstall the broken mod incase it rips down our forum.

Trystan  :)

Title: Re: Board Default Sort
Post by: Anguz on January 20, 2005, 05:56:39 AM
Quote from: trystan on January 20, 2005, 05:31:16 AM
Anguz,

The alphabetical listing has been invaluable on some of the boars on our site, it's turned them from "a forum" into an alphabetical listing of resources which people can very easily look through. Keep up the good work. :) :)

That was the reason why I created it. I needed something very similar to what you describe. I'm really glad you like it. :)

Quote
Any idea which bits of (presumably) load.php and search.php (if either) to change to get mine working again? I don't want to uninstall the broken mod incase it rips down our forum.

Trystan :)

Hmm... not off the top of my head. Look inside the mod package for the .mod file and read it, it's not large. You shouldn't have much trouble finding what's missing in your files. I'm guessing probably the db queries are where the problem lies, but it's just that, a guess.
Title: Re: Board Default Sort
Post by: blsilks on January 21, 2005, 10:47:21 AM
Are there any instructions on how to manually install this mod? 
Title: Re: Board Default Sort
Post by: Armada on January 26, 2005, 02:38:34 PM
Anguz,

There is no ".mod" file - but found modification.xml in the zip package for the modification.

The bit that alters the Load.php file is here:

<file name="$sourcedir/Load.php">

<operation>

<search position="before"><![CDATA[b.ID_THEME, b.override_theme, b.use_local_permissions]]></search>



<add><![CDATA[,

b.sort_method, b.sort_direction]]></add>

</operation>



<operation>

<search position="before"><![CDATA[$board_info = array(

]]></search>



<add><![CDATA[ 'sort_method' => $row['sort_method'],

'sort_direction' => $row['sort_direction'],

]]></add>

</operation>

</file>




I'm at a loss to understand how to modify my Load.php by hand with the above - I don't understand the [CDATA[ bit pimarily. Any ideas?
Title: Re: Board Default Sort
Post by: Anguz on February 07, 2005, 03:14:17 AM
1.22

Title: Re: Board Default Sort
Post by: Anguz on February 07, 2005, 03:17:10 AM
Quote from: trystan on January 20, 2005, 05:31:16 AM
Any idea which bits of (presumably) load.php and search.php (if either) to change to get mine working again? I don't want to uninstall the broken mod incase it rips down our forum.

PM me if you need help with that.
Title: Re: Board Default Sort
Post by: vegiemite on February 13, 2005, 01:11:23 AM
Anguz,

This is almost exactly what i am looking for except I need it to sort the individual posts in a message as opposed to the messages in a forum. Is this a simple thing to do? I would like to sort the replies by their title.

To better explain my idea, the replies will postings of times in a 00:00:00:00 format and I want the lowest time to display first when the topic is viewed.

Possible?
Title: Re: Board Default Sort
Post by: Anguz on February 13, 2005, 03:12:17 AM
I don't really know... Everything's possible, but I just never looked into post sorting in a topic by title. Sorry. :-\
Title: Re: Board Default Sort
Post by: Anguz on February 23, 2005, 12:41:06 AM
1.23

Title: Re: Board Default Sort
Post by: bmrberlin on March 30, 2005, 11:23:58 AM
I have the german version of SMF 1.0.3 and installed your MOD. But where do I find the switch to change the default sort. I'm not able to locate it.

Thanks in advance
Bernd from Berlin
Title: Re: Board Default Sort
Post by: Anguz on March 30, 2005, 04:24:10 PM
It's in the page where you modify your board settings, like it's name or position, look a bit down that page and you should find it.
Title: Re: Board Default Sort
Post by: nwowatcher on March 30, 2005, 05:58:39 PM
Could someone possibly link me to what this looks like as a working model? Thanx..
Title: Re: Board Default Sort
Post by: bmrberlin on March 31, 2005, 12:34:46 AM
Quote from: Anguz on March 30, 2005, 04:24:10 PM
It's in the page where you modify your board settings, like it's name or position, look a bit down that page and you should find it.

Thank you! The german version has no explaining text to the feature. So you have to guess - but only a little bit.

Bernd
Title: Re: Board Default Sort
Post by: Anguz on March 31, 2005, 03:34:35 AM
Ah, sorry about that. Well, you can fix it copying the language strings the mod adds to the english file, to the german one, be it as-is or translated if you prefer. :)
Title: Re: Board Default Sort
Post by: RicochetPeter on May 08, 2005, 04:43:50 PM
Any chance of getting an updated version that will work with 1.0.3?
Upon installation of v1.23, SMF tells me
The package you are trying to download or install is either corrupt or not compatible with this version of SMF.
Title: Re: Board Default Sort
Post by: Anguz on May 11, 2005, 06:25:42 PM
1.24

Title: Re: Board Default Sort
Post by: NBK on May 12, 2005, 07:06:42 AM
I tried to install BoardDefaultSort124.mod on SMF 1.0.3. with dutch language pack.
I manually checked all the changes in the mod-file with the files in my board and they match.
I added the same changes to $languagedir/Modifications.dutch.php as were made to $languagedir/Modifications.english.php

I keep finding the following error in my log-file

NBK   Today at 12:05:40 
192.168.1.1     ad69e3bb634a605d14240d46ea1de3fc 
http://wdevries.demon.nl/SMF/index.php?board=18.0 
8: Undefined index: sort
File: f:\http\web\smf\Sources\MessageIndex.php
Line: 89

What corrisponces with this part of the code

86 if ($sort_method == $board_info['sort_method'] && $sort_direction == $board_info['sort_direction'])
87 {
88 $context['sort_default'] = false;
89 unset($_SESSION['sort'][$board]);
90 }
91 else
92 $context['sort_default'] = true;

The log-file entry appears as soon as someone has entered a board. There is no difference between boards that still use the default sorting methode and board that have a sorting methode defined.

Can someone tell me what's wrong?
Title: Re: Board Default Sort
Post by: Anguz on May 12, 2005, 04:27:31 PM
It's my mistake cause it's trying to unset it even when it's not set. I'll fix it today, sorry for the trouble.
Title: Re: Board Default Sort
Post by: Anguz on May 12, 2005, 05:00:43 PM
1.25

Title: Re: Board Default Sort
Post by: NBK on May 13, 2005, 04:56:18 AM
Thx :)
Works perfect

Interrested in a dutch translation?


<edit file>
$languagedir/Modifications.dutch.php
</edit file>

<search for>
?>
</search for>

<add before>
// Board default sort.
$txt['sort_default'] = 'Standaard';
$txt['first_poster'] = 'Eerste poster';
$txt['first_post'] = 'Eerst bericht';
$txt['last_poster'] = 'Laatste poster';
$txt['sort_asc'] = 'Eerste bovenaan';
$txt['sort_desc'] = 'Eerste onderaan';
$txt['mboards_sort'] = 'Sortering van board';
$txt['mboards_sort_desc'] = 'Hiermee kun je instellen op welke manier het board gesorteerd word.';

</add before>
Title: Re: Board Default Sort
Post by: Anguz on May 13, 2005, 05:19:52 AM
Quote from: NBK on May 13, 2005, 04:56:18 AM
Thx :)
Works perfect

Interrested in a dutch translation?

Glad it's fixed now, thank you for finding that bug! And for the translation! I'll package it for those that want it. :)
Title: Re: Board Default Sort
Post by: SidRoberts on June 18, 2005, 06:01:46 PM
Quote from: NBK on May 12, 2005, 07:06:42 AM
I tried to install BoardDefaultSort124.mod on SMF 1.0.3. with dutch language pack.
I manually checked all the changes in the mod-file with the files in my board and they match.
I added the same changes to $languagedir/Modifications.dutch.php as were made to $languagedir/Modifications.english.php

I keep finding the following error in my log-file

NBK   Today at 12:05:40 
192.168.1.1     ad69e3bb634a605d14240d46ea1de3fc 
http://wdevries.demon.nl/SMF/index.php?board=18.0 
8: Undefined index: sort
File: f:\http\web\smf\Sources\MessageIndex.php
Line: 89

What corrisponces with this part of the code

86 if ($sort_method == $board_info['sort_method'] && $sort_direction == $board_info['sort_direction'])
87 {
88 $context['sort_default'] = false;
89 unset($_SESSION['sort'][$board]);
90 }
91 else
92 $context['sort_default'] = true;

The log-file entry appears as soon as someone has entered a board. There is no difference between boards that still use the default sorting methode and board that have a sorting methode defined.

Can someone tell me what's wrong?

this also happened to me and i cannot use v1.2.5 or v1.2.3 because it won't apply so i had to use 1.2.2. then i worked out the solution:
in the package-info.xml file in the 1.2.5 version just rename the <install for="1.0.3"> to <install for="1.0.4">. hope this helps.
Title: Re: Board Default Sort
Post by: SamoanOnion on June 23, 2005, 03:04:28 AM
sorry for the noob-ness,

but when I goto browse packages, it only give me the options to 'List FIles' or 'Delete' the mod,
how do I go about installing it???
Title: Re: Board Default Sort
Post by: Anguz on June 23, 2005, 06:18:00 AM
It's because I haven't updated it for the last public SMF release yet. I should get around updating all my mods in the next days if all goes well.
Title: Re: Board Default Sort
Post by: Isaac on June 28, 2005, 11:33:51 PM
Quote from: Anguz on June 23, 2005, 06:18:00 AM
It's because I haven't updated it for the last public SMF release yet. I should get around updating all my mods in the next days if all goes well.
Any word on the update?  I sure could use this mod! :)
Title: Re: Board Default Sort
Post by: bmrberlin on July 18, 2005, 07:44:22 AM
Is there a new version of this MOD for SMF 1.0.5? If so, where can I find it?

All the best from Dschermennie
Bernd
Title: Re: Board Default Sort
Post by: Isaac on July 18, 2005, 09:59:06 PM
Still no new version, and I could greatly use it. :(
Title: Re: Board Default Sort
Post by: HEB XI 1 on July 20, 2005, 04:46:52 PM
Any chance this might be updated for 1.1 beta 3?
Title: Re: Board Default Sort
Post by: Isaac on July 27, 2005, 12:26:53 AM
I managed to install it myself.

1. Open the .xml file, and change 1.0.3 to 1.0.5
2. Save, upload, run the Package.
3. Modify Load.php and Manageboards.php according to the .mod file, since it doesn't work via Package Manager.

That's it.  It should work. :)
Title: Re: Board Default Sort
Post by: Anguz on July 27, 2005, 12:32:34 AM
Quote from: hebxi1 on July 20, 2005, 04:46:52 PM
Any chance this might be updated for 1.1 beta 3?

Don't think it'll happen, I'll most probably wait until Final before modding 1.1.

Quote from: Isaac on July 27, 2005, 12:26:53 AM
I managed to install it myself.

Cool.
Title: Re: Board Default Sort
Post by: Mucgie on August 09, 2005, 04:51:46 AM
Quote from: Isaac on July 27, 2005, 12:26:53 AM
I managed to install it myself.

1. Open the .xml file, and change 1.0.3 to 1.0.5
2. Save, upload, run the Package.
3. Modify Load.php and Manageboards.php according to the .mod file, since it doesn't work via Package Manager.

That's it.  It should work. :)


wow.  is there any way you could write a quick dummy's-guide for the last step?
Title: Re: Board Default Sort
Post by: Mucgie on August 22, 2005, 05:52:19 AM
Bump!

How do you alter the files yourself? ???
Title: Re: Board Default Sort
Post by: tentronik on August 22, 2005, 05:59:17 AM
Open the .xml file, and see what gets where added or replaced.

Make a backup of every file you edited and test it afterwards.
Title: Re: Board Default Sort
Post by: Chan Kong-sang on September 14, 2005, 03:59:31 PM
Sorry but i don't have time for a process like that. Anguz, i'm replying one month later? :D

*edit*
One month later... something in progress?
Title: Re: Board Default Sort
Post by: ltdeta on November 29, 2005, 03:27:05 PM
using SMF 1.0.5 and Mod version 1.25:

Mod Installation was successfully.

Each time i make a new board this message are in the error-protocol:
(only then i bush the button "New board")

8: Undefined index: sort_method
Datei: /is/htdocs/wp1005029_D2DFQN8UC8/p3dnow/akos/raid/Themes/kos/ManageBoards.template.php (eval?)
Zeile: 378

8: Undefined index: sort_direction
Datei: /is/htdocs/wp1005029_D2DFQN8UC8/p3dnow/akos/raid/Themes/kos/ManageBoards.template.php (eval?)
Zeile: 384
Title: Re: Board Default Sort
Post by: Anguz on November 29, 2005, 03:59:31 PM
Are you using a language other than english? If you are, you most probabyl are missing those language strings in your language file.
Title: Re: Board Default Sort
Post by: ltdeta on November 30, 2005, 09:27:24 AM
@Anguz

here are the original language modifications from script:

// Board default sort.
$txt['sort_default'] = 'Default';
$txt['first_poster'] = 'First poster';
$txt['first_post'] = 'First post';
$txt['last_poster'] = 'Last poster';
$txt['sort_asc'] = 'Ascending';
$txt['sort_desc'] = 'Descending';
$txt['mboards_sort'] = 'Board Sort';
$txt['mboards_sort_desc'] = 'This allows you to change the default sorting of topics in this board.';


i have the modifications done for german language:

Modifications.german.php:

// Board default sort.
$txt['sort_default'] = 'Standard';
$txt['first_poster'] = 'erster poster';
$txt['first_post'] = 'erstes posting';
$txt['last_poster'] = 'letzter poster';
$txt['sort_asc'] = 'Aufsteigen';
$txt['sort_desc'] = 'Absteigend';
$txt['mboards_sort'] = 'Board Sort';
$txt['mboards_sort_desc'] = 'This allows you to change the default sorting of topics in this board.';


other files in the language folder are not affected
Title: Re: Board Default Sort
Post by: Anguz on November 30, 2005, 01:56:13 PM
ltdeta, thank you for the translation!

Did that solve your problem?
Title: Re: Board Default Sort
Post by: ltdeta on November 30, 2005, 05:41:00 PM
no the error's are not solved :(

here are all the errors after  push the button create new board

   Dramlinta (S)   Heute um 23:22:58 
195.14.221.219     d36be707eeed61b239ed48902519ff89 
http://www.p3dnow.de/akos/raid/index.php?action=manageboards;sa=newboard;ID_CAT=7 
8: Undefined index: sort_method
Datei: /is/htdocs/wp1005029_D2DFQN8UC8/p3dnow/akos/raid/Themes/kos/ManageBoards.template.php (eval?)
Zeile: 374

   Dramlinta (S)   Heute um 23:22:58 
195.14.221.219     d36be707eeed61b239ed48902519ff89 
http://www.p3dnow.de/akos/raid/index.php?action=manageboards;sa=newboard;ID_CAT=7 
8: Undefined index: sort_method
Datei: /is/htdocs/wp1005029_D2DFQN8UC8/p3dnow/akos/raid/Themes/kos/ManageBoards.template.php (eval?)
Zeile: 378

   Dramlinta (S)   Heute um 23:22:58 
195.14.221.219     d36be707eeed61b239ed48902519ff89 
http://www.p3dnow.de/akos/raid/index.php?action=manageboards;sa=newboard;ID_CAT=7 
8: Undefined index: sort_method
Datei: /is/htdocs/wp1005029_D2DFQN8UC8/p3dnow/akos/raid/Themes/kos/ManageBoards.template.php (eval?)
Zeile: 378

   Dramlinta (S)   Heute um 23:22:58 
195.14.221.219     d36be707eeed61b239ed48902519ff89 
http://www.p3dnow.de/akos/raid/index.php?action=manageboards;sa=newboard;ID_CAT=7 
8: Undefined index: sort_method
Datei: /is/htdocs/wp1005029_D2DFQN8UC8/p3dnow/akos/raid/Themes/kos/ManageBoards.template.php (eval?)
Zeile: 378

   Dramlinta (S)   Heute um 23:22:58 
195.14.221.219     d36be707eeed61b239ed48902519ff89 
http://www.p3dnow.de/akos/raid/index.php?action=manageboards;sa=newboard;ID_CAT=7 
8: Undefined index: sort_method
Datei: /is/htdocs/wp1005029_D2DFQN8UC8/p3dnow/akos/raid/Themes/kos/ManageBoards.template.php (eval?)
Zeile: 378

   Dramlinta (S)   Heute um 23:22:58 
195.14.221.219     d36be707eeed61b239ed48902519ff89 
http://www.p3dnow.de/akos/raid/index.php?action=manageboards;sa=newboard;ID_CAT=7 
8: Undefined index: sort_method
Datei: /is/htdocs/wp1005029_D2DFQN8UC8/p3dnow/akos/raid/Themes/kos/ManageBoards.template.php (eval?)
Zeile: 378

   Dramlinta (S)   Heute um 23:22:58 
195.14.221.219     d36be707eeed61b239ed48902519ff89 
http://www.p3dnow.de/akos/raid/index.php?action=manageboards;sa=newboard;ID_CAT=7 
8: Undefined index: sort_method
Datei: /is/htdocs/wp1005029_D2DFQN8UC8/p3dnow/akos/raid/Themes/kos/ManageBoards.template.php (eval?)
Zeile: 378

   Dramlinta (S)   Heute um 23:22:58 
195.14.221.219     d36be707eeed61b239ed48902519ff89 
http://www.p3dnow.de/akos/raid/index.php?action=manageboards;sa=newboard;ID_CAT=7 
8: Undefined index: sort_method
Datei: /is/htdocs/wp1005029_D2DFQN8UC8/p3dnow/akos/raid/Themes/kos/ManageBoards.template.php (eval?)
Zeile: 378

   Dramlinta (S)   Heute um 23:22:58 
195.14.221.219     d36be707eeed61b239ed48902519ff89 
http://www.p3dnow.de/akos/raid/index.php?action=manageboards;sa=newboard;ID_CAT=7 
8: Undefined index: sort_direction
Datei: /is/htdocs/wp1005029_D2DFQN8UC8/p3dnow/akos/raid/Themes/kos/ManageBoards.template.php (eval?)
Zeile: 383

   Dramlinta (S)   Heute um 23:22:58 
195.14.221.219     d36be707eeed61b239ed48902519ff89 
http://www.p3dnow.de/akos/raid/index.php?action=manageboards;sa=newboard;ID_CAT=7 
8: Undefined index: sort_direction
Datei: /is/htdocs/wp1005029_D2DFQN8UC8/p3dnow/akos/raid/Themes/kos/ManageBoards.template.php (eval?)
Zeile: 384

   Dramlinta (S)   Heute um 23:22:58 
195.14.221.219     d36be707eeed61b239ed48902519ff89 
http://www.p3dnow.de/akos/raid/index.php?action=manageboards;sa=newboard;ID_CAT=7 
8: Undefined index: sort_direction
Datei: /is/htdocs/wp1005029_D2DFQN8UC8/p3dnow/akos/raid/Themes/kos/ManageBoards.template.php (eval?)
Zeile: 385


here the code from ManageBoards.template.php begin line 355 end 388:

// Board default sort.
$sort_methods = array(
'subject' => $txt[70],
'starter' => $txt['first_poster'],
'first_post' => $txt['first_post'],
'replies' => $txt[110],
'views' => $txt[301],
'last_poster' => $txt['last_poster'],
'last_post' => $txt[111],
);

echo '
<tr>
<td>
<b>', $txt['mboards_sort'], '</b><br />
', $txt['mboards_sort_desc'], '<br /><br />
</td>
<td valign="top" align="right">
<select name="sort_method">
<option value=""', $context['board']['sort_method'] == '' ? ' selected="selected"' : '', '>', $txt['sort_default'], '</option>';

foreach ($sort_methods as $key => $val)
echo '
<option value="', $key, '"', $context['board']['sort_method'] == $key ? ' selected="selected"' : '', '>', $val, '</option>';

echo '
</select><br />
<select name="sort_direction">
<option value=""', $context['board']['sort_direction'] == '' ? ' selected="selected"' : '', '>', $txt['sort_default'], '</option>
<option value="asc"', $context['board']['sort_direction'] == 'asc' ? ' selected="selected"' : '', '>', $txt['sort_asc'], '</option>
<option value="desc"', $context['board']['sort_direction'] == 'desc' ? ' selected="selected"' : '', '>', $txt['sort_desc'], '</option>
</select>
</td>
</tr>';
Title: Re: Board Default Sort
Post by: diane_tt on December 16, 2005, 01:24:13 AM
definitely could use this for for 1.0.5, i'm actually really afraid to do this...i'm only using english language.
Title: Re: Board Default Sort
Post by: Anguz on December 16, 2005, 02:10:27 PM
Well, I still don't know why that person had that problem, but I don't see others complaining about that and there's been plenty of downloads of the mod. So, I think it's pretty safe to give it a try, just make a backup of your forum first, this is always best to do.
Title: Re: Board Default Sort
Post by: ltdeta on December 21, 2005, 02:34:16 PM
maybe i know why i get the errors shown here

Quote from: ltdeta on November 29, 2005, 03:27:05 PM
using SMF 1.0.5 and Mod version 1.25:

Mod Installation was successfully.

Each time i make a new board this message are in the error-protocol:
(only then i bush the button "New board")

8: Undefined index: sort_method
Datei: /is/htdocs/wp1005029_D2DFQN8UC8/p3dnow/akos/raid/Themes/kos/ManageBoards.template.php (eval?)
Zeile: 378

8: Undefined index: sort_direction
Datei: /is/htdocs/wp1005029_D2DFQN8UC8/p3dnow/akos/raid/Themes/kos/ManageBoards.template.php (eval?)
Zeile: 384


If you want to create a new board (only pushed the  new-board-button)

<option value=""', $context['board']['sort_method'] == '' ? ' selected="selected"' : '', '>', $txt['sort_default'], '</option>';



maybe the "board-ID is not set because i don't push the save-button

so the index    $context['board']['sort_method']   can't be found

how i can prevent this ?

Title: Re: Board Default Sort
Post by: ArkServer on April 16, 2006, 12:40:14 PM
Can anyone update this for 1.1 rc2?
Title: Re: Board Default Sort
Post by: dracomiconia on September 27, 2006, 06:13:55 PM
What about this mod?

I have installed 1.1 RC3 and it would be a great mod for blog categorie....
Title: Re: Board Default Sort
Post by: Anguz on July 31, 2007, 01:23:33 AM
I've just noticed that akabugeyes published a mod that does this for SMF 1.1.

Custom Board Sort (http://custom.simplemachines.org/mods/index.php?mod=382)