Exemple #1
0
$maxfileheight = $xoopsModuleConfig['max_original_height'];
$maxfilewidth = $xoopsModuleConfig['max_original_width'];
/**
 * If we are receiving a file  
 */
if ($_POST['xoops_upload_file'][0] == 'sel_photo') {
    /**
     * Verify Token
     */
    if (!$GLOBALS['xoopsSecurity']->check()) {
        redirect_header($_SERVER['HTTP_REFERER'], 3, _MD_YOGURT_TOKENEXPIRED);
    }
    ini_set('memory_limit', '50M');
    /**
     * Try to upload picture resize it insert in database and then redirect to index
     */
    if ($album_factory->receivePicture($title, $path_upload, $thumbwidth, $thumbheight, $pictwidth, $pictheight, $maxfilebytes, $maxfilewidth, $maxfileheight)) {
        $extra_tags['X_OWNER_NAME'] = $xoopsUser->getVar('uname');
        $extra_tags['X_OWNER_UID'] = $xoopsUser->getVar('uid');
        $notification_handler =& xoops_gethandler('notification');
        $notification_handler->triggerEvent("picture", $xoopsUser->getVar('uid'), "new_picture", $extra_tags);
        //header("Location: ".XOOPS_URL."/modules/yogurt/index.php?uid=".$xoopsUser->getVar('uid'));
        redirect_header(XOOPS_URL . "/modules/yogurt/album.php?uid=" . $xoopsUser->getVar('uid'), 3, _MD_YOGURT_UPLOADED);
    } else {
        redirect_header(XOOPS_URL . "/modules/yogurt/album.php?uid=" . $xoopsUser->getVar('uid'), 3, _MD_YOGURT_NOCACHACA);
    }
}
/**
 * Close page  
 */
include "../../footer.php";