Example #1
0
     $spotlight_obj =& $spotlight_current;
 }
 if ($art_id != $spotlight_current->getVar("art_id") || $spotlight_obj->isNew()) {
     $spotlight_obj->setVar("sp_time", time());
 }
 $sp_categories = empty($_POST["sp_categories"]) ? array() : $_POST["sp_categories"];
 $sp_note = $_POST["sp_note"];
 $error_upload = "";
 $sp_image_file = "";
 if (!empty($_FILES['userfile']['name'])) {
     require_once XOOPS_ROOT_PATH . "/modules/" . $GLOBALS["artdirname"] . "/class/uploader.php";
     $uploader = new art_uploader(XOOPS_ROOT_PATH . "/" . $xoopsModuleConfig['path_image']);
     if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
         if (!$uploader->upload()) {
             $error_upload = $uploader->getErrors();
         } elseif (file_exists($uploader->getSavedDestination())) {
             $sp_image_file = $uploader->getSavedFileName();
         }
     } else {
         $error_upload = $uploader->getErrors();
     }
 }
 $sp_image_caption = !empty($_POST["sp_image_caption"]) ? $_POST["sp_image_caption"] : "";
 $sp_image_caption_strip = $myts->htmlSpecialChars($myts->stripSlashesGPC($sp_image_caption));
 $sp_image["caption"] = $sp_image_caption;
 if ($sp_image_file) {
     $sp_image["file"] = $sp_image_file;
     $spotlight_obj->setVar("sp_image", $sp_image);
 } else {
     $sp_image["file"] = empty($_POST['sp_image_file']) ? "" : $_POST['sp_image_file'];
     $image = $spotlight_obj->getVar("sp_image");