本文整理匯總了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);
}
示例2: getExtension
/**
* @param \FlickrDownloadr\Photo\Photo $photo
* @return string
*/
private function getExtension(Photo $photo)
{
$url = $photo->getUrl();
return pathinfo($url, PATHINFO_EXTENSION);
}
示例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 {