News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Rank Image Drop Down

Started by NanoSector, February 11, 2013, 08:42:57 PM

Previous topic - Next topic

NanoSector

Link to Mod

Rank Image Drop Down
If you need to report a bug, please do so on GitHub!

Please note this feature is included in SMF 2.1, this mod will not be updated to work on 2.1.

This mod replaces the default text box for entering the star name with a more convenient dropdown box in which you can select it.

Not all your images are showing up?
The mod filters out images bigger than 128x32 pixels. If this is a problem for you, please use the package with the suffix "-nofilter". That package will show all images.

Features:
- Loads all images in the /images directory of the default theme
- Keeps the preview function
- Filters out any images bigger than 128x32 pixels

Compatibility:
This mod should work on SMF 2.0 and later. 2.0.4 was tested.

Files modified:
- Sources/ManageMembergroups.php
- Themes/(theme)/ManageMembergroups.template.php

To-dos:
- Make the mod work in a recursive way

Changelog:
v1.0.1
! Fix a bug where the moderator suggest box was broken (thanks ♦ Ninja ZX-10RR ♦!)

v1.0
- Initial release

License:
This mod is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported license.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

Wait, you're caching the file listing in a single folder, only while in the admin panel, 'for performance'? Folder contents are already cached (more efficiently) by the operating system.

Remember: on systems that use proper caches, anything you put in risks pushing something else out. There is no point caching pretty much anything in the admin panel for this reason - it only gains the admin a performance boost, and risks pulling more useful stuff out of the cache.

Matthew K.

Yep, and that was my suggestion. Furthermore, I don't like caching the results of a directory period because it's so subject to change whether the resource is still there or not, really doesn't save you too much in this case anyway as you already explained.

He removed the cache code as per my suggestion and just forgot to remove it from the desc and readme.

NanoSector

Yeah, I forgot to remove it from the readme, my bad, it's changed now :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Antechinus

Quite clever. Not a bad idea. :)

vbgamer45

Neat idea I like it. Could come in handy in some other areas as well.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

NanoSector

Thanks both :)

vbgamer: Can you maybe name the areas? I might be able to modify them as well (in one big mod).
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

4Kstore


¡¡NEW MOD: Sparkles User Names!!!

NanoSector

My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Jessica.

Great mod. Should be in SMF by default
Testing Zone - SMF 2.0.7, default Curve
School & Chat - phpBB3, over 170 mods installed, official live forum

I use the latest version of Chrome

phpBB: Forum = a section; Board = whole site
SMF: Forum = whole site; Board = a section

NanoSector

Thanks Jessica :)

I don't think this will be included in SMF anytime soon, though, unfortunately.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

vbgamer45

Quote from: Jessica. on February 12, 2013, 11:29:56 AM
Great mod. Should be in SMF by default
+1 Makes it a lot easier instead of having to check via ftp what files exist and can be used for stars.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Arantor

So commit it already. SMF's on Github these days.

NanoSector

Quote from: Arantor on February 12, 2013, 01:02:50 PM
So commit it already. SMF's on Github these days.
I'll be more than glad to commit this, but I'd first like to add in the recursive function before committing this or even suggesting it as a core feature.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

-sigh- Don't suggest it, just do it.

We live in a brave new world where things don't really need discussion as much as they used to - SMF's repository is publicly available for anyone who wants to, to submit features. Get it ready then just push it - the world was never changed by people sitting around talking about new things.

NanoSector

I'm more of a need-permission person, can't help it ;)

No but really, what do you think of moving all the stars/badges/whatever to a separate directory named "Themes/default/images/stars" or something? I can adapt this mod for that, and push it to 2.1, that'll save me the recursive-ness, plus unwanted images would get filtered out.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Shambles

Amen (=> Arantor post). This guy thinks like me, which is not always a good thing  :o

This is a handy little function which, as VB45 says, obviates the need to do a manual directory search to list the available 'options'. Do your commits need sponsoring? I'd gladly sponsor it...

NanoSector

Quote from: Shambles on February 12, 2013, 01:36:04 PM
Amen (=> Arantor post). This guy thinks like me, which is not always a good thing  :o

This is a handy little function which, as VB45 says, obviates the need to do a manual directory search to list the available 'options'. Do your commits need sponsoring? I'd gladly sponsor it...
Sponsoring is always something that's appreciated :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

QuoteI'm more of a need-permission person, can't help it

Would it help if I said you had permission to offer it up to the repository? (No guarantee it will be accepted but I see no reason why not)

It would be a huge advantage if there were a single master folder for such things, you wouldn't need to recurse (which is ridiculously easy if you know you have access to SPL iterators)

NanoSector

Quote from: Arantor on February 12, 2013, 01:40:16 PM
QuoteI'm more of a need-permission person, can't help it

Would it help if I said you had permission to offer it up to the repository? (No guarantee it will be accepted but I see no reason why not)

It would be a huge advantage if there were a single master folder for such things, you wouldn't need to recurse (which is ridiculously easy if you know you have access to SPL iterators)
That helps :P

I'm porting it now, I moved the default "stars" to a directory named "stars", so that should work. Still need to adapt the code a bit more but that'll get fixed.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Advertisement: