X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=metaform%2Ftemplate.php;h=9742f4ef73e8078e1b7656fd262ea5547a2c9501;hb=3faf64c6a1e0cbd4f880da951775c41fb8a6f0ab;hp=bdd7da1dba2156def8612b2b44e7cdbed7d4a442;hpb=c63498c465bec640bbd8a521216aa37ba178b821;p=wfpl.git diff --git a/metaform/template.php b/metaform/template.php index bdd7da1..9742f4e 100644 --- a/metaform/template.php +++ b/metaform/template.php @@ -25,7 +25,13 @@ define('~file_name.upper~_DB_FIELDS', '~db_fields~'); # 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/'; - + +$GLOBALS['~name~_max_width'] = '400'; +$GLOBALS['~name~_max_height'] = '400'; +$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 + # Define the username and password required to view this form: define('AUTH_REALM', '~file_name~ administration area'); define('AUTH_USER', 'fixme'); @@ -42,12 +48,12 @@ require_once('code/wfpl/upload.php'); function ~file_name~_get_fields() { $~name~ = format_~format~($_REQUEST['~name~'], '~name~'); 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'], $GLOBALS['~name~_thumb_max_width'], $GLOBALS['~name~_thumb_max_height']); } else { if($_REQUEST['delete_~name~'] == 'Yes') { $~name~ = ''; } else { - $~name~ = format_filename($_REQUEST['old_~name~']); + $~name~ = format_image_w_h_thumb_w_h($_REQUEST['old_~name~']); } } @@ -220,7 +226,8 @@ function _~file_name~_main() { tem_show('edit_msg'); } - tem_show('form'); + tem_show('form'); + tem_show('extra_headers'); } ?>