<?php
/*
copyright: copyright 2004 Php Image Host. All Rights Reserved. You may modify this file for use on your
					site running a licenced copy of the Php Image Host scripts.
					You must not distribute this file or derivations of it.
Nullified By CrAcKlOvE
*/

require_once(dirname(__FILE__).'/includes/config.inc.php');

$updated = false;
$errors = array();

$ace->loadsettings();

if( $ace->config->siteurl == '' ) $ace->config->siteurl = 'http://'.$_SERVER['HTTP_HOST'].'/';
if( $ace->config->image_folder == '' ) $ace->config->image_folder = realpath(dirname(__FILE__).'/../images/');
if( $ace->config->thumb_folder == '' ) $ace->config->thumb_folder = realpath(dirname(__FILE__).'/../thumbs/');
if( $ace->config->image_url == '' ) $ace->config->image_url = $ace->config->siteurl.'images/';
if( $ace->config->thumb_url == '' ) $ace->config->thumb_url = $ace->config->siteurl.'thumbs/';

if( $ace->getstr('update', $_POST) ){
	$ace->config->payment_email_subject = $ace->getstr('payment_email_subject', $_POST);
	$ace->config->payment_email_message = $ace->getstr('payment_email_message', $_POST);
	$ace->config->paypal_email = $ace->getstr('paypal_email', $_POST);
	$ace->config->paypal_account_email = $ace->getstr('paypal_account_email', $_POST);
	$ace->config->payment_notifications = $ace->getint('payment_notifications', $_POST);

	$ace->config->notify_bandwidth_exceeded = $ace->getint('notify_bandwidth_exceeded', $_POST);
	$ace->config->bandwidth_exceeded_from = $ace->getstr('bandwidth_exceeded_from', $_POST);
	$ace->config->bandwidth_exceeded_subject = $ace->getstr('bandwidth_exceeded_subject', $_POST);
	$ace->config->bandwidth_exceeded_message = $ace->getstr('bandwidth_exceeded_message', $_POST);

	$ace->config->ban_ips = $ace->getint('ban_ips', $_POST);

	$gmw =  $ace->getint('gallery_max_image_width', $_POST);
	$gmh = $ace->getint('gallery_max_image_height', $_POST);
	$gmw = max(10,$gmw);
	$gmh = max(10,$gmh);
	$ace->config->gallery_max_image_width = $gmw;
	$ace->config->gallery_max_image_height = $gmh;
	if( $ace->config->paypal_email == '' ){
		$errors[] = 'You must enter a valid paypal email address.';
	}elseif( !$ace->validateemail($ace->config->paypal_email) ){
		$errors[] = '"'.htmlspecialchars($ace->config->paypal_email).'" is not a valid email address. You must enter a valid paypal email address.';
	}
	$ace->config->email_images_subject = $ace->getstr('email_images_subject', $_POST);
	$ace->config->email_images_template = $ace->getstr('email_images_template', $_POST);

	$ace->config->signup_email_from = $ace->getstr('signup_email_from', $_POST);
	$ace->config->signup_email_template = $ace->getstr('signup_email_template', $_POST);
	$ace->config->reminder_email_from = $ace->getstr('reminder_email_from', $_POST);
	$ace->config->reminder_email_template = $ace->getstr('reminder_email_template', $_POST);
	$ace->config->email_confirmation = $ace->getint('email_confirmation', $_POST);
	$ace->config->email_confirmation_key = $ace->getstr('email_confirmation_key', $_POST);
	if( !$ace->validateemail($ace->config->signup_email_from) ) $errors[] = 'You must enter a valid email address to use as the "From" address on new account emails.';
	if( !$ace->validateemail($ace->config->reminder_email_from) ) $errors[] = 'You must enter a valid email address to use as the "From" address on password reminder emails.';
	if( $ace->config->email_confirmation_key == '' ) $ace->config->email_confirmation_key = substr(md5($_SERVER['HTTP_HOST'].time()),10);

	$ace->config->admin_username = $ace->getstr('admin_username', $_POST);
	$ace->config->admin_password = $ace->getstr('admin_password', $_POST);
	$ace->config->admin_email = $ace->getstr('admin_email', $_POST);
	$ace->config->allow_uploads = $ace->getint('allow_uploads', $_POST);
	$ace->config->allow_signups = $ace->getint('allow_signups', $_POST);
	$ace->config->sitename = $ace->getstr('sitename', $_POST);
	$ace->config->siteurl = $ace->getstr('siteurl', $_POST);
	$ace->config->thumbnail_width = $ace->getint('thumbnail_width', $_POST);
	$ace->config->thumbnail_height = $ace->getint('thumbnail_height', $_POST);
	$ace->config->image_folder =$ace->getstr('image_folder', $_POST);
	$ace->config->image_url = $ace->getstr('image_url', $_POST);
	$ace->config->thumb_folder = $ace->getstr('thumb_folder', $_POST);
	$ace->config->thumb_url = $ace->getstr('thumb_url', $_POST);
	$ace->config->branding_text = $ace->getstr('branding_text', $_POST);
	$ace->config->branding_size = min(30,max(6,$ace->getint('branding_size', $_POST)));
	$ace->config->branding_color = preg_replace('/[^0-9a-f]/i', '',strtolower($ace->getstr('branding_color', $_POST)));
	$ace->config->branding_bgcolor = preg_replace('/[^0-9a-f]/i', '',strtolower($ace->getstr('branding_bgcolor', $_POST)));
	$ace->config->min_branding_width = $ace->getint('min_branding_width', $_POST, 200);
	$ace->config->min_branding_height = $ace->getint('min_branding_height', $_POST, 100);
	$ace->config->branding_color = str_pad($ace->config->branding_color,6,'f');
	if( strlen($ace->config->branding_color) > 6 ) $ace->config->branding_color = substr($ace->config->branding_color,0,6);

	$ace->config->branding_bgcolor = str_pad($ace->config->branding_bgcolor,6,'0');
	if( strlen($ace->config->branding_bgcolor) > 6 ) $ace->config->branding_bgcolor = substr($ace->config->branding_bgcolor,0,6);

	$ace->config->branding_color = '#'.$ace->config->branding_color;
	$ace->config->branding_bgcolor = '#'.$ace->config->branding_bgcolor;


	$ace->config->branding_transparency = min(100,max(0,$ace->getint('branding_transparency', $_POST)));
	if( $ace->config->thumbnail_width < 1 || $ace->config->thumbnail_height < 1 )
		$errors[] = 'You must specify the thumbnail width and height.';
	if( !preg_match('/^http.*\/$/i', $ace->config->image_url ) )
		$errors[] = 'You must enter the full url to the image folder.';
	if( !preg_match('/^http.*\/$/i', $ace->config->thumb_url ) )
		$errors[] = 'You must enter the full url to the thumbnail image folder.';
	if( !@is_dir($ace->config->image_folder) ){
		$errors[] = 'You must specify the folder to save images in.';
		if( $ace->config->image_folder != '' ) $errors[] = 'The folder "'.htmlspecialchars($ace->config->image_folder).'" does not exist.';
	}elseif(  !@is_writable($ace->config->image_folder) ){
		$errors[] = 'You must set the permissions on the images folder "'.htmlspecialchars($ace->config->image_folder).'" so the script can write to it.';
	}
	if( !@is_dir($ace->config->thumb_folder) ){
		$errors[] = 'You must specify the folder to save thumbnail images in.';
	}elseif(  !@is_writable($ace->config->thumb_folder) ){
		$errors[] = 'You must set the permissions on the thumbnail images folder "'.htmlspecialchars($ace->config->thumb_folder).'" so the script can write to it.';
	}

	if( $ace->config->siteurl == '' ) $errors[] = 'You must enter the full url for your site, including the trailing slash "/".';
	if( !preg_match('/^http:\/\/.*/',$ace->config->siteurl) )
		$ace->config->siteurl = 'http://'.$ace->config->siteurl;
	if( $ace->config->siteurl[strlen($ace->config->siteurl)-1] != '/' ) $ace->config->siteurl.='/'; 
	if( $ace->config->admin_email == '' || !$ace->validateemail($ace->config->admin_email) ){
		$errors[] = 'You must enter a valid admin email address.';
	}
	if( $ace->config->admin_username == '' ) $errors[] = 'You must enter an admin username.';
	if( $ace->config->admin_password == '' ) $errors[] = 'You must enter an admin password.';
	if( count($errors) == 0 ){
		$ace->savesettings();
//array('admin_password', 'admin_username', 'admin_email',
//											'allow_uploads', 'categories', 'sitename', 'siteurl'));
		$updated = true;
	}
}

