1
Mods & Plugins (Requests & Discussions) / Re: Upload multiple images via *.zip DONE
« on: March 04, 2006, 03:36:44 PM »
hey!
i have adopted the upload2.php script now by myself. maybe this information is usefull to anyone...
the following lines had to be changed as follows:
i thought that it would also be nice if the admin gets an email when users add images to the gallery.
so this is the complete code replacement i have done:
don't forget to adopt the email address!!
this is for sure not the best solution but it was quick to implement and it works!
greetings!
i have adopted the upload2.php script now by myself. maybe this information is usefull to anyone...
the following lines had to be changed as follows:
Code: [Select]
include('./pclzip.lib.php');
$tmp_dir = ROOT_PATH.'data/tmp_media/';
$uploadDir = ROOT_PATH.'data/media/'.$cat_id.'/';
$archive = new PclZip($tmp_dir.$new_name);
i thought that it would also be nice if the admin gets an email when users add images to the gallery.
so this is the complete code replacement i have done:
Code: [Select]
include('./pclzip.lib.php');
$tmp_dir = ROOT_PATH.'data/tmp_media/';
$uploadDir = ROOT_PATH.'data/media/'.$cat_id.'/';
$archive = new PclZip($tmp_dir.$new_name);
if ($archive->extract(PCLZIP_OPT_PATH, $uploadDir,
PCLZIP_OPT_REMOVE_ALL_PATH) == 0) {
die("Error : ".$archive->errorInfo(true));
}else{
//send mail to admin (info that there are new images)
include(ROOT_PATH.'includes/email.php');
$myEmail = new Email();
//siteemail
$myEmail->set_to('webmaster@myGallerysite.net');
$myEmail->set_subject('new images in gallery');
$txt="Please check admin section of the gallery to insert users images. ";
$txt .= "from User: " .$user_info[$user_table_fields['user_name']];
$myEmail->set_simple_body($txt);
$myEmail->send_email();
don't forget to adopt the email address!!
this is for sure not the best solution but it was quick to implement and it works!
greetings!