|
|
@ -40,7 +40,7 @@ class Gallery |
|
|
|
* |
|
|
|
* |
|
|
|
* @var array |
|
|
|
* @var array |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
var $_allowed_type = array('.jpg','jpeg','.jpe','.gif','.png','.avi','.mov','.wmv','.wmf','.mp4'); |
|
|
|
var $_allowed_type = array('.jpg','.jpeg','.jpe','.gif','.png','.avi','.mov','.wmv','.wmf','.mp4'); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Размер и тип формирования миниатюр |
|
|
|
* Размер и тип формирования миниатюр |
|
|
@ -245,6 +245,7 @@ class Gallery |
|
|
|
{ |
|
|
|
{ |
|
|
|
case 'gif': |
|
|
|
case 'gif': |
|
|
|
case 'jpg': |
|
|
|
case 'jpg': |
|
|
|
|
|
|
|
case 'jpeg': |
|
|
|
case 'png': |
|
|
|
case 'png': |
|
|
|
list($width, $height) = getimagesize(BASE_DIR . '/' . $folder . '/' . $row->image_filename); |
|
|
|
list($width, $height) = getimagesize(BASE_DIR . '/' . $folder . '/' . $row->image_filename); |
|
|
|
$AVE_Template->assign('w', ($width < 350 ? 350 : ($width > 950 ? 950 : $width+8))); |
|
|
|
$AVE_Template->assign('w', ($width < 350 ? 350 : ($width > 950 ? 950 : $width+8))); |
|
|
@ -441,8 +442,8 @@ class Gallery |
|
|
|
{ |
|
|
|
{ |
|
|
|
if ($file != '.' && $file != '..') |
|
|
|
if ($file != '.' && $file != '..') |
|
|
|
{ |
|
|
|
{ |
|
|
|
$image_title = substr($file, 0, -4); |
|
|
|
$image_title = mb_substr($file, 0, mb_strrpos($file, '.')); |
|
|
|
$upload_file_ext = strtolower(substr($file, -4)); |
|
|
|
$upload_file_ext = strtolower(mb_substr($file, mb_strrpos($file, '.') + 0)); |
|
|
|
$upload_filename = prepare_fname($image_title) . $upload_file_ext; |
|
|
|
$upload_filename = prepare_fname($image_title) . $upload_file_ext; |
|
|
|
|
|
|
|
|
|
|
|
while (file_exists($dst_dir . '/' . $upload_filename)) |
|
|
|
while (file_exists($dst_dir . '/' . $upload_filename)) |
|
|
@ -513,8 +514,8 @@ class Gallery |
|
|
|
{ |
|
|
|
{ |
|
|
|
if ($file != '.' && $file != '..') |
|
|
|
if ($file != '.' && $file != '..') |
|
|
|
{ |
|
|
|
{ |
|
|
|
$image_title = substr($file, 0, -4); |
|
|
|
$image_title = mb_substr($file, 0, mb_strrpos($file, '.')); |
|
|
|
$upload_file_ext = strtolower(substr($file, -4)); |
|
|
|
$upload_file_ext = strtolower(mb_substr($file, mb_strrpos($file, '.') + 0)); |
|
|
|
$upload_filename = prepare_fname($image_title) . $upload_file_ext; |
|
|
|
$upload_filename = prepare_fname($image_title) . $upload_file_ext; |
|
|
|
|
|
|
|
|
|
|
|
while (file_exists($dst_dir . '/' . $upload_filename)) |
|
|
|
while (file_exists($dst_dir . '/' . $upload_filename)) |
|
|
@ -562,8 +563,11 @@ class Gallery |
|
|
|
$count_files = sizeof(@$_FILES['file']['tmp_name']); |
|
|
|
$count_files = sizeof(@$_FILES['file']['tmp_name']); |
|
|
|
for ($i=0;$i<$count_files;$i++) |
|
|
|
for ($i=0;$i<$count_files;$i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$upload_file_ext = strtolower(substr($_FILES['file']['name'][$i], -4)); |
|
|
|
//$upload_file_ext = strtolower(substr($_FILES['file']['name'][$i], -4)); |
|
|
|
$upload_filename = prepare_fname(substr($_FILES['file']['name'][$i], 0, -4)) . $upload_file_ext; |
|
|
|
$upload_file_ext = strtolower(mb_substr($_FILES['file']['name'][$i], mb_strrpos($_FILES['file']['name'][$i], '.') + 0)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//$upload_filename = prepare_fname(substr($_FILES['file']['name'][$i], 0, -4)) . $upload_file_ext; |
|
|
|
|
|
|
|
$upload_filename = prepare_fname(mb_substr($_FILES['file']['name'][$i], 0, mb_strrpos($_FILES['file']['name'][$i], '.'))) . $upload_file_ext; |
|
|
|
|
|
|
|
|
|
|
|
if (!empty($upload_filename)) |
|
|
|
if (!empty($upload_filename)) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -937,7 +941,7 @@ class Gallery |
|
|
|
case '.wmf': |
|
|
|
case '.wmf': |
|
|
|
case '.mpg': $type = 'video'; break; |
|
|
|
case '.mpg': $type = 'video'; break; |
|
|
|
case '.jpg': |
|
|
|
case '.jpg': |
|
|
|
case 'jpeg': |
|
|
|
case '.jpeg': |
|
|
|
case '.jpe': $type = 'jpg'; break; |
|
|
|
case '.jpe': $type = 'jpg'; break; |
|
|
|
case '.png': $type = 'png'; break; |
|
|
|
case '.png': $type = 'png'; break; |
|
|
|
case '.gif': $type = 'gif'; break; |
|
|
|
case '.gif': $type = 'gif'; break; |
|
|
|