예제 #1
0
파일: album.php 프로젝트: holandacz/nb4
 $pictureids = array();
 $uploadcount = 0;
 ($hook = vBulletinHook::fetch_hook('album_picture_upload_setup')) ? eval($hook) : false;
 foreach ($uploads as $uploadid => $uploadinfo) {
     if ($uploadinfo['name'] == '') {
         continue;
     }
     $uploadcount++;
     if ($uploadcount > $max_uploads) {
         // form was edited to try to add more pics than allowed
         break;
     }
     $vbulletin->GPC['upload'] = $uploadinfo;
     // the class reads from this
     $upload = new vB_Upload_AlbumPicture($vbulletin);
     $upload->data =& datamanager_init(fetch_picture_dm_name(), $vbulletin, ERRTYPE_STANDARD, 'picture');
     $upload->image =& vB_Image::fetch_library($vbulletin);
     $upload->albums = array($albuminfo);
     $upload->userinfo = $userinfo;
     $upload->maxwidth = $userinfo['permissions']['albumpicmaxwidth'];
     $upload->maxheight = $userinfo['permissions']['albumpicmaxheight'];
     $upload->maxuploadsize = $userinfo['permissions']['albumpicmaxsize'];
     ($hook = vBulletinHook::fetch_hook('album_picture_upload_process')) ? eval($hook) : false;
     if (!($pictureid = $upload->process_upload())) {
         $errors["{$uploadid}"] = $upload->fetch_error();
     } else {
         $pictureids["{$uploadid}"] = $pictureid;
     }
 }
 $error_names = array();
 if (!$pictureids and !$errors) {
예제 #2
0
파일: album.php 프로젝트: holandacz/nb4
 }
 $pictures = $db->query_read("\n\t\tSELECT *\n\t\tFROM " . TABLE_PREFIX . "picture\n\t\tWHERE pictureid >= " . $vbulletin->GPC['startid'] . "\n\t\tORDER BY pictureid\n\t\tLIMIT " . $vbulletin->GPC['perpage']);
 while ($picture = $db->fetch_array($pictures)) {
     $maxid = $picture['pictureid'];
     echo construct_phrase($vbphrase['processing_x'], $picture['pictureid']);
     if ($vbulletin->options['album_dataloc'] == 'db') {
         $filename = $tempfilename;
         $filenum = fopen($filename, 'wb');
         fwrite($filenum, $picture['filedata']);
         fclose($filenum);
     } else {
         $filename = fetch_picture_fs_path($picture);
     }
     $thumbnail = $image->fetch_thumbnail("picture.{$picture['extension']}", $filename, $vbulletin->options['album_thumbsize'], $vbulletin->options['album_thumbsize'], $vbulletin->GPC['quality']);
     if (!empty($thumbnail['filedata'])) {
         $picturedata =& datamanager_init(fetch_picture_dm_name(), $vbulletin, ERRTYPE_SILENT, 'picture');
         $picturedata->set_existing($picture);
         $picturedata->setr_info('thumbnail', $thumbnail['filedata']);
         $picturedata->set('thumbnail_dateline', TIMENOW);
         $picturedata->set('thumbnail_width', $thumbnail['width']);
         $picturedata->set('thumbnail_height', $thumbnail['height']);
         $picturedata->save();
         unset($picturedata);
     }
     echo '<br />';
     vbflush();
 }
 if ($vbulletin->options['album_dataloc'] == 'db') {
     @unlink($tempfilename);
 }
 $maxid++;