X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=metaform%2Ftemplate.php;h=1822ff39924bd8bf1adfd0883fc18ad0eb3340d8;hb=423f31ad0add74bbb6066d3c9f760ad0a5580cda;hp=bdd7da1dba2156def8612b2b44e7cdbed7d4a442;hpb=f22b600c925131bb767db73d77dc595f18a1406a;p=wfpl.git diff --git a/metaform/template.php b/metaform/template.php index bdd7da1..1822ff3 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~']); } }