Пример #1
0
 /**
  * Process an image upload and set the image
  * @param String $postfield the $_POST field the image was uploaded through
  * @return boolean
  */
 public function processImage($postfield)
 {
     require_once 'mediaManager.php';
     $im = new Imagemanager();
     $prefix = time();
     if ($im->loadFromPost($postfield, $this->registry->getSetting('upload_path') . 'status/images/' . $this->username, $prefix)) {
         $im->resizeScaleWidth(150);
         $im->save($this->registry->getSetting('upload_path') . 'status/images/' . $this->username . '/' . $im->getName());
         $this->image = $im->getName();
         return true;
     } else {
         return false;
     }
 }
Пример #2
0
 /**
  * Process an image upload and set the image
  * @param String $postfield the $_POST field the image was uploaded through
  * @return boolean
  */
 public function processImage($postfield)
 {
     require_once FRAMEWORK_PATH . 'lib/images/imagemanager.class.php';
     $im = new Imagemanager();
     $prefix = time() . '_';
     if ($im->loadFromPost($postfield, $this->registry->getSetting('upload_path') . 'statusimages/', $prefix)) {
         $im->resizeScaleWidth(150);
         $im->save($this->registry->getSetting('upload_path') . 'statusimages/' . $im->getName());
         $this->image = $im->getName();
         return true;
     } else {
         return false;
     }
 }