require_once(dirname(__FILE__).'/includes/header.inc.php');
?>
<div style="text-align: center;">
<b>Site Settings</b><br /><br />
Edit the values on this page to change general site and image settings.
</div>
<br /><br />
<?php
if( count($errors) > 0 ){
?>
<div class="errors">Please correct the following errors:<br /><br /><?php echo join("<br />\n", $errors);?></div>
<?php
}

if( $updated ){
?>
<div class="errors">Admin Settings Saved.</div>
<?php
}

?>
<form action="settings.php" method="post">
<table class="formtable" cellspacing="1" cellpadding="0" border="0" align="center" width="90%">
<tr>
	<td class="formheading" colspan="2">Admin Settings</td>
</tr>
<tr>
	<td class="formlabel">Admin Username:</td>
	<td class="formfield"><input class="forminput" type="text" name="admin_username" value="<?php echo htmlspecialchars($ace->config->admin_username);?>" />
		<br />The username used to login to this admin area.
	</td>
</tr>
<tr>
	<td class="formlabel">Admin Password:</td>
	<td class="formfield"><input class="forminput" type="text" name="admin_password" value="<?php echo htmlspecialchars($ace->config->admin_password);?>" />
		<br />The password used to login to this admin area.
	</td>
</tr>
<tr>
	<td class="formlabel">Admin Email:</td>
	<td class="formfield"><input class="forminput" type="text" name="admin_email" value="<?php echo htmlspecialchars($ace->config->admin_email);?>" />
		<br />The email address that the contact form submits to.
	</td>
