1
0
This repository has been archived on 2021-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
gallery3-contrib/3.0/modules/aws_s3/models/MY_Item_Model.php
2010-11-26 22:44:32 +00:00

40 lines
1.6 KiB
PHP

<?php
class Item_Model extends Item_Model_Core {
public function thumb_url($full_uri=false) {
if (!module::get_var("aws_s3", "enabled"))
return parent::thumb_url($full_uri);
if ($this->is_photo()) {
return aws_s3::generate_url("th/" . $this->relative_path(), ($this->view_1 == 1 ? false : true), $this->updated);
}
else if ($this->is_album() && $this->id > 1) {
return aws_s3::generate_url("th/" . $this->relative_path() . "/.album.jpg", ($this->view_1 == 1 ? false : true), $this->updated);
}
else if ($this->is_movie()) {
$relative_path = preg_replace("/...$/", "jpg", $this->relative_path());
return aws_s3::generate_url("th/" . $relative_path, ($this->view_1 == 1 ? false : true), $this->updated);
}
}
public function file_url($full_uri=false) {
if (!module::get_var("aws_s3", "enabled"))
return parent::file_url($full_uri);
return aws_s3::generate_url("fs/" . $this->relative_path(), ($this->view_1 == 1 ? false : true), $this->updated);
}
public function resize_url($full_uri=false) {
if (!module::get_var("aws_s3", "enabled"))
return parent::resize_url($full_uri);
if ($this->is_album() && $this->id > 1) {
return aws_s3::generate_url("rs/" . $this->relative_path() . "/.album.jpg", ($this->view_1 == 1 ? false : true), $this->updated);
}
else {
return aws_s3::generate_url("rs/" . $this->relative_path(), ($this->view_1 == 1 ? false : true), $this->updated);
}
}
}