Rank Image Drop Down

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

Previous topic - Next topic

vbgamer45

Reminds me I did it long ago for SMF 1.1.x had a seperate folder for just ranks/star images instead of each theme having one
http://custom.simplemachines.org/mods/index.php?mod=335

Which can be helpful unless the ranks/stars don't blend well with the theme.
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

That's the only reason to keep per-theme images. But the practicality is that most people have one theme on a site and thus only need one set of rank images.

NanoSector

I committed this to GitHub, and it looks like Labradoodle wants to merge this into 2.1 :)
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


NanoSector

Yeah, I need to do more and ask less :P

Reminds me of the Joker, "I just do things..."
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."

impreza

Hundereds useful, simplifying the matter - thanks
Portal ToTemat.pl - treści w postaci artykułów i filmów tematycznych.

puw

Hi Yoshi, seems like a time-saving mod, but I have a few questions please.

I'm using 2.0.4 default curve.

What I am trying to work out is how to do the following:

Each member group earns rep/rank that is shown by "collecting" a new and different image to sit after the previous different image/s.

As your rep/rank increases, so do your images, retaining all previously earned images too. So, by the time you get to Hero rank, you have 5 different images to show your rep/rank.

Since the admin only allows one url related to an image per member's "star file image", the only way I can think of doing this is to make each rank's img a "growing in size" collection. This mod filters out anything above a certain size.

How can I make this work please?

For clarification, a new member joins a "football card collecting" forum. As he becomes more active, his rank/rep grows by him gaining new football card images, retaining and showing all previously earned card images.

Then he's asked to become a mod. He retains all the previous lower ranked images and starts to add new ones within the "mod" rank. And so on. By the time he's at a global mod level, he's got quite an array of football card images to "show off" to junior members. This then, because of the forum restriction that I can only add a single image url per level and so have to create each levels growing collection as a single image, grows outside of your filter.

Thx for any feedback on being able to use your mod in this way.

Matthew K.

I'd imagine you could probably get rid of the size restraint, but Yoshi would have to be the one to show you how and verify that it'd work.

NanoSector

Hey puw,

In Sources/ManageMembergroups.php, find:

// If the extension is not empty, and it is valid,
if (!empty($ext) && in_array($ext, $imageExts))
{
// Get the size of the image.
$image_info = getimagesize($settings['default_theme_dir'] . '/images/' . $value);

// If this is bigger than 128 in width or 32 in height, skip this one.
if ($image_info == false || $image_info[0] > 128 || $image_info[1] > 32)
continue;

// Else it's valid. Add it in.
else
$context['possibleStars'][] = $value;
}


Replace that with:
// If the extension is not empty, and it is valid,
if (!empty($ext) && in_array($ext, $imageExts))
$context['possibleStars'][] = $value;
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."

puw

Thanks for the fast reply Yoshi, will try it out now :)

puw

I've installed the mod no problem. Looked in the membergroups modify to check it's there and working as a drop down - all good.

Now I go into the default theme main folder (which I think you refer to as Source) and I see an updated "ManageMembergroups.template.php". Using the browser search facility and using various terms from the code above, there's nothing like the code you mention above, and I do not have a "ManageMembergroups.php" file, only the above one.

Anyone any ideas please?

Chalky

ManageMembergroups.php is in the Sources folder, not Themes  ;)

puw

#32
Thank you for your correct guidance.

I'm used to looking in and working through the modify themes etc.

Now I realise I need to ftp copy the source file, update and then ftp back over the server's copy.

Everything works as I need it to - thanks everyone.

rumblecloud

Thought you might like to know it does not work with my SMF 2.0.6 or earlier 2.0.4.

I uninstalled. It doesn't show all the files included in the default. It is a nice feature though-- if it worked.

r

Chalky


NanoSector

Thanks, I created a package with the filter removed. :)
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."

Chalky


rumblecloud

Yes, for sure thank you.

I am still finding my way around the SMF forum and stepping on all the appropriate toes as I stumble through.

I do appreciate the support and work you guys do.

r

NekoJonez

Suggestion for a future update of this mod. The possibility to upload an image on that page.

But works on 2.0.7
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

NanoSector

That's definitely on my to-do list, and thanks for testing, marked it as 2.0.7 compatible.
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: