1
0

I need to learn how to do a merge properly...

This commit is contained in:
rWatcher 2009-08-31 01:05:14 -04:00
parent edaa788b1c
commit bc950406c7

View File

@ -19,6 +19,8 @@
*/ */
class itemchecksum_Controller extends Controller { class itemchecksum_Controller extends Controller {
public function albumcount($album_id) { public function albumcount($album_id) {
// Display the number of non-album items (photos and videos)
// in the specified album ($album_id).
$item = ORM::factory("item") $item = ORM::factory("item")
->viewable() ->viewable()
->where("parent_id", $album_id) ->where("parent_id", $album_id)
@ -29,6 +31,8 @@ class itemchecksum_Controller extends Controller {
} }
public function md5($album_id, $file_name) { public function md5($album_id, $file_name) {
// Locate an item with $file_name in the album $album_id
// and display it's md5 checksum.
$item = ORM::factory("item") $item = ORM::factory("item")
->where("parent_id", $album_id) ->where("parent_id", $album_id)
->where("name", $file_name) ->where("name", $file_name)
@ -36,6 +40,9 @@ class itemchecksum_Controller extends Controller {
if (count($item) > 0) { if (count($item) > 0) {
access::required("view_full", $item[0]); access::required("view_full", $item[0]);
// If the KeepOriginal module is active, check for/use the
// original image instead of the gallery edited version.
if (module::is_active("keeporiginal")) { if (module::is_active("keeporiginal")) {
$original_image = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $item[0]->file_path()); $original_image = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $item[0]->file_path());
if ($item[0]->is_photo() && file_exists($original_image)) { if ($item[0]->is_photo() && file_exists($original_image)) {
@ -52,6 +59,8 @@ class itemchecksum_Controller extends Controller {
} }
public function sha1($album_id, $file_name) { public function sha1($album_id, $file_name) {
// Locate an item with $file_name in the album $album_id
// and display it's sha-1 checksum.
$item = ORM::factory("item") $item = ORM::factory("item")
->where("parent_id", $album_id) ->where("parent_id", $album_id)
@ -60,6 +69,9 @@ class itemchecksum_Controller extends Controller {
if (count($item) > 0) { if (count($item) > 0) {
access::required("view_full", $item[0]); access::required("view_full", $item[0]);
// If the KeepOriginal module is active, check for/use the
// original image instead of the gallery edited version.
if (module::is_active("keeporiginal")) { if (module::is_active("keeporiginal")) {
$original_image = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $item[0]->file_path()); $original_image = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $item[0]->file_path());
if ($item[0]->is_photo() && file_exists($original_image)) { if ($item[0]->is_photo() && file_exists($original_image)) {