# Set this to the path to your uploads directory. It can be relative to the
# location of this script. IT MUST END WITH A SLASH
$GLOBALS['upload_directory'] = 'uploads/';
-<!--~end~--><!--~opt_http_pass_1 start~-->
+<!--~end~--><!--~image_settings start~-->
+$GLOBALS['~name~_max_width'] = '400';
+$GLOBALS['~name~_max_height'] = '400';<!--~thumb_settings start~-->
+$GLOBALS['~name~_thumb_max_width'] = '70';
+$GLOBALS['~name~_thumb_max_height'] = '70';
+$GLOBALS['~name~_file_name'] = uniqid() . getmypid() . '.jpg'; # comment this out to use uploader's filename
+<!--~end~--><!--~end~--><!--~opt_http_pass_1 start~-->
# Define the username and password required to view this form:
define('AUTH_REALM', '~file_name~ administration area');
define('AUTH_USER', 'fixme');
function ~file_name~_get_fields() {<!--~formats start~-->
$~name~ = format_~format~($_REQUEST['~name~']<!--~pulldown_format_extra start~-->, '~name~'<!--~end~-->);<!--~end~--><!--~image_upload start~-->
if($_FILES['~name~'] && $_FILES['~name~']['error'] == 0) {
- $~name~ = substr(save_uploaded_image('~name~', $GLOBALS['upload_directory']), strlen($GLOBALS['upload_directory']));
+ $~name~ = convert_uploaded_image('~name~', $GLOBALS['upload_directory'] . $GLOBALS['~name~_file_name'], $GLOBALS['~name~_max_width'], $GLOBALS['~name~_max_height']<!--~thumb_upload_params start~-->, $GLOBALS['~name~_thumb_max_width'], $GLOBALS['~name~_thumb_max_height']<!--~end~-->);
} else {
if($_REQUEST['delete_~name~'] == 'Yes') {
$~name~ = '';
} else {
- $~name~ = format_filename($_REQUEST['old_~name~']);
+ $~name~ = format_image_w_h<!--~thumb_w_h start~-->_thumb_w_h<!--~end~-->($_REQUEST['old_~name~']);
}
}<!--~end~-->
tem_show('edit_msg');
}
- tem_show('form');
+ tem_show('form');<!--~show_extra_headers start~-->
+ tem_show('extra_headers');<!--~end~-->
}
?>