/** * * get thumb url */ public function getUrlThumb($thumbSize = "") { $thumbSize = trim($thumbSize); if (empty($thumbSize)) { return $this->urlThumb; } //get thumb url by image url if (empty($this->imageID)) { if ($thumbSize == "full") { return $this->urlImage; } if (method_exists("UniteProviderFunctionsUG", "getThumbWidth") == false) { return $this->urlThumb; } $thumbWidth = UniteProviderFunctionsUG::getThumbWidth($thumbSize); $operations = new UGOperations(); try { $urlThumb = $operations->createThumbs($this->urlImage, $thumbWidth); $urlThumb = HelperUG::URLtoFull($urlThumb); } catch (Exception $error) { if (!empty($this->urlThumb)) { return $this->urlThumb; } throw new Error($error); } return $urlThumb; } else { //with image id if (method_exists("UniteProviderFunctionsUG", "getThumbUrlFromImageID")) { $urlThumb = UniteProviderFunctionsUG::getThumbUrlFromImageID($this->imageID, $thumbSize); if (!empty($urlThumb)) { $urlThumb = HelperUG::URLtoFull($urlThumb); return $urlThumb; } } } return $this->urlThumb; }