本文整理汇总了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 {