[BETA] Medal System MOD 1.0.1

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Ideas Centre
Pyrodox
Registered User
Posts: 2
Joined: Tue Jul 02, 2013 8:45 pm

Re: [BETA] Medal System MOD 0.21.0

Post by Pyrodox »

Hello,

I was wondering if it would be possible to add the option to align the medals on the viewtopic page for each user based on order or precedence, but instead of just wrapping to the next line, say you have it set on 3 medals across and the user in question has 4 total medals displayed... It would put the lowest 3 in order of precedence on the bottom row, and the next highest centered above those three on the top line?
Caranthir2
Registered User
Posts: 6
Joined: Tue Jun 11, 2013 4:15 pm

Re: [BETA] Medal System MOD 0.21.0

Post by Caranthir2 »

Ledsen Arkangel wrote:Anyhow, there is a funny bug when you show medals in viewtopic. If you use non-dynamic medals, and if you have more than one level for a medal, the level 1 medal is shown in viewtopic always, no matter which level user really has (if (s)he has the medal, that is). If you use dynamic medals, the medal of user's current level is shown. Looks like the script searches from a wrong place when it tries to find if the image file exists or not. I made the following fix and got it working:

OPEN includes/medals_viewtopic.php
FIND

Code: Select all

if ( file_exists($device_image) )
REPLACE WITH

Code: Select all

if ( file_exists($phpbb_root_path . 'images/medals/' . $device_image) )
Though now it doesn't look good, as it is done differently in medals_memberlist.php... but that was easiest way to do it (and because it now shows current level medal image instead of level 1 medal image, I'm pretty sure that it is a bug) ... I have to investigate that further to really understand how it is done in medals_memberlist.php, so I can get it look similar.
Thank you :!:
User avatar
Fr3eMan
Registered User
Posts: 32
Joined: Tue Jul 02, 2013 12:49 am

Re: [BETA] Medal System MOD 0.21.0

Post by Fr3eMan »

Hi all!

Mod working fine and nice! :D

Thanks!!
User avatar
Jessica
Former Team Member
Posts: 4342
Joined: Sun Jul 18, 2010 2:53 pm
Location: Pennsylvania, USA
Name: Jessica

Re: [BETA] Medal System MOD 0.21.0

Post by Jessica »

Fr3eMan wrote:Hi all!

Question:

There is a system for let manage the awards only by admin/group??
Set permissions so that only the admins and your chosen group(s) can award medals. As for managing, it's only those who have access to the ACP, and have the permission "Can use the medals management module" set to Yes in admin permissions (Misc tab)
Pro-choice, Atheist, Pro-LGBT rights
Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid. - Albert Einstein
User avatar
Fr3eMan
Registered User
Posts: 32
Joined: Tue Jul 02, 2013 12:49 am

Re: [BETA] Medal System MOD 0.21.0

Post by Fr3eMan »

Thanks Jessica!! :D
Pyrodox
Registered User
Posts: 2
Joined: Tue Jul 02, 2013 8:45 pm

Re: [BETA] Medal System MOD 0.21.0

Post by Pyrodox »

I thought I'd make an image to clarify what I was talking about in my earlier post.

Would it be possible to display the medals on the viewtopic and memberlist panels in this configuration?

They look like this right now: Image

Here's how I want it to look: Image

Is there any way this can be done?

The basic idea being is that if there are 3 medals set to be displayed across the panel, and more than 3 medals are being displayed, instead of the fourth medal wrapping onto the next line, it will take the first medal and display it on the first line, the next three on the next line... If there's 5 medals, the first two would be on the first line, the last 3 on the second line... 6 medals, 3 would be displayed on each line... 7 medals would have the first on top, then two rows of 3 beneath it... Etc.
User avatar
Jessica
Former Team Member
Posts: 4342
Joined: Sun Jul 18, 2010 2:53 pm
Location: Pennsylvania, USA
Name: Jessica

Re: [BETA] Medal System MOD 0.21.0

Post by Jessica »

Pyrodox wrote:I thought I'd make an image to clarify what I was talking about in my earlier post.

Would it be possible to display the medals on the viewtopic and memberlist panels in this configuration?

They look like this right now: Image

Here's how I want it to look: Image

Is there any way this can be done?

The basic idea being is that if there are 3 medals set to be displayed across the panel, and more than 3 medals are being displayed, instead of the fourth medal wrapping onto the next line, it will take the first medal and display it on the first line, the next three on the next line... If there's 5 medals, the first two would be on the first line, the last 3 on the second line... 6 medals, 3 would be displayed on each line... 7 medals would have the first on top, then two rows of 3 beneath it... Etc.
Unfortunately no, there's no easy way to do it :/ Sorry :(
Pro-choice, Atheist, Pro-LGBT rights
Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid. - Albert Einstein
User avatar
Fr3eMan
Registered User
Posts: 32
Joined: Tue Jul 02, 2013 12:49 am

Re: [BETA] Medal System MOD 0.21.0

Post by Fr3eMan »

Hi Jessica!

If I have to remove an awarded medal how I can do it?
User avatar
Jessica
Former Team Member
Posts: 4342
Joined: Sun Jul 18, 2010 2:53 pm
Location: Pennsylvania, USA
Name: Jessica

Re: [BETA] Medal System MOD 0.21.0

Post by Jessica »

Fr3eMan wrote:Hi Jessica!

If I have to remove an awarded medal how I can do it?
Go to a user's profile > Award Medal > In Medals Control Panel, click on Awarded Medals on the left.
Pro-choice, Atheist, Pro-LGBT rights
Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid. - Albert Einstein
User avatar
Fr3eMan
Registered User
Posts: 32
Joined: Tue Jul 02, 2013 12:49 am

Re: [BETA] Medal System MOD 0.21.0

Post by Fr3eMan »

Find it!

Thanks!!
User avatar
Theriddler1
Registered User
Posts: 451
Joined: Sat Aug 27, 2011 11:00 pm
Location: NL
Name: Theriddler❶

Re: [BETA] Medal System MOD 0.21.0

Post by Theriddler1 »

when deactivated this mod through acp configuration ,you will get an error when viewing member profile

Code: Select all

[phpBB Debug] PHP Notice: in file /memberlist.php on line 701: Undefined variable: s_nominate
[phpBB Debug] PHP Notice: in file /memberlist.php on line 704: Undefined variable: medal_count
[phpBB Debug] PHP Notice: in file /memberlist.php on line 705: Undefined index: MEDAL_INFORMATION
[phpBB Debug] PHP Notice: in file /memberlist.php on line 707: Undefined index: MEDAL_DETAIL
Fix thanks too http://www.phpbbguru.net member bumbr (original thread: http://www.phpbbguru.net/community/topic18615-45.html)

Open memberlist.php
Find:

Code: Select all

// Medals System MOD
			'USER_ID'				=> $user_id,
			'U_NOMINATE'			=> ( $s_nominate ) ? append_sid("{$phpbb_root_path}medals.$phpEx", "m=nominate&u={$user_id}") : '',
			'U_CAN_AWARD_MEDALS'	=> ($auth->acl_get('a_user') || $is_mod ) ? append_sid("{$phpbb_root_path}medals.$phpEx", "m=award&u={$user_id}") : '',
			'L_USER_MEDAL'			=> $user->lang['MEDALS'],
			'USER_MEDAL_COUNT'		=> $medal_count,
			'L_MEDAL_INFORMATION'	=> $user->lang['MEDAL_INFORMATION'],
			'L_MEDAL_NAME'			=> $user->lang['MEDAL'],
			'L_MEDAL_DETAIL'		=> $user->lang['MEDAL_DETAIL'],
// ----------------------------
Replace with:

Code: Select all

// Medals System MOD
			'USER_ID'				=> $user_id,
			'U_NOMINATE'			=> ( $config['medals_active'] == 1) ? (( $s_nominate ) ? append_sid("{$phpbb_root_path}medals.$phpEx", "m=nominate&u={$user_id}") : '') : '',
			'U_CAN_AWARD_MEDALS'	=> ( $auth->acl_get('a_user') || $is_mod ) ? append_sid("{$phpbb_root_path}medals.$phpEx", "m=award&u={$user_id}") : '',
			'L_USER_MEDAL'			=> ( $config['medals_active'] == 1) ? $user->lang['MEDALS'] : '',
			'USER_MEDAL_COUNT'		=> ( $config['medals_active'] == 1) ? $medal_count : '',
			'L_MEDAL_INFORMATION'	=> ( $config['medals_active'] == 1) ? $user->lang['MEDAL_INFORMATION'] : '',
			'L_MEDAL_NAME'			=> ( $config['medals_active'] == 1) ? $user->lang['MEDAL'] : '',
			'L_MEDAL_DETAIL'		=> ( $config['medals_active'] == 1) ? $user->lang['MEDAL_DETAIL'] : '',
// ----------------------------
Theriddler - Former Moderator @ phpBB.nl | phpBBservice.nl Team-member
Image My Extensions | buy me a beer Image
User avatar
Jessica
Former Team Member
Posts: 4342
Joined: Sun Jul 18, 2010 2:53 pm
Location: Pennsylvania, USA
Name: Jessica

Re: [BETA] Medal System MOD 0.21.0

Post by Jessica »

Thanks, Theriddler1, for the edit! I'll make that change asap...been busy lately
Pro-choice, Atheist, Pro-LGBT rights
Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid. - Albert Einstein
Marinho
Registered User
Posts: 6
Joined: Wed Aug 28, 2013 6:15 am

Re: [BETA] Medal System MOD 0.21.0

Post by Marinho »

Hi I am new in the Community never I stirred with Phpbb, then I am quite layman, always participated in forums that had this type of mod of medals, and it always struck me, but I've always used SMF and the community is never have interesing in doing something of this kind. :cry:

Then I have a doubt, I installed the mod via the AUTOMOD, everything occurred as well, but I don't know enable him, what I have to do to activate the mod? Do I have to do something in Admin Control Panel (ACP?) can you help me? :D
I don't consigor nable the mod, nor configure in order I am noob :lol:

* removed *

Thank you.
Last edited by marian0810 on Wed Aug 28, 2013 12:30 pm, edited 1 time in total.
Reason: offtopic removed
User avatar
Jessica
Former Team Member
Posts: 4342
Joined: Sun Jul 18, 2010 2:53 pm
Location: Pennsylvania, USA
Name: Jessica

Re: [BETA] Medal System MOD 0.21.0

Post by Jessica »

Marinho wrote:Hi I am new in the Community never I stirred with Phpbb, then I am quite layman, always participated in forums that had this type of mod of medals, and it always struck me, but I've always used SMF and the community is never have interesing in doing something of this kind. :cry:

Then I have a doubt, I installed the mod via the AUTOMOD, everything occurred as well, but I don't know enable him, what I have to do to activate the mod? Do I have to do something in Admin Control Panel (ACP?) can you help me? :D
I don't consigor nable the mod, nor configure in order I am noob :lol:

* removed *

Thank you.
Make sure you have run /msm_install/index.php to add modules and permissions

After that, you can find the settings in the .MODs tab
Pro-choice, Atheist, Pro-LGBT rights
Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid. - Albert Einstein
Caphalor
Registered User
Posts: 1
Joined: Thu Aug 29, 2013 11:42 am

Re: [BETA] Medal System MOD 0.21.0

Post by Caphalor »

Managed to get this Mod working and it's great! Much appreciate keeping it alive :)

However, everything runs fine using the default styles. For the forum I'm trying to set up, I'm using the template SE Gamer Dark (https://www.phpbb.com/customise/db/style/se_gamer_dark/).
While in prosilver there's link in the navigation bar to the medals page, there isn't one in SE Gamer Dark. Unfortunately I do not know enough of coding to implement a button which refers to the medals page.

The Nav bar in SE Gamer Dark looks like this:
Image

In overall_header.html (in SE Gamer Dark) I found this code, which I assume refers to the navigation bar:

Code: Select all

<div class="nav">
                	<div class="fl">
                    	<ul>
                        	<li<!-- IF SCRIPT_NAME eq 'index' --> class="current"<!-- ENDIF -->><a href="{U_INDEX}">{L_INDEX}</a></li>
                            <li<!-- IF SCRIPT_NAME eq 'faq' --> class="current"<!-- ENDIF -->><a href="{U_FAQ}">{L_FAQ}</a></li>
                            <!-- IF S_DISPLAY_MEMBERLIST -->
                            	<li<!-- IF SCRIPT_NAME eq 'memberlist' --> class="current"<!-- ENDIF -->><a href="{U_MEMBERLIST}">{L_MEMBERLIST}</a></li>
                            <!-- ENDIF -->
                            <!-- IF S_DISPLAY_MEMBERLIST -->
<li<!-- IF SCRIPT_NAME eq 'memberlist' --> class="current"<!-- ENDIF -->><a href="{U_MEDALS}" title="{L_MEDALS_VIEW_EXPLAIN}">{L_MEDALS_VIEW}</a></li>
                            <!-- ENDIF -->
                            <!-- IF S_DISPLAY_SEARCH -->
                            	<li<!-- IF SCRIPT_NAME eq 'search' --> class="current"<!-- ENDIF -->><a href="{U_SEARCH}">{L_SEARCH}</a></li>
                            <!-- ENDIF -->
                        </ul>
                    </div>
While in prosilver the link that refers to the medals page, I believe looks this:

Code: Select all

<!-- IF U_MEDALS and S_USER_LOGGED_IN and not S_IS_BOT --><li class="icon-medal"><a href="{U_MEDALS}" title="{L_MEDALS_VIEW_EXPLAIN}">{L_MEDALS_VIEW}</a></li><!-- ENDIF -->
I'm wondering if anyone can offer any help as to how to add a button in the SE Gamer Dark navigation bar that would refer to the medals page. Would be even nicer if it would only be visible once logged in, just like the members button.

Much appreciation in advance!

Caphalor

Return to “[3.0.x] MODs in Development”