## EasyMod 0.3.0 Compatible
##############################################################
## MOD Title: Synthesize Shop
## MOD Author: Zarath < null@null.com > ( Jamie ) http://www.zarath.com
## MOD Description: Adds a synthesizing shop to your shop list
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: <5 Minutes
## Files To Edit:	includes/functions.php
##			language/lang_english/lang_main.php
##			language/lang_english/lang_shop.php
## Included Files:	shop_synth.php
## 			templates/shop/shop_synth_body.tpl
## 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: Please note, I will not give any kind of email 
##               or PM support. Post on http://forums.zarath.com
##		 or http://www.phpbbhacks.com
##
##		 All my mods & services are at http://www.zarath.com
##
##############################################################
## MOD History:
##
##   2006-09-10 - Version 1.0.0
##      - Initial Release
##
##   2006-09-20 - Version 1.0.1
##      - EasyMod Compatible
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################


#
#-----[ DIY INSTRUCTIONS ]------------------------------------------
# 
Please ensure you read the readme.txt to learn how to use the synthesize shop. It is very difficult to figure out the extra options without at least briefly reading the stuff in readme.txt. Thanks.

#
#-----[ DIY INSTRUCTIONS ]------------------------------------------
# 
Images need to go into your shop/images/ folder, same as the normal shop.
Alter shop_synth.php the "$lose_chance = '15';" to alter the chances of losing an item when desynthing an item.

# 
#-----[ COPY ]------------------------------------------ 
# Remember to add the template to each of your template folders!
#
copy shop_synth.php to shop_synth.php
copy templates/shop/shop_synth_body.tpl to templates/subSilver/shop/shop_synth_body.tpl

#
#-----[ SQL ]------------------------------------------
#
# You can either alter the table prefix and run this through phpMyAdmin or
# upload the sql_install.php file to your forum index and run it from an
# admin account. No need to do both... SQL install file is made for MySQL.
#
INSERT INTO `phpbb_shops` (`shopname`, `shoptype`) VALUES('Synthesize Shop', 'admin_only'); # This MUST be added and not renamed!
INSERT INTO `phpbb_shops` (`shopname`, `shoptype`, `url`) VALUES('Synthesizing', 'Synthesizing', 'shop_synth.php'); # This may be renamed.

# 
#-----[ OPEN ]------------------------------------------------ 
#
 includes/functions.php

# 
#-----[ FIND ]------------------------------------------------ 
# 
?>

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
if ( !(function_exists(duration)) )
{
	function duration($seconds)
	{
		global $lang;

		if ( $seconds > 86399 )
		{
			$days = floor($seconds / 86400);
			$seconds = ($seconds - ($days * 86400));
			$string .= ( $days > 1 ) ? $days .' ' . $lang['jobs_days'] . ', ' : $days .' ' . $lang['jobs_day'] . ', ';
		}
		if ( $seconds > 3599 )
		{
			$hours = floor($seconds / 3600);

			if ( $seconds != 0 )
			{
				$string .= ( $hours > 1 ) ? $hours .' ' . $lang['jobs_hours'] . ', ' : $hours .' ' . $lang['jobs_hour'] . ', ';
			}

			$seconds = ( $days > 0 ) ? 0 : ( $seconds - ($hours * 3600) );
		}
		if ( $seconds > 59 )
		{
			$minutes = floor($seconds / 60);
			if ( $seconds != 0 )
			{
				$string .= ( $minutes > 1) ? $minutes .' ' . $lang['jobs_minutes'] . ', ' : $minutes .' ' . $lang['jobs_minute'] . ', ';
			}

			$seconds = ( $hours > 0 ) ? 0 : ($seconds - ($minutes * 60));
		}
		if ( $seconds > 0 )
		{
			$string .= ( $seconds > 1 ) ? $seconds . ' ' . $lang['jobs_seconds'] . ', ' : $seconds . ' ' . $lang['jobs_second'] . ', ';
		}

		$string = substr($string, 0, -2);
		return $string;
	}
}

# 
#-----[ OPEN ]------------------------------------------ 
# You can skip the jobs vars if you're added them before.
#
 language/lang_english/lang_main.php

# 
#-----[ FIND ]------------------------------------------ 
#
?>

#
#-----[ BEFORE, ADD ]------------------------------------------ 
#
$lang['jobs_second'] = 'Second';
$lang['jobs_seconds'] = 'Seconds';
$lang['jobs_minute'] = 'Minute';
$lang['jobs_minutes'] = 'Minutes';
$lang['jobs_hour'] = 'Hour';
$lang['jobs_hours'] = 'Hours';
$lang['jobs_day'] = 'Day';
$lang['jobs_days'] = 'Days';

# 
#-----[ OPEN ]------------------------------------------ 
# 
 language/lang_english/lang_shop.php

# 
#-----[ FIND ]------------------------------------------ 
#
?>

#
#-----[ BEFORE, ADD ]------------------------------------------ 
#
//
// Synthesizing Shop Variables
//
$lang['sshop_return'] = 'Click %shere%s to return to the Synthesize Shop.';
$lang['sshop_no_sitems'] = 'Error getting synth items info!';
$lang['sshop_no_desynth'] = 'Error getting user desynthable items!';
$lang['sshop_invalid'] = 'Sorry, that is not a valid item!';
$lang['sshop_no_gold'] = 'Sorry, you do not have enough gold to synthesize this item!';
$lang['sshop_missing_item'] = 'You are missing the required item';
$lang['sshop_not_in_shop'] = 'Sorry, that item is not in the Synthesize Shop!';
$lang['sshop_no_desynth'] = 'You cannot desynth that item!';
$lang['sshop_dont_own'] = 'You do not own that item!';

$lang['sshop_synthesize'] = 'Synthesize';
$lang['sshop_avail_synths'] = 'Available Synthesize Items';
$lang['sshop_synth_item'] = 'The synthesizer takes some items from you and quickly takes them into the back room.<br />Several clangs, chings and BANGS resonate from the room.<br />The synthesizer returns from the back room and hands you <b>%1$s</b>';
$lang['sshop_desynth'] = 'The synthesizer takes <b>%1$s</b> from you and begins to smash it into pieces.<br />Fragments of <b>%1$s</b> go flying everywhere as he breaks it down to its basic components.<br />The synthesizer hands you a pile of the basic elements of <b>%1$s</b>, including <b>%2$s</b>';

$lang['sshop_image'] = 'Image';
$lang['sshop_item_name'] = 'Item Name';
$lang['sshop_description'] = 'Description';
$lang['sshop_requires'] = 'Requires';
$lang['sshop_cost'] = 'Cost';
$lang['sshop_none'] = 'None';

$lang['sshop_synth'] = 'Synthesize Items';
$lang['sshop_but_desynth'] = 'Desynthesize Item';
//
// Synthesizing Shop Variables
//

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