######################################################## 
## Mod Title: Medal System (upgrade from 0.4.5 to 0.4.6)
## MOD Author: ycl6 < ycl6@users.sourceforge.net > (Y.C. LIN) http://macphpbbmod.sourceforge.net/
## MOD Description: This is the upgrade script for Medal System.
## Mod Version: 1.0.0
## 
## Installation Level: Easy
## Installation Time: 3 Minutes
##
## Files To Edit: 3
##	viewtopic.php
##	includes/functions.php
##	language/lang_english/lang_main.php
##
## Included Files: 0
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 
################################################################# 
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
############################################################## 
## Author Notes:
##	
##	This is for people using the older 0.4.5 version.
## 
############################################################## 
## MOD History: 
##
##   2006-04-04 - Version 1.0.0
##      - Initial Release
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################

# 
#-----[ COPY ]------------------------------------------ 
# 
copy root/medals.php to medals.php
copy root/medalcp.php to medalcp.php
copy root/admin/admin_medal.php to admin/admin_medal.php
copy root/templates/toggle.js to templates/toggle.js
# 
#-----[ OPEN ]------------------------------------------ 
# 
language/lang_english/lang_main.php
# 
#-----[ FIND ]------------------------------------------ 
#
$lang['Medal_details'] = 'Award Deatils';
# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
$lang['Medal_details'] = 'Award Details';
# 
#-----[ OPEN ]------------------------------------------ 
# 
viewtopic.php
# 
#-----[ FIND ]------------------------------------------ 
#
	if(!$result = $db->sql_query($sql))
		message_die(GENERAL_ERROR, "Error getting medal information", "", __LINE__, __FILE__, $sql);
		
	$medal_list = $db->sql_fetchrowset($result);
# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
	if(!$result = $db->sql_query($sql))
	{
		message_die(GENERAL_ERROR, "Error getting medal information", "", __LINE__, __FILE__, $sql);
	}

	$medal_list = $db->sql_fetchrowset($result);
# 
#-----[ FIND ]------------------------------------------ 
#
					else 
					{ 
						$col++; 
					}
				}
			}
		}
	}
# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
					else 
					{ 
						$col++; 
					}
				}
			}
		}
		$db->sql_freeresult($result);
	}
# 
#-----[ OPEN ]------------------------------------------ 
# 
includes/functions.php
# 
#-----[ FIND ]------------------------------------------ 
#
	$medal_info = array();
	while ( $medal_info = $db->sql_fetchrow($result) )
# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
	$medal_info = array();
	$found = FALSE;
	while ( $medal_info = $db->sql_fetchrow($result) )
# 
#-----[ FIND ]------------------------------------------ 
#
		if ( $medal_moderator == $userdata['user_id'] )
		{
			return TRUE;
		}
	}

}
# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
		if ( $medal_moderator == $userdata['user_id'] )
		{
			$found = TRUE;
		}
	}
	$db->sql_freeresult($result);
	
	return $found;
}


# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM