From 6844c2ec693ffc2299856c4a4e7a584ae28a420b Mon Sep 17 00:00:00 2001 From: rWatcher Date: Sun, 15 May 2011 14:36:31 -0400 Subject: [PATCH] Grey dragon image pre-loading and shadowbox module support. --- .../greydragon/views/photo.html.php | 122 ++++++++++++++++++ .../tag_albums/controllers/tag_albums.php | 1 + .../greydragon/views/photo.html.php | 122 ++++++++++++++++++ .../tag_albums/controllers/tag_albums.php | 1 + 4 files changed, 246 insertions(+) create mode 100644 3.0/modules/tag_albums/-- Theme Files/greydragon/views/photo.html.php create mode 100644 3.1/modules/tag_albums/-- Theme Files/greydragon/views/photo.html.php diff --git a/3.0/modules/tag_albums/-- Theme Files/greydragon/views/photo.html.php b/3.0/modules/tag_albums/-- Theme Files/greydragon/views/photo.html.php new file mode 100644 index 00000000..5d3ede73 --- /dev/null +++ b/3.0/modules/tag_albums/-- Theme Files/greydragon/views/photo.html.php @@ -0,0 +1,122 @@ + +desc_allowbbcode): + $_description = $theme->bb2html($item->description, 1); + else: + $_description = nl2br(html::purify($item->description)); + endif; + + if ($theme->is_photometa_visible): + $_description .= ''; + endif; + + switch ($theme->photo_popupbox): + case "preview": + $include_list = FALSE; + $include_single = TRUE; + break; + case "none": + $include_list = FALSE; + $include_single = FALSE; + break; + default: + $include_list = TRUE; + $include_single = TRUE; + break; + endswitch; +?> + +
+ bb2html(html::purify($item->title), 1); ?> +
+

+
+ add_paginator("top"); ?> + photo_top() ?> + photo_descmode == "top") and ($_description)): ?> +
+ +
+ resize_top($item) ?> + resize_width; + +// rWatcher Modification. + $siblings = ""; + if (isset($dynamic_siblings)) { + $siblings = $dynamic_siblings; + } else { + $siblings = $item->parent()->children(); + } +// End rWatcher Modification + ?> + +
+ \n"; + $script .= " if (document.images) {\n"; + for ($i = 0; ($i <= count($siblings) - 1); $i++): + if ($siblings[$i]->rand_key == $item->rand_key): ?> + " title="bb2html(html::purify($item->title), 2) ?>" href="file_url() : $item->resize_url(); ?>"> + resize_img(array("id" => "g-photo-id-{$item->id}", "class" => "g-resize", "alt" => $_title)) ?> + + resize_url() . "\";\n"; + endif; + if ($i > 0): + $script .= " var image_preload_p = new Image();\n image_preload_p.src = \"" . $siblings[$i-1]->resize_url() . "\";\n"; + endif; + else: + if ($include_list): ?> + is_album()): ?> + file_url() : $siblings[$i]->resize_url(); ?>">  + + + + + \n"; ?> + photo_descmode): + case "overlay_top": + $_align = "g-align-top"; + break; + case "overlay_bottom": + $_align = "g-align-bottom"; + break; + default: + break; + endswitch; + endif; ?> + + +
+ + +
+ +
+ resize_bottom($item) ?> +
+ photo_descmode == "bottom") and ($_description)): ?> +
+ + add_paginator("bottom"); ?> + photo_bottom() ?> +
+ \ No newline at end of file diff --git a/3.0/modules/tag_albums/controllers/tag_albums.php b/3.0/modules/tag_albums/controllers/tag_albums.php index 88e2a058..5b4875ca 100644 --- a/3.0/modules/tag_albums/controllers/tag_albums.php +++ b/3.0/modules/tag_albums/controllers/tag_albums.php @@ -729,6 +729,7 @@ class tag_albums_Controller extends Controller { $items_model->select("items.title"); $items_model->select("items.view_count"); $items_model->select("items.owner_id"); + $items_model->select("items.rand_key"); $items_model->select("items.type"); $items_model->select("items.thumb_width"); $items_model->select("items.thumb_height"); diff --git a/3.1/modules/tag_albums/-- Theme Files/greydragon/views/photo.html.php b/3.1/modules/tag_albums/-- Theme Files/greydragon/views/photo.html.php new file mode 100644 index 00000000..5d3ede73 --- /dev/null +++ b/3.1/modules/tag_albums/-- Theme Files/greydragon/views/photo.html.php @@ -0,0 +1,122 @@ + +desc_allowbbcode): + $_description = $theme->bb2html($item->description, 1); + else: + $_description = nl2br(html::purify($item->description)); + endif; + + if ($theme->is_photometa_visible): + $_description .= ''; + endif; + + switch ($theme->photo_popupbox): + case "preview": + $include_list = FALSE; + $include_single = TRUE; + break; + case "none": + $include_list = FALSE; + $include_single = FALSE; + break; + default: + $include_list = TRUE; + $include_single = TRUE; + break; + endswitch; +?> + +
+ bb2html(html::purify($item->title), 1); ?> +
+

+
+ add_paginator("top"); ?> + photo_top() ?> + photo_descmode == "top") and ($_description)): ?> +
+ +
+ resize_top($item) ?> + resize_width; + +// rWatcher Modification. + $siblings = ""; + if (isset($dynamic_siblings)) { + $siblings = $dynamic_siblings; + } else { + $siblings = $item->parent()->children(); + } +// End rWatcher Modification + ?> + +
+ \n"; + $script .= " if (document.images) {\n"; + for ($i = 0; ($i <= count($siblings) - 1); $i++): + if ($siblings[$i]->rand_key == $item->rand_key): ?> + " title="bb2html(html::purify($item->title), 2) ?>" href="file_url() : $item->resize_url(); ?>"> + resize_img(array("id" => "g-photo-id-{$item->id}", "class" => "g-resize", "alt" => $_title)) ?> + + resize_url() . "\";\n"; + endif; + if ($i > 0): + $script .= " var image_preload_p = new Image();\n image_preload_p.src = \"" . $siblings[$i-1]->resize_url() . "\";\n"; + endif; + else: + if ($include_list): ?> + is_album()): ?> + file_url() : $siblings[$i]->resize_url(); ?>">  + + + + + \n"; ?> + photo_descmode): + case "overlay_top": + $_align = "g-align-top"; + break; + case "overlay_bottom": + $_align = "g-align-bottom"; + break; + default: + break; + endswitch; + endif; ?> + + +
+ + +
+ +
+ resize_bottom($item) ?> +
+ photo_descmode == "bottom") and ($_description)): ?> +
+ + add_paginator("bottom"); ?> + photo_bottom() ?> +
+ \ No newline at end of file diff --git a/3.1/modules/tag_albums/controllers/tag_albums.php b/3.1/modules/tag_albums/controllers/tag_albums.php index 88e2a058..5b4875ca 100644 --- a/3.1/modules/tag_albums/controllers/tag_albums.php +++ b/3.1/modules/tag_albums/controllers/tag_albums.php @@ -729,6 +729,7 @@ class tag_albums_Controller extends Controller { $items_model->select("items.title"); $items_model->select("items.view_count"); $items_model->select("items.owner_id"); + $items_model->select("items.rand_key"); $items_model->select("items.type"); $items_model->select("items.thumb_width"); $items_model->select("items.thumb_height");