Custom Board Sort

Started by codenaught, July 10, 2006, 07:06:30 PM

Previous topic - Next topic

dpiercey

Thanks - this is fantastic!

Krysia

Quote from: edchapman on December 02, 2006, 04:12:55 PM
Anyone have this working on their site? I would love to see it in action.

I posted a screencap. :)



chaos_gamer

I tried to install Sort board package and after uninstalling i am seeing this error i am attaching the screenshot plz help

Flying Drupalist

Is it possible to tweak it to sort by the number of "Thank yous" from the thanks mod or the number of votes from the star rankings?

actoguitar

i installed this mod, and everything was fine. then i installed a few other mods -- smfshop, tagging system, and tinyportal -- and now the dropdown menu in the custom board sort section no longer lists all the options to sort by; the only option listed is "default". the ASC and DESC options are visible.

i am assuming something in the other mods conflicted with this mod. based on that, i wanted to uninstall/reinstall teh customboardsort mod. i tried to uninstall, but then got a failure message:

Please remember to always make regular backups of your sources and database before installing mods, especially beta versions.

!!
Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.
Uninstall Actions
Uninstall Actions "Custom Board Sort":
Installing this package will perform the following actions:
   Type    Action    Description
1.    Execute Modification    ./Sources/MessageIndex.php    Test failed
2.    Execute Modification    ./Sources/ManageBoards.php    Test failed
3.    Execute Modification    ./Themes/default/ManageBoards.template.php    Test failed
4.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test failed
5.    Execute Modification    ./Sources/Subs-Boards.php    Test failed
6.    Execute Modification    ./Sources/Load.php    Test failed

is it safe for me to proceed with an uninstallation anyway? or any idea how i can resolve this problem?

thanks :)

Krysia

Quote
is it safe for me to proceed with an uninstallation anyway? or any idea how i can resolve this problem?
I've learned that whenever I've come into this type of problem, it means that I have to install the mod manually (sometimes in addition to via the Package Manager). The original code has just been modified, and now the package manager directions may not apply. You can do this via a text editor, and there's also a tutorial on this site somewhere as to how (if you've never done it before).

:)



codenaught

Quote from: Miraploy on January 03, 2007, 08:44:22 AM
Is it possible to tweak it to sort by the number of "Thank yous" from the thanks mod or the number of votes from the star rankings?
I will have to look at those mods and I can probably include a check to see if those mods are installed and if they are include them as options. I assume those fields are currently sortable when inside a board?

@chaos_gamer, it looks like the text strings are outside the Themes/default/languages/Modifications.english.php file. If you are still having this problem, make sure all text in that file is between the beginning <?php line and the ending ?> line.

@actoguitar, because all those files failed, you shouldn't try uninstalling it. Most of the strings that appear in the dropdown come right from SMF, so is it possible you have a problem with your language files? You may want to try viewing it in the default theme if you are not already doing so.
Dev Consultant
Former SMF Doc Coordinator

vcomp

I tried to install on 1.1.2 and received the following error at step 3:

1.  Execute Modification  ./Sources/MessageIndex.php     Test successful
2. Execute Modification   ./Sources/ManageBoards.php    Test failed
3. Execute Modification   ./Themes/default/ManageBoards.template.php    Test successful
4. Execute Modification   ./Themes/default/languages/Modifications.english.php    Test successful
5. Execute Modification   ./Sources/Subs-Boards.php    Test successful
6. Execute Modification   ./Sources/Load.php    Test successful
7. Execute Code        database.php    

Any idea how to fix?  I really want this mod.

TIA

Krysia

The test failed probably means that some other mod tweaked the code enough so that the auto-installer can't install it; you'll have to install manually.

That's my take on what happened.



vcomp

It seems that this bit of code cannot be found in ManageBoards.php:

         'permission_mode' => 'normal',
      );

in order to add this after it:

   $context['board']['sort_method'] = 0;
   $context['board']['sort_order'] = 0;

But I found the general area and my new code block looks like this:

   if ($_REQUEST['sa'] == 'newboard')
   {
      // Some things that need to be setup for a new board.
      $curBoard = array(
         'memberGroups' => array(0, -1),
         'category' => (int) $_REQUEST['cat']
      );
      $context['board_order'] = array();
      $context['board'] = array(
         'is_new' => true,
         'id' => 0,
         'name' => $txt['mboards_new_board_name'],
         'description' => '',
         'count_posts' => 1,
         'theme' => 0,
         'override_theme' => 0,
         'category' => (int) $_REQUEST['cat'],
         'no_children' => true,
         'is_redirect' => 0,
         'count_clicks' => 0,
         'target' => '',
         'url' => '',
      );
      
      $context['board']['sort_method'] = 0;
      $context['board']['sort_order'] = 0;
   
   }

It seems to be working.  Excellent Mod!!! :D :D :D

bobbbb

You rock dude, I just realized a needed this mod for a downloads board. I have several files I wanted to sort by date, and I posted them in different orders... this mod is perfect for me! Thanks!

calv

Hi,
Nice mod! Been looking for something similar...
Just installed in on 1.1.2 but cant see where it's added the functionality?
lol, might just be me? where is it supposed to be?

thanks!

calv

still cant find it? keen to get it going...

cheers!  8)

TheCyberKid

i can't have ads put up on alienation, only the default smf core theme, why?

even though i have swapped to SMF core, the ads do appear, but once i view the forum as a guest, i see no ads, why? and how can i solve this?

ArkServer

Unknown column 'b.sort_order' in 'field list'

any idea how to fix this?

codenaught

@calv, go to Admin / Boards and select Modify next to any board. On the modify board page you should see a new dropdown which allows you to select the default board sort type for that particular board. Do you see it?

@TheCyberKid, ads? This mod doesn't have to do with ads. Are you saying it is not compatible with the ad mod? Please post any problems you are having with your ad mod in the ad mod's support topic. In anycase, it sounds like you need to manually apply the theme changes to your custom themes because by default, mods only install to the SMF default theme.

@ArkServer, I'm not sure why the mod didn't successfully add that column to the boards table but if you have phpmyadmin you can try running this query:

ALTER TABLE smf_boards ADD `sort_order` TINYINT NOT NULL

Changing the smf_ to your own database prefix if it is any different.

If the sort_method column is also missing you could also run the following query:

ALTER TABLE smf_boards ADD `sort_method` VARCHAR(60) NOT NULL
Dev Consultant
Former SMF Doc Coordinator


calv

Hi akabugeyes,
Thanks for the reply! Very handy mod  :D No cant see any new dropdowns? guess I might need to manually install it? any idea's first?

thanks  8)

codenaught

calv, sorry that this was overlooked. Are you still having issues with the mod?

If it still doesn't work, when you installed the mod did it report any failures for any of the files it was to modify? Are you using a custom theme that has its own ManageBoards.template.php file? (Really no reason why any theme should though)
Dev Consultant
Former SMF Doc Coordinator

ltdeta

SMF 1.12

Field 'sort_order' doesn't have a default value
Datei: D:\Projekte\PHP_PROJEKTE\kosforum\Sources\Subs-Boards.php
Zeile: 1108

then i want to create a new Board


Advertisement: