[BETA] Medal System MOD [ Latest: 0.4.6 ]

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! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
xmulder
Registered User
Posts: 429
Joined: Thu Jun 27, 2002 8:37 pm

Post by xmulder »

is there a way to stop it automatically giving the medal moderator the medal?

kaos1984
Registered User
Posts: 314
Joined: Mon Jun 30, 2003 11:02 am

Post by kaos1984 »

i myself, (admin) have made my self the medal mod, so how do i give people medals?

kaos1984
Registered User
Posts: 314
Joined: Mon Jun 30, 2003 11:02 am

Post by kaos1984 »

Code: Select all

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/{YOUR_THEME}/overall_header.tpl

# 
#-----[ FIND ]------------------------------------------ 
#
{L_USERGROUPS}</a>&

# 
#-----[ AFTER,ADD ]------------------------------------------ 
#
&<a href="{U_MEDALS}" class="mainmenu">{I_MEDALS}{L_MEDALS}</a>&
the template that i am using does not have {L_USERGROUPS}</a>&

so wot do i do? the code it does have is below, some1 help

Code: Select all

<td width="2%"><img src="templates/skyLineBlue/images/nav_2_gap.gif" width="5" height="28"></td>

                <td width="10%"><a href="{U_GROUP_CP}" class="mainmenu"> <img src="templates/skyLineBlue/images/button_usergroups.gif" width="80" height="12" border="0" alt="{L_GROUP_CP}"></a></td>

                <td width="2%"><img src="templates/skyLineBlue/images/nav_2_gap.gif" width="5" height="28" border="0" alt="{L_USERGROUPS}"></td>

                <td width="10%"><a href="{U_PROFILE}" class="mainmenu"> <img src="templates/skyLineBlue/images/button_profile.gif" width="53" height="12" border="0" alt="{L_PROFILE}"></a></td>

                <td width="2%"><img src="templates/skyLineBlue/images/nav_2_gap.gif" width="5" height="28"></td>

                <td width="10%"><a href="{U_PRIVATEMSGS}" class="mainmenu"> <img src="templates/skyLineBlue/images/button_privatemsgs.gif" width="109" height="12" border="0" alt="{PRIVATE_MESSAGE_INFO}"></a></td>

		<td width="2%"><img src="templates/skyLineBlue/images/nav_2_gap.gif" width="5" height="28"></td>

                <td width="10%"><a href="{U_LOGIN_LOGOUT}" class="mainmenu"> <img src="templates/skyLineBlue/images/button_loginout.gif" width="69" height="12" border="0" alt="{L_LOGIN_LOGOUT}"></a></td>
 
                <td width="10%" align="right"><img src="templates/skyLineBlue/images/panel_2_cap.gif" width="22" height="28"></td>
              </tr>

ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

xmulder wrote: is there a way to stop it automatically giving the medal moderator the medal?

I will see what I can do, or probably change the way user is managed by moderator
kaos1984 wrote: i myself, (admin) have made my self the medal mod, so how do i give people medals?

go to medals.php, follow the Link to CP link to user management
kaos1984 wrote: so wot do i do? the code it does have is below, some1 help

Code: Select all

                <td width="2%"><img src="templates/skyLineBlue/images/nav_2_gap.gif" width="5" height="28" border="0" alt="{L_USERGROUPS}"></td>

the "&" sign you see is probably & n b s p ;
Just do the following

Code: Select all

                <td width="10%"><a href="{U_MEDALS}" class="mainmenu"> <img src="YOUR IMAGE LINK TO MEDALS.PHP" width="53" height="12" border="0" alt="{L_MEDALS}"></a></td>
~Mac

xmulder
Registered User
Posts: 429
Joined: Thu Jun 27, 2002 8:37 pm

Post by xmulder »

ycl6 wrote:
xmulder wrote:is there a way to stop it automatically giving the medal moderator the medal?

I will see what I can do, or probably change the way user is managed by moderator
~Mac


thankyou :D

User avatar
Suede
Registered User
Posts: 342
Joined: Sat Dec 14, 2002 7:40 pm

Post by Suede »

btw - thanks for this mod. Am using it and am very happy!

ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

Ok, to xmulder and other who DO NOT wish to give medal moderator the medal as default, do the following

open admin_medal.php

find

Code: Select all

			if ( $medal_info['medal_moderator'] != $medal_moderator )
			{
				if ( $delete_old_moderator )
replace with

Code: Select all

/*			if ( $medal_info['medal_moderator'] != $medal_moderator )
			{
				if ( $delete_old_moderator )
find

Code: Select all

					}
				}
			}
			
			$sql = "UPDATE " . MEDAL_TABLE . "
replace with

Code: Select all

					}
				}
			}
*/			
			$sql = "UPDATE " . MEDAL_TABLE . "
find

Code: Select all

			$sql = "INSERT INTO " . USER_MEDAL_TABLE . " (medal_id, user_id)
				VALUES ($new_medal_id, $medal_moderator)";
			if ( !$db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not insert new user-medal info', '', __LINE__, __FILE__, $sql);
			}
replace with

Code: Select all

//			$sql = "INSERT INTO " . USER_MEDAL_TABLE . " (medal_id, user_id)
//				VALUES ($new_medal_id, $medal_moderator)";
//			if ( !$db->sql_query($sql) )
//			{
//				message_die(GENERAL_ERROR, 'Could not insert new user-medal info', '', __LINE__, __FILE__, $sql);
//			}
open medalcp.php

find

Code: Select all

	//
	// Get user information for this medal
	//
	$sql = "SELECT u.username, u.user_id, u.user_viewemail, u.user_posts, u.user_regdate, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_msnm
		FROM " . USERS_TABLE . " u, " . USER_MEDAL_TABLE . " um
		WHERE um.medal_id = $medal_id
			AND u.user_id = um.user_id
			AND um.user_id <> " . $medal_moderator['user_id'] . " 
		ORDER BY u.username"; 
in line find

Code: Select all

			AND um.user_id <> " . $medal_moderator['user_id'] . " 
delete

Code: Select all

			AND um.user_id <> " . $medal_moderator['user_id'] . " 
this way, the moderator can choose to give himself/herself the medal or not in the medalcp.

this should work, pls feedback if it works or not, thanks

~Mac

xmulder
Registered User
Posts: 429
Joined: Thu Jun 27, 2002 8:37 pm

Post by xmulder »

thats done nothing =/ they still display for me :(

Should there be a change to one of the .tpl files as well as the .php files?

ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

I think it's because your id has already being written to the medal_user table
it should work on a freshly installed board (I meant this MOD)
if you can drop the two medal tables & re-add them, it should work

~Mac

User avatar
dask
Registered User
Posts: 76
Joined: Wed Apr 09, 2003 2:55 am

Post by dask »

-edited the code
-deleting the values of the medal moderator

it seems to work !!! Great !!!!

Nice job with this mod, !!!

One question,
is it meant that you don't see the medal picture in the viewprofile?
Example
Would like to see the medalpicture there

ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

I think there might be a problem in the image path in your ACP

for example, in medals.php, your image path is as follow (2 "//")

Code: Select all

http://scs.xgameservers.com/phpbb2//medals/xxxxx.gif
try to set the path in ACP as

Code: Select all

medals/xxxxx.gif
~Mac

User avatar
dask
Registered User
Posts: 76
Joined: Wed Apr 09, 2003 2:55 am

Post by dask »

yes you are right,

i made a mistake by putting

/medals/xxxxx.gif

instead of

medals/xxxxx.gif

ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

glad to know it works on your board. This mod is very suitable with your board :!:

~Mac

User avatar
OmegaQuest
Registered User
Posts: 76
Joined: Mon Sep 01, 2003 9:12 pm
Location: Washington, DC

Post by OmegaQuest »

Great Plugin,

I have a Request though, can you make it where the Moderator of the Medals doesn't have to HAVE the medal ?

Reason, I have a Spammer Medal that I give to Spammers but I don't want to be wearing it myself ...... lol

Thanks
Last edited by OmegaQuest on Sun Nov 09, 2003 8:08 pm, edited 1 time in total.

pengrus
Registered User
Posts: 566
Joined: Mon Dec 02, 2002 6:13 am
Contact:

Post by pengrus »

OmegaQuest wrote: Great Plugin,

I have a Request though, can you make it where the Moderator of the Medals doesn't have to HAVE the medal ?

Reason, I have a Spammer Medal that I give to Spammers but I don't want to be wearing it myself ...... lol

Thanks


Did you read the thread in full? He offered the solution, right?

Post Reply

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