</tr>
<tr>
	<td class="formheading" colspan="2">General Site Settings</td>
</tr>
<tr>
	<td class="formlabel">Site Name:</td>
	<td class="formfield"><input class="forminput" type="text" name="sitename" value="<?php echo htmlspecialchars($ace->config->sitename);?>" />
		<br />The name for this website. This is displayed on certain pages of the site, and is also substituted for the
		tag {sitename} when used in any of the <a href="pagecontent.php" >page content templates</a>.
	</td>
</tr>
<tr>
	<td class="formlabel">Site URL:</td>
	<td class="formfield"><input class="forminput" type="text" name="siteurl" value="<?php echo htmlspecialchars($ace->config->siteurl);?>" />
		<br />The url for your site, including the http://
	</td>
</tr>
<tr>
	<td class="formheading" colspan="2">Security Settings</td>
</tr>
<tr>
	<td class="formlabel">Allow Sign Ups:</td>
	<td class="formfield"><input type="checkbox" name="allow_signups" value="1" <?php if( $ace->config->allow_signups == 1 ) echo ' CHECKED ';?> />
		<br />Check this box to allow new members to sign up to the site.
	</td>
</tr>

<tr>
	<td class="formlabel">Allow Uploads:</td>
	<td class="formfield"><input type="checkbox" name="allow_uploads" value="1" <?php if( $ace->config->allow_uploads == 1 ) echo ' CHECKED ';?> />
		<br />Check this box to allow your members to upload their own images. 
		<br />This box should normally be checked. The only reason for unchecking this box is if your site is being abused
			and you need to stop <b>all</b> image uploads while you resolve the problem.
		<br />No members can upload <b>any</b> images when this box is not checked.
		<br />You can edit the "Uploads Suspended" message which is displayed when this box is unchecked on the 
		<a href="pagecontent.php">Page Content</a> page.
	</td>
</tr>
<tr>
	<td class="formlabel">Ban IP Addresses?</td>
	<td class="formfield"><input type="checkbox" name="ban_ips" value="1" <?php if( $ace->config->ban_ips == 1 ) echo ' CHECKED ';?> />
		<br />Check this box to have the script automatically ban visitors from i.p. addresses specified on
		the <a href="ips.php">banned ip address page</a> from logging in, signing up or uploading images.
		<br />Uncheck this box if you are using .htaccess files to ban i.p. addresses instead.
	</td>
</tr>
<tr>
	<td class="formheading" colspan="2">Image Settings</td>
</tr>

<tr>
	<td class="formlabel">Image Folder:</td>
	<td class="formfield"><input type="text" class="forminput" name="image_folder" value="<?php echo htmlspecialchars($ace->config->image_folder);?>" />
		<br />Enter the full path on your server to the folder to store uploaded images in (eg. /home/yoursite/public_html/images).
		<br />This folder must have the correct permissions for the scripts to be able to create and delete files in it.
	</td>
</tr>
<tr>
	<td class="formlabel">Image Folder URL:</td>
	<td class="formfield"><input type="text" class="forminput" name="image_url" value="<?php echo htmlspecialchars($ace->config->image_url);?>" />
		<br />Enter the full url (including domain name and http://) for the folder where images are stored, including the
			trailing slash "/". (eg. http://www.mysite.com/images/ )
	</td>
</tr>
<tr>
	<td class="formlabel">Thumbnail Folder:</td>
	<td class="formfield"><input type="text" class="forminput" name="thumb_folder" value="<?php echo htmlspecialchars($ace->config->thumb_folder);?>" />
		<br />Enter the full path on your server to the folder to store uploaded image thumbnails in (eg. /home/yoursite/public_html/thumbnails).
		<br />This folder must have the correct permissions for the scripts to be able to create and delete files in it.
	</td>
</tr>
<tr>
	<td class="formlabel">Thumbnail Folder URL:</td>
	<td class="formfield"><input type="text" class="forminput" name="thumb_url" value="<?php echo htmlspecialchars($ace->config->thumb_url);?>" />
		<br />Enter the full url (including domain name and http://) for the folder where thumbnail images are stored, including the
			trailing slash "/". (eg. http://www.mysite.com/thumbs/ )
	</td>
</tr>
<tr>
	<td class="formlabel">Thumbnail Width:</td>
	<td class="formfield"><input type="text" class="formnumber"  name="thumbnail_width" value="<?php echo $ace->config->thumbnail_width;?>" />
		<br />The width for the automatically generated thumbnail images.
	</td>
</tr>
<tr>
	<td class="formlabel">Thumbnail Height:</td>
	<td class="formfield"><input type="text" class="formnumber" name="thumbnail_height" value="<?php echo $ace->config->thumbnail_height;?>" />
		<br />The height for the automatically generated thumbnail images.
	</td>
</tr>
<tr>
	<td class="formlabel">Max Gallery Image Width:</td>
	<td class="formfield"><input type="text" class="formnumber"  name="gallery_max_image_width" value="<?php echo $ace->config->gallery_max_image_width;?>" />
		<br />The maximum width to display images on the gallery pages.
		<br />Images will be proportionally resized with html to fit this size. Full size images can still be
		viewed by clicking on the image.
	</td>
</tr>
<tr>
	<td class="formlabel">Max Gallery Image Height:</td>
	<td class="formfield"><input type="text" class="formnumber" name="gallery_max_image_height" value="<?php echo $ace->config->gallery_max_image_height;?>" />
		<br />The maximum height to display images on the gallery pages.
		<br />Images will be proportionally resized with html to fit this size. Full size images can still be
		viewed by clicking on the image.
	</td>
</tr>

<tr>
	<td class="formheading" colspan="2">Image Branding Options</td>
</tr>
<tr>
	<td class="formlabel">Branding Text:</td>
	<td class="formfield"><input class="forminput" type="text" name="branding_text" value="<?php echo htmlspecialchars($ace->config->branding_text);?>" />
		<br />The branding text appears on images uploaded by members whose account type settings require it.
		<br />The branding text is normally your url.
	</td> 
</tr>
<tr>
	<td class="formlabel">Branding Text Size:</td>
	<td class="formfield"><input class="formnumber" type="text" name="branding_size" value="<?php echo $ace->config->branding_size;?>" />
		<br />The font size to use when adding branding text to images.
	</td>
</tr>
<tr>
	<td class="formlabel">Branding Text Color:</td>
	<td class="formfield"><input class="formnumber" type="text" name="branding_color" value="<?php echo $ace->config->branding_color;?>" />
		<br />The color to use when adding branding text to images, in html format (eg. #ffffff for white).
	</td>
</tr>
<tr>
	<td class="formlabel">Branding Background Color:</td>
	<td class="formfield"><input class="formnumber" type="text" name="branding_bgcolor" value="<?php echo $ace->config->branding_bgcolor;?>" />
		<br />The background color to use when adding branding text to images, in html format (eg. #000000 for black).
	</td>
</tr>
<tr>
	<td class="formlabel">Branding Background Transparency:</td>
	<td class="formfield">
		<select name="branding_transparency">
<?php
	for( $i = 0; $i <= 100; $i+=10){
		$sel = $ace->config->branding_transparency == $i ? ' SELECTED ' : '';
		echo "<option value=\"$i\"$sel>$i%</option>\n";
	}
?>
		</select>
		<br />The branding background color can be transparent, allowing most of the image to show through.
		<br />Values range from 0% (fully opaque) to 100% (fully transparent background).
	</td>
</tr>
<tr>
	<td class="formlabel">Minimum Image Width For Branding:</td>
	<td class="formfield"><input class="formnumber" type="text" name="min_branding_width" value="<?php echo $ace->config->min_branding_width;?>" />
		<br />Branding will <b>not</b> be added to images if their width is less than this number.
	</td>
</tr>
<tr>
	<td class="formlabel">Minimum Image Height For Branding:</td>
	<td class="formfield"><input class="formnumber" type="text" name="min_branding_height" value="<?php echo $ace->config->min_branding_height;?>" />
		<br />Branding will <b>not</b> be added to images if their height is less than this number.
	</td>
</tr>

<tr>
	<td class="formheading" colspan="2">New Account Settings</td>
</tr>
<tr>
	<td class="formlabel">Confirm Email Addresses?</td>
	<td class="formfield"><input type="checkbox" name="email_confirmation" value="1" <?php if( $ace->config->email_confirmation) echo ' CHECKED ';?> />
		Check this box to require all new members to confirm their email address is valid before they can use their accounts.
		<br />Confirmation is handled by sending a unique id in their sign-up email that they have to enter to confirm
		the email address they enter is valid.
	</td>
</tr>
<tr>
	<td class="formlabel">Confirmation Key Code:</td>
	<td class="formfield"><input type="text" class="forminput" name="email_confirmation_key" value="<?php echo htmlspecialchars($ace->config->email_confirmation_key);?>" />
		<br />Enter a random code here. This is used to generate the email confirmation key code that is sent to new members
		(as described above). This key code can be anything you want. It is never displayed to your members. It is just used
		to ensure that users cannot fake the confirmation code when they sign up.
	</td>
</tr>
<tr>
	<td class="formlabel">New Account Email From:</td>
	<td class="formfield"><input class="forminput" name="signup_email_from" value="<?php echo htmlspecialchars($ace->config->signup_email_from);?>" />
		<br />The email address to use as the "From" and "Reply To" address for the email automatically sent to new members
		when they create an account.
	</td>
</tr>
<tr>
	<td class="formlabel">New Account Email Template:</td>
	<td class="formfield"><textarea name="signup_email_template" class="forminput" style="height: 100px;"><?php echo htmlspecialchars($ace->config->signup_email_template);?></textarea>
		<br />The template for the message that is sent to a new member when they create an account.
		<br /><br />You can use the following tags in the template:
		<br /><b>{username}</b> will be replaced by their username.
		<br /><b>{name}</b> will be replaced by their name.
		<br /><b>{password}</b> will be replaced by their password.
		<br /><b>{confirmid}</b> will be replaced with the confirmation code they need to enter to confirm their email
		address and activate their account.
		<br /><b>{sitename}</b> will be replaced by the name of your website as specified above.
		<br /><b>{siteurl}</b> will be replaced by the url of your website as specified above.
		<br /><br />Additionally, anything inside the tags &lt;confirm&gt;...&lt;/confirm&gt; will be removed
		when you have the requirement to confirm all new accounts turned off.
		<br /><br />You can always add your own advertising and / or affiliate links and messages at the bottom
		of this email template.
	</td>
</tr>

<tr>
	<td class="formheading" colspan="2">Password Reminder Settings</td>
</tr>
<tr>
	<td class="formlabel">Password Reminder Email From:</td>
	<td class="formfield"><input class="forminput" name="reminder_email_from" value="<?php echo htmlspecialchars($ace->config->reminder_email_from);?>" />
		<br />The email address used as the "From" and "Reply-To" address on emails sent to members when they request a password reminder.
	</td>
</tr>
<tr>
	<td class="formlabel">Password Reminder Message:</td>
	<td class="formfield"><textarea name="reminder_email_template" class="forminput" style="height: 100px;"><?php echo htmlspecialchars($ace->config->reminder_email_template);?></textarea>
		<br />The template for the message that is sent when a member requests a password reminder. This message can include
		the confirmation link if the member has not yet confirmed their account.
		<br /><br />You can use the following tags in the template:
		<br /><b>{username}</b> will be replaced by their username.
		<br /><b>{name}</b> will be replaced by their name.
		<br /><b>{password}</b> will be replaced by their password.
		<br /><b>{confirmid}</b> will be replaced with the confirmation code they need to enter to confirm their email
		address and activate their account.
		<br /><b>{sitename}</b> will be replaced by the name of your website as specified above.
		<br /><b>{siteurl}</b> will be replaced by the url of your website as specified above.
		<br /><br />Additionally, anything inside the tags &lt;confirm&gt;...&lt;/confirm&gt; will be removed
		when you have the requirement to confirm all new accounts turned off.
		<br /><br />You can always add your own advertising and / or affiliate links and messages at the bottom
		of this email template.
	</td>
</tr>

<tr>
	<td class="formheading" colspan="2">Bandwidth Exceeded Emails</td>
</tr>
<tr>
	<td class="formlabel">Send Notifications?:</td>
	<td class="formfield"><input type="checkbox" name="notify_bandwidth_exceeded" value="1" <?php if( $ace->config->notify_bandwidth_exceeded) echo ' CHECKED ';?> />
		<br />Check this box if you want to send your users email notifications when they exceed their bandwidth allowance.
	</td>
</tr>
<tr>
	<td class="formlabel">From Email:</td>
	<td class="formfield"><input class="forminput" type="text" name="bandwidth_exceeded_from" value="<?php echo htmlspecialchars($ace->config->bandwidth_exceeded_from);?>" />
		<br />Your email address to send bandwidth exceeded notifications from.
	</td>
</tr>
<tr>
	<td class="formlabel">Bandwidth Exceeded Email Subject:</td>
	<td class="formfield"><input class="forminput" name="bandwidth_exceeded_subject" value="<?php echo htmlspecialchars($ace->config->bandwidth_exceeded_subject);?>" />
		<br />The subject for the emails sent when a member exceeds their monthly bandwidth allowance.
	</td>
</tr>
<tr>
	<td class="formlabel">Bandwidth Exceeded Email Message:</td>
	<td class="formfield"><textarea name="bandwidth_exceeded_message" class="forminput" style="height: 100px;"><?php echo htmlspecialchars($ace->config->bandwidth_exceeded_message);?></textarea>
		<br />The template for the message that is sent when a member exceeds their monthly bandwidth.
		<br /><br />You can use the following tags in the template:
		<br /><b>{username}</b> will be replaced by the user's username.
		<br /><b>{sitename}</b> will be replaced by the name of your website as specified above.
		<br /><b>{siteurl}</b> will be replaced by the url of your website as specified above.
		<br /><b>{date}</b> will be replaced by the payment date.
		<br /><br />You can always add your own advertising and / or affiliate links and messages at the bottom
		of this email template.
	</td>
</tr>

<tr>
	<td class="formheading" colspan="2">Payment Settings</td>
</tr>
<tr>
	<td class="formlabel">PayPal Email:</td>
	<td class="formfield"><input class="forminput" type="text" name="paypal_email" value="<?php echo htmlspecialchars($ace->config->paypal_email);?>" />
		<br />Your PayPal email address (for account upgrade payments).
	</td>
</tr>
<tr>
	<td class="formlabel">Primary PayPal Account Email:</td>
	<td class="formfield"><input class="forminput" type="text" name="paypal_account_email" value="<?php echo htmlspecialchars($ace->config->paypal_account_email);?>" />
		<br />Your PayPal account email address <b>*</b> this is only needed if you enter an email address other than
		your primary PayPal account email address above.
	</td>
</tr>
<tr>
	<td class="formlabel">Send Payment Notification Emails?</td>
	<td class="formfield"><input type="checkbox" name="payment_notifications" value="1" <?php if( $ace->config->payment_notifications == 1 ) echo ' CHECKED ';?> />
		<br />Check this box if you want to send your users payment notification emails whenever they make a
		subscription payment. <b>Note:</b> PayPal automatically send them notification emails anyway - but you may want
		to send your own "receipt".
	</td>
</tr>
<tr>
	<td class="formlabel">Payment Confirmation Message Subject:</td>
	<td class="formfield"><input class="forminput" name="payment_email_subject" value="<?php echo htmlspecialchars($ace->config->payment_email_subject);?>" />
		<br />The subject for the emails sent when a member upgrades their account via PayPal.
	</td>
</tr>
<tr>
	<td class="formlabel">Payment Confirmation Email Message:</td>
	<td class="formfield"><textarea name="payment_email_message" class="forminput" style="height: 100px;"><?php echo htmlspecialchars($ace->config->payment_email_message);?></textarea>
		<br />The template for the message that is sent when a member upgrades their account via paypal payment.
		<br /><br />You can use the following tags in the template:
		<br /><b>{username}</b> will be replaced by the user's username.
		<br /><b>{sitename}</b> will be replaced by the name of your website as specified above.
		<br /><b>{siteurl}</b> will be replaced by the url of your website as specified above.
		<br /><b>{amount}</b> will be replaced by the amount of the payment.
		<br /><b>{date}</b> will be replaced by the payment date.
		<br /><b>{paypalemail}</b> will be replaced by the paypal email address their payment was sent from.
		<br /><b>{expirydate}</b> will be replaced by the date their upgraded account expires.
		<br /><br />You can always add your own advertising and / or affiliate links and messages at the bottom
		of this email template.
	</td>
</tr>

<tr>
	<td class="formheading" colspan="2">Email Images Settings</td>
</tr>
<tr>
	<td class="formlabel">Email Images Message Subject:</td>
	<td class="formfield"><input class="forminput" name="email_images_subject" value="<?php echo htmlspecialchars($ace->config->email_images_subject);?>" />
		<br />The subject for the emails sent when a member emails links to their images to their friends.
	</td>
</tr>
<tr>
	<td class="formlabel">Email Images Message Template:</td>
	<td class="formfield"><textarea name="email_images_template" class="forminput" style="height: 100px;"><?php echo htmlspecialchars($ace->config->email_images_template);?></textarea>
		<br />The template for the message that is sent when a member emails links to their images to their friends.
		<br /><br />You can use the following tags in the template:
		<br /><b>{message}</b> will be replaced by the message that the member has entered.
		<br /><b>{imagelinks}</b> will be replaced by the urls of the images that the member wants to send.
		<br /><b>{sitename}</b> will be replaced by the name of your website as specified above.
		<br /><b>{siteurl}</b> will be replaced by the url of your website as specified above.
		<br /><br />You can always add your own advertising and / or affiliate links and messages at the bottom
		of this email template.
	</td>
</tr>
<tr>
	<td class="formlabel">&nbsp;</td>
	<td class="formfield"><input type="submit" name="update" value="Save Settings" /></td>
</tr>
</table>
</form>
<?php

require_once(dirname(__FILE__).'/includes/footer.inc.php');

?>
