[ABD] Medal System MOD for phpBB3

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
User avatar
madmartyau
Registered User
Posts: 440
Joined: Sun Sep 12, 2004 12:42 pm
Location: Brisbane,Australia
Name: Marty
Contact:

Re: [Beta] Medal System MOD for phpBB3

Post by madmartyau »

femu wrote:Hi,

I'm wondering, if it's possible to sort the image names list in the ACP, when adding or editing medals. I just found the solution for another mod, but this won't work here, as the way of reading the medals directory is different solved (in the other one, the file names were read into an array and the array simply can be sorted using sort($array) ).

It would be really great to have them sorted here too, as it's painful to find the correct image, if you have a lot of them ;)

Thanks,
femu
open includes\acp\acp_medals.php
FIND

Code: Select all

if ($dh = opendir($dir))
				{
					while (($file = readdir($dh)) !== false)
					{
						if (strlen($file) >= 3 && ( strpos($file, '.gif',1) || strpos($file, '.jpg',1) || strpos($file, '.png',1) ))
						{
							$options .= '<option value="' . $file . '">' . $file . '</option>';
						}
					}
					closedir($dh);
				}
REPLACE WITH

Code: Select all

$dirfile = array();
				if ($dh = opendir($dir))
				{
					while (($file = readdir($dh)) !== false)
					{
						if (strlen($file) >= 3 && ( strpos($file, '.gif',1) || strpos($file, '.jpg',1) || strpos($file, '.png',1) ))
						{
							array_push($dirfile,"$file");
						}
					}
					closedir($dh);
				}
				natsort($dirfile);
				foreach ($dirfile as $key => $value)
				{
				$options .= '<option value="' . $value . '">' . $value . '</option>';
				}
There's a similar bit of code for editing medals as well.
FIND

Code: Select all

if ($dh = opendir($dir))
				{
					while (($file = readdir($dh)) !== false)
					{
						if (strlen($file) >= 3 && ( strpos($file, '.gif',1) || strpos($file, '.jpg',1) || strpos($file, '.png',1) ))
						{
							if ($medals[$medal_id]['image'] == $file)
							{
								$options .= '<option value="' . $file . '" selected="selected">' . $file . '</option>';
							}
							else
							{
								$options .= '<option value="' . $file . '">' . $file . '</option>';
							}
						}
					}
					closedir($dh);
				}
REPLACE WITH

Code: Select all

$dirfile = array();
				if ($dh = opendir($dir))
				{
					while (($file = readdir($dh)) !== false)
					{
						if (strlen($file) >= 3 && ( strpos($file, '.gif',1) || strpos($file, '.jpg',1) || strpos($file, '.png',1) ))
						{
							array_push($dirfile,"$file");
						}
					}
					closedir($dh);
				}
				natsort($dirfile);
				foreach ($dirfile as $key => $value)
				{
					if ($medals[$medal_id]['image'] == $value)
					{
						$options .= '<option value="' . $value . '" selected="selected">' . $value . '</option>';
					}
					else
					{
						$options .= '<option value="' . $value . '">' . $value . '</option>';
					}
				}
Call me Grumpy.
femu
Registered User
Posts: 1070
Joined: Tue Sep 27, 2005 10:03 am

Re: [Beta] Medal System MOD for phpBB3

Post by femu »

Hi,

thanks a lot! Only with the edit part, it seems not to hold/selecte the current one. So the list dhould start with the current marked .... so i.e. xy-medal.gif, but the selection list shows nothing ... so I think (not yet checked), if I change i.e. the medal description and leave the medal picture as it is, it will be lost ...


regards,
femu
Regards, femu
_____________________________________________
[My development page] - [My normal homepage (German only)]
User avatar
madmartyau
Registered User
Posts: 440
Joined: Sun Sep 12, 2004 12:42 pm
Location: Brisbane,Australia
Name: Marty
Contact:

Re: [Beta] Medal System MOD for phpBB3

Post by madmartyau »

femu wrote:Hi,

thanks a lot! Only with the edit part, it seems not to hold/selecte the current one. So the list dhould start with the current marked .... so i.e. xy-medal.gif, but the selection list shows nothing ... so I think (not yet checked), if I change i.e. the medal description and leave the medal picture as it is, it will be lost ...


regards,
femu
Strange it works for me are you sure you did the edit correctly?
Call me Grumpy.
femu
Registered User
Posts: 1070
Joined: Tue Sep 27, 2005 10:03 am

Re: [Beta] Medal System MOD for phpBB3

Post by femu »

Hi,

da**** you are right. There was a similar looking part ... So my edits were incorrect. I just checked it again and it works now correctly.

Thanks a lot again and happy easter!
femu
Regards, femu
_____________________________________________
[My development page] - [My normal homepage (German only)]
User avatar
Gremlinn
Registered User
Posts: 2133
Joined: Mon Aug 04, 2003 12:13 am
Location: Rochester, NY
Name: Nathan

Re: [Beta] Medal System MOD for phpBB3

Post by Gremlinn »

