News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Allow select multiple boards for message icons

Started by emanuele, February 11, 2012, 10:21:02 AM

Previous topic - Next topic

emanuele

Link to Mod

This mod revises the admin interface used to add/remove new message icons from boards.

In a default install of SMF if you want to have a message icon available in more than one board, but less than all you have to add new icons with the same image and specify for each of these icons in which board they are visible, one by one.

With this mod the admin interface is changed in a way that for each icon you can select in which boards this icon will be available.

The option "Available In All Boards" is equivalent to the previous select option with the same name: the icon will be available in all the boards irrespective of the boards selected just below.

Selecting "Available In All Boards" will not remove the selected boards (but these will not be displayed in the "edit message icons" list, see for example "Thumb Up" in the screenshots).

In the page where all the icons are listed the column "Board" is changed to "Boards" and if the icon is available in more than one board a list of all those boards is created.

If while editing an icon all the boards are deselected as well as "Available In All Boards", the icon is removed from the database.

The mod doesn't change the database, so any change is completely compatible with a default installation of SMF.

Many thanks to Kays for the many hours he spent finding my mistakes!

Available at github: https://github.com/emanuele45/Boards-Icons-Multiboard


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

SilverKnight

Good mod, should really be added to smf by default.

Jade Elizabeth

Amen on the default, I was gunning for that when I was on the team....all you need to do is make the field for boards accept commas and voila! Ha ha

Thanks so much for this mod, it's perfect!
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

emanuele

Reporting here the link to the bug, so I can close it on mantis.

http://dev.simplemachines.org/mantis/view.php?id=4988

I'll fix it...sooner or later... :P


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Jade Elizabeth

Sorry bout that, I was too afraid to uninstall ha ha.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

emanuele



Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

WasdMan

Hungarian Language:

ISO:
Quote<file name="$languagedir/Modifications.hungarian.php" error="skip">
      <operation>
         <search position="end" />
         <add><![CDATA[
$txt['icons_boards_desc'] = 'Fórum ikonokat lehet használni';
$txt['icons_select_usable_boards'] = 'Táblák mutatása';
$txt['messageicon_delete_confirm'] = 'Ezt az üzenet ikont biztosan törölni akarod?';
]]></add>
      </operation>
   </file>

UTF8:
Quote<file name="$languagedir/Modifications.hungarian-utf8.php" error="skip">
      <operation>
         <search position="end" />
         <add><![CDATA[
$txt['icons_boards_desc'] = 'Fórum ikonokat lehet használni';
$txt['icons_select_usable_boards'] = 'Táblák mutatása';
$txt['messageicon_delete_confirm'] = 'Ezt az üzenet ikont biztosan törölni akarod?';
]]></add>
      </operation>
   </file>

emanuele

Thank you WasdMan!
The first time i'll upgrade the mod (most likely to fix the previously reported bug), I'll include your translation as well!


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Jade Elizabeth

Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.


Arantor

1.1.x was first released 6 years ago, it's time to consider more modern software.

emanuele

Feel free to port it.
From me there will be a 2.1 version...unless...

* emanuele goes create a new branch and ask for opinions :P

Even though the way the mod is implemented is rather hackish and don't know how good it would fit into a 2.1...


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Jade Elizabeth

Just change the DB to allow the boards to be #, #, #, # and then the code to accept that sort of method, instead of one single number only :).
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Arantor

That's not an efficient method of doing it. There are better ways of doing it than shoving the database in a direction that is terribly outdated.

Jade Elizabeth

If it works fine there's no reason to reject it because it's an old method. Not all old things are bad.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Arantor

No, really, there is.

There are old techniques that are used because back when they were used, things were different. Except that now, some years later, better techniques are used.

The technique you're suggesting is much the same as how SMF stores what groups can see what boards, amongst other things. Except that it's one of the performance hurting aspects of the DB design because it's slow to search through (and this would require a search)

Jade Elizabeth

Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Arantor

Under your proposal it would have to apply a search to find the list of icons valid for a given board. This is distinctly not efficient (and would have to be specially rewritten for PostgreSQL and SQLite too, as it happens)

Jade Elizabeth

Then do the reverse and have it save by board, not icon. Then the search only happens in admin.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Arantor

And posting.

There's still an overhead involved in finding the board's icons and then splitting it out, an overhead that doesn't necessarily apply by not using a technique that's outdated and horribly inefficient and instead using MySQL the way it was designed to be used.

Advertisement: