X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=wwwroot%2Finc%2Feventz%2Fconfigure_image.inc;h=4e4bc5db714411b25cae032b55ca35ec50d0ae0f;hb=d2cf0fe02b06534a460bd8f9dc814007dc66ac41;hp=a4fe18ce39ec27505aa84c9303ac69b18dc9372e;hpb=51ff32267c4949bad6a8dddc502cbc01ed56edc8;p=mirrors%2FKyberia-bloodline.git diff --git a/wwwroot/inc/eventz/configure_image.inc b/wwwroot/inc/eventz/configure_image.inc index a4fe18c..4e4bc5d 100644 --- a/wwwroot/inc/eventz/configure_image.inc +++ b/wwwroot/inc/eventz/configure_image.inc @@ -58,16 +58,16 @@ if ($node['node_permission'] == 'owner') { if (!($_img_t = __cin_get_img_type($_FILES['description_image']))) { - $error = '#01: Invalid file format (JPEG, GIF & PNG are only allowed)'; + $error = '#01: Invalid file format (only JPEG, GIF & PNG are allowed)'; return (false); } - + // XXX hard coded $_WEBROOT_PATH = realpath(dirname(__FILE__).'/../..'); - $_PROCESS_IMG_PATH = $_WEBROOT_PATH.'/process-img'; + $_PROCESS_IMG_PATH = $_WEBROOT_PATH.'/process-img'; $_required_dims = ($node['node_id'] == $_SESSION['user_id'])?50:NODE_IMAGE_WIDTH; $_prepared_fname = sprintf('%s/prepared/%03s_%s.gif.upload', $_PROCESS_IMG_PATH, $_required_dims, $node['node_id']); - $_nodeimg_fname = sprintf('%s/images/nodes/%s/%s/%d.gif', $_WEBROOT_PATH, $node['node_id'][0], $node['node_id'][1], $node['node_id']); + $_nodeimg_fname = sprintf('%s/'.SYSTEM_IMAGES.'/nodes/%s/%s/%d.gif', $_WEBROOT_PATH, $node['node_id'][0], $node['node_id'][1], $node['node_id']); if (!is_uploaded_file($_FILES['description_image']['tmp_name'])) { $error = '#02: Invalid file upload'; @@ -79,16 +79,16 @@ return (false); } - if (!move_uploaded_file($_FILES['description_image']['tmp_name'], $_prepared_fname)) { - $error = '#04: Error moving uploaded file!'; - return (false); - } +// if (!move_uploaded_file($_FILES['description_image']['tmp_name'], $_prepared_fname)) { +// $error = '#04: Error moving uploaded file!'; +// return (false); +// } - chmod($_prepared_fname, 0664); - rename($_prepared_fname, substr($_prepared_fname, 0, -7)); +// chmod($_prepared_fname, 0664); +// rename($_prepared_fname, substr($_prepared_fname, 0, -7)); } return (true); } -?> \ No newline at end of file +?>