madmartyau: Great code fix there. I like it. I will update the mod with that (if you don't mind) the next time I get some time.

As for the missing "Approve" button, your template edits need to be refreshed (especially for prosilver based styles). Go into the ACP/Styles section, refresh the theme for the style in question. May have to do it more than once. If not working, edit the theme (but don't change anything) and look for medals code within. If you see it, click save (don't edit anything).
User avatar
madmartyau
Registered User
Posts: 440
Joined: Sun Sep 12, 2004 12:42 pm
Location: Brisbane,Australia
Name: Marty
Contact:

Re: [Beta] Medal System MOD for phpBB3

Post by madmartyau »

Gremlinn wrote:madmartyau: Great code fix there. I like it. I will update the mod with that (if you don't mind) the next time I get some time.
Go for it!
Call me Grumpy.
femu
Registered User
Posts: 1070
Joined: Tue Sep 27, 2005 10:03 am

Re: [Beta] Medal System MOD for phpBB3

Post by femu »

Gremlinn wrote:As for the missing "Approve" button, your template edits need to be refreshed (especially for prosilver based styles). Go into the ACP/Styles section, refresh the theme for the style in question. May have to do it more than once. If not working, edit the theme (but don't change anything) and look for medals code within. If you see it, click save (don't edit anything).
Stumbeled over that one too yesterday. The problem can be solved very easily:

In your install you stated to copy the button into root/styles/prosilver/imageset/en/icon_post_approve.gif, but then edit the imageset.cfg from the imageset directory. The image needs to go there too. So root/styles/prosilver/imageset/icon_post_approve.gif.

Then everything works as it should ;)
Regards, femu
_____________________________________________
[My development page] - [My normal homepage (German only)]
RoCkFoRdGuN
Registered User
Posts: 33
Joined: Mon Feb 05, 2007 5:28 am

Re: [Beta] Medal System MOD for phpBB3

Post by RoCkFoRdGuN »

Hi there guys sorry im back

i have another issues not with the medals it self but some styles i use dont wanna use the medals theme or the whole style sheet get shifted can anyone give some advice plz
femu
Registered User
Posts: 1070
Joined: Tue Sep 27, 2005 10:03 am

Re: [Beta] Medal System MOD for phpBB3

Post by femu »

I think you should be more precise ...
Regards, femu
_____________________________________________
[My development page] - [My normal homepage (German only)]
RoCkFoRdGuN
Registered User
Posts: 33
Joined: Mon Feb 05, 2007 5:28 am

Re: [Beta] Medal System MOD for phpBB3

Post by RoCkFoRdGuN »

hmmmmm ok o be more precise what styles or themes work with the mod
femu
Registered User
Posts: 1070
Joined: Tue Sep 27, 2005 10:03 am

Re: [Beta] Medal System MOD for phpBB3

Post by femu »

Something like this ...

Which styles does have problems (subsilver/prosilver based styles)?
What exactly does not fit?

etc. Some screenshoots would be helpful too to see, what you mean ...
Regards, femu
_____________________________________________
[My development page] - [My normal homepage (German only)]
User avatar
Gremlinn
Registered User
Posts: 2133
Joined: Mon Aug 04, 2003 12:13 am
Location: Rochester, NY
Name: Nathan

Re: [Beta] Medal System MOD for phpBB3

Post by Gremlinn »

Technically, this mod will work with any theme/style. However, adjustments may (and probably will) need to be made to fit/match the theme. Due to the number of themes out there, it is not possible to provide details for each one.

If the adjustments need are simple enough, someone or myself may be able to help here. But, the theme author may have a better idea about what to do.

Be sure that you start with the right template edits for the theme you are adding it too. ie. Prosilver for prosilver based themes. Subsilver2 edits for subsilver2 based themes.
User avatar
Mrraider
Registered User
Posts: 100
Joined: Thu Apr 02, 2009 7:54 pm

Re: [Beta] Medal System MOD for phpBB3

Post by Mrraider »

Forum can not find uploaded medals!
I'm trying to nominate medals to this user but get this shit:

Code: Select all

Information
There are no medals available to nominate to this user

Return to the previous page
I have uploaded Medal in this folder
myforum/images/medals
User avatar
Gremlinn
Registered User
Posts: 2133
Joined: Mon Aug 04, 2003 12:13 am
Location: Rochester, NY
Name: Nathan

Re: [Beta] Medal System MOD for phpBB3

Post by Gremlinn »

Have you setup the medals in the ACP Medals Management page? And, don't forget to make them available for nomination.
User avatar
Mrraider
Registered User
Posts: 100
Joined: Thu Apr 02, 2009 7:54 pm

Re: [Beta] Medal System MOD for phpBB3

Post by Mrraider »

Gremlinn wrote:Have you setup the medals in the ACP Medals Management page? And, don't forget to make them available for nomination.
How it look in the ACP.
Image
Did I miss something? and what do you mean by ''make them available for nomination'' is an extra setting to do?
Locked

Return to “[3.0.x] Abandoned MODs”