Ejemplo n.º 1
0
 function MakeThumbs()
 {
     global $CMS;
     $TH = new Thumb();
     if ($this->IsAvatars()) {
         // ** This is the output file ** //
         $strThumbNoExt = $this->GetFileNameWithoutExtension($this->strFileFullPath);
         $strExtension = $this->GetExtensionFromPath($this->strFileFullPath);
         $intAvatarSize = $CMS->SYS->GetSysPref(C_PREF_AVATAR_SIZE);
         $strThumbAvatar = $strThumbNoExt . "_t1." . $strExtension;
         // ** We only need relative paths for the database ** //
         $this->strDBAvatarThumb = $this->strSiteDir . $this->GetFileNameFromPath($strThumbAvatar);
         if (!$TH->Make($this->strFileFullPath, $strThumbAvatar, $intAvatarSize)) {
             $this->strDBAvatarThumb = "";
         }
         @($blnFile = unlink($this->GetFileFullPath()));
         if (!$blnFile) {
             if (file_exists($this->strFileFullPath) == true) {
                 $this->strWarnings .= M_ERR_UPLOAD_NOT_DELETED_ACCESS . "(" . $this->strFileFullPath . ")";
             } else {
                 $this->strWarnings .= M_ERR_UPLOAD_NOT_DELETED_MISSING . "(" . $this->strFileFullPath . ")";
             }
         }
     } else {
         // ** These are the output files ** //
         $strThumbNoExt = $this->GetFileNameWithoutExtension($this->strFileFullPath);
         $strExtension = $this->GetExtensionFromPath($this->strFileFullPath);
         $intThumbSmall = $CMS->SYS->GetSysPref(C_PREF_THUMB_SMALL);
         $intThumbMedium = $CMS->SYS->GetSysPref(C_PREF_THUMB_MEDIUM);
         $intThumbLarge = $CMS->SYS->GetSysPref(C_PREF_THUMB_LARGE);
         $strThumbSmall = $strThumbNoExt . "_t1." . $strExtension;
         $strThumbMedium = $strThumbNoExt . "_t2." . $strExtension;
         $strThumbLarge = $strThumbNoExt . "_t3." . $strExtension;
         // ** We only need relative paths for the database ** //
         $this->strDBThumbSmall = $this->strSiteDir . $this->GetFileNameFromPath($strThumbSmall);
         $this->strDBThumbMedium = $this->strSiteDir . $this->GetFileNameFromPath($strThumbMedium);
         $this->strDBThumbLarge = $this->strSiteDir . $this->GetFileNameFromPath($strThumbLarge);
         if (!$TH->Make($this->strFileFullPath, $strThumbSmall, $intThumbSmall)) {
             $this->strDBThumbSmall = "";
         }
         if (!$TH->Make($this->strFileFullPath, $strThumbMedium, $intThumbMedium)) {
             $this->strDBThumbMedium = "";
         }
         if (!$TH->Make($this->strFileFullPath, $strThumbLarge, $intThumbLarge)) {
             $this->strDBThumbLarge = "";
         }
     }
 }