diff options
author | Chad Parry <github@chad.parry.org> | 2011-05-04 17:49:42 -0600 |
---|---|---|
committer | Chad Parry <github@chad.parry.org> | 2011-05-04 17:49:42 -0600 |
commit | 5c6c71ffcdea354b5b9b30aaea2c1f92c8860d42 (patch) | |
tree | 9c0af18582bbd42094318b234798a754ce268dfa | |
parent | d2331bf43457a8d33491921f106879f087438171 (diff) | |
parent | 05ecfda36b7acee7f8d36df8391ba960097178a8 (diff) |
Merge branch 'master' into tempnam
-rw-r--r-- | .build_number | 2 | ||||
-rw-r--r-- | modules/g2_import/controllers/g2.php | 4 | ||||
-rw-r--r-- | modules/g2_import/helpers/g2_import.php | 7 |
3 files changed, 10 insertions, 3 deletions
diff --git a/.build_number b/.build_number index 1bdd507d..33f98732 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=147 +build_number=148 diff --git a/modules/g2_import/controllers/g2.php b/modules/g2_import/controllers/g2.php index 6e60bed0..90984e84 100644 --- a/modules/g2_import/controllers/g2.php +++ b/modules/g2_import/controllers/g2.php @@ -41,7 +41,9 @@ class G2_Controller extends Controller { // (bbcode, embedding) people are using the id style URLs although URL rewriting is enabled. $where = array(array("g2_id", "=", $id)); $view = $input->get("g2_view"); - if ($view) { + if ($view == "core.DownloadItem") { + $where[] = array("resource_type", "IN", array("file", "resize", "thumbnail", "full")); + } else if ($view) { $where[] = array("g2_url", "like", "%g2_view=$view%"); } // else: Assuming that the first search hit is sufficiently good. } else if ($path) { diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 3606c7ef..c79a8d36 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -560,7 +560,7 @@ class g2_import_Core { $table = g2(GalleryCoreApi::fetchThumbnailsByItemIds(array($g2_album_id))); if (isset($table[$g2_album_id])) { // Backtrack the source id to an item - $g2_source = $table[$g2_album_id]; + $orig_g2_source = $g2_source = $table[$g2_album_id]; while (GalleryUtilities::isA($g2_source, "GalleryDerivative")) { $g2_source = g2(GalleryCoreApi::loadEntitiesById($g2_source->getDerivativeSourceId())); } @@ -584,6 +584,11 @@ class g2_import_Core { array("name" => $g3_album->name)), $e); } + + self::set_map( + $orig_g2_source->getId(), $g3_album->id, + "thumbnail", + self::g2_url(array("view" => "core.DownloadItem", "itemId" => $orig_g2_source->getId()))); } } } |