コード例 #1
0
 function pre_save($doquery = true)
 {
     if ($this->presave_called !== null) {
         return $this->presave_called;
     }
     if ($file =& $this->fetch_field('filedata')) {
         $this->setr_info('filedata', $file);
         $this->do_unset('filedata');
         $this->set('filesize', strlen($this->info['filedata']));
         chdir(DIR);
         if (!is_writable($this->filepath)) {
             $this->error('upload_invalid_imagepath');
             return false;
         }
         if ($thumb =& $this->fetch_field('filedata_thumb')) {
             $this->setr_info('filedata_thumb', $thumb);
             $this->do_unset('filedata_thumb');
         }
         $image =& vB_Image::instance();
     }
     return parent::pre_save($doquery);
 }
コード例 #2
0
ファイル: class_dm_userpic.php プロジェクト: holandacz/nb4
 function pre_save($doquery = true)
 {
     if ($this->presave_called !== null) {
         return $this->presave_called;
     }
     if ($file =& $this->fetch_field('filedata')) {
         $this->setr_info('filedata', $file);
         $this->do_unset('filedata');
         $this->set('filesize', strlen($this->info['filedata']));
         if (!is_writable($this->filepath)) {
             $this->error('upload_invalid_imagepath');
             return false;
         }
         if ($thumb =& $this->fetch_field('filedata_thumb')) {
             $this->setr_info('filedata_thumb', $thumb);
             $this->do_unset('filedata_thumb');
         }
         require_once DIR . '/includes/class_image.php';
         $image =& vB_Image::fetch_library($this->registry);
     }
     return parent::pre_save($doquery);
 }