function Portfoliomkdirs($dir, $mode = 0777, $recursive = true) { if (is_null($dir) || $dir === "") { return $dir; } if (is_dir($dir) || $dir === "/") { return $dir; } if (Portfoliomkdirs(dirname($dir), $mode, $recursive)) { return mkdir($dir, $mode); } return $dir; }
//update gallery $image_titles = isset($_POST['image_title']) ? $_POST['image_title'] : ''; $image_descs = isset($_POST['image_desc']) ? $_POST['image_desc'] : ''; if (!empty($image_titles) && is_array($image_titles)) { foreach ($image_titles as $img_id => $img_title) { $image_obj =& $images_handler->get($img_id); if (is_object($image_obj)) { $image_obj->setVar('image_title', $img_title); $image_obj->setVar('image_desc', $image_descs[$img_id]); $images_handler->insert($image_obj); unset($image_obj); } } } if (!empty($_POST["xoops_upload_file"])) { if (Portfoliomkdirs(XOOPS_UPLOAD_PATH . '/' . $xoopsModule->dirname() . "/gallery")) { $files_dir = XOOPS_UPLOAD_PATH . '/' . $xoopsModule->dirname() . "/gallery"; } $mid_wh = array(360, 360); $thumb_wh = array(150, 120); $allowed_mimetypes = array('image/gif', 'image/jpeg', 'image/jpg', 'image/png'); $maxfilesize = 50000000; $maxfilewidth = 1200; $maxfileheight = 1200; $uploader = new XoopsMediaUploader($files_dir, $allowed_mimetypes, $maxfilesize, $maxfilewidth, $maxfileheight); foreach ($_POST["xoops_upload_file"] as $k => $v) { if ($uploader->fetchMedia($v)) { $uploader->setPrefix('case_gallery_'); if (!$uploader->upload()) { echo $uploader->getErrors(); } else {