當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Photo::getUrl方法代碼示例

本文整理匯總了PHP中Photo::getUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP Photo::getUrl方法的具體用法?PHP Photo::getUrl怎麽用?PHP Photo::getUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Photo的用法示例。


在下文中一共展示了Photo::getUrl方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getUrl

 /**
  * @return string
  */
 public function getUrl()
 {
     return $this->photo->getUrl(Photo::THUMBNAIL_SMALL);
 }
開發者ID:freyr,項目名稱:gallery,代碼行數:7,代碼來源:CoverPhoto.php

示例2: getExtension

 /**
  * @param \FlickrDownloadr\Photo\Photo $photo
  * @return string
  */
 private function getExtension(Photo $photo)
 {
     $url = $photo->getUrl();
     return pathinfo($url, PATHINFO_EXTENSION);
 }
開發者ID:michalsanger,項目名稱:cli-flickr-downloadr,代碼行數:9,代碼來源:FilenameCreator.php

示例3: Photo

$contestId = $_POST['contest_id'] !== null ? $_POST['contest_id'] : $_GET['contest_id'];
$contest = Contest::loadContest($contestId);
npadmin_security($contest->getAllowedGroups(), false, _("You are not invited to this contest") . " (ID: " . $contestId . ")", true);
if ($_POST['op'] == 'upload') {
    if ($_FILES['photoFile']['error'] === 0) {
        if ($contest->status === STATUS_OPEN) {
            $photos = $contest->photosOfUser($userId);
            if (count($photos) < $contest->numberPhotos) {
                $photo = new Photo();
                $photo->userId = $userId;
                $photo->contestId = $contestId;
                $photo->title = $_POST['title'];
                $photo->description = $_POST['description'];
                $photo->exif = read_exif_data($_FILES['photoFile']['tmp_name']);
                if ($photo->store()) {
                    $photo_filename = "../" . $photo->getUrl();
                    $photo_filename_thumb = "../" . $photo->getThumbUrl();
                    if (move_uploaded_file($_FILES['photoFile']['tmp_name'], $photo_filename)) {
                        $image = new NP_Image($photo_filename);
                        $image_resized = $image->resizeMaxSize(1024);
                        $image_resized->save($photo_filename);
                        $image_thumb = $image->resizeMaxSize(240);
                        if ($image_thumb->save($photo_filename_thumb)) {
                            echo "OK: " . $photo_filename;
                        } else {
                            echo _("ERROR: Could not create thumbnail");
                        }
                        $image->close();
                        $image_resized->close();
                        $image_thumb->close();
                    } else {
開發者ID:dpecos,項目名稱:photocontest,代碼行數:31,代碼來源:photo.php


注:本文中的Photo::getUrl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。