From: Steve Sutton Date: Fri, 20 Mar 2015 18:32:56 +0000 (-0400) Subject: Update Photo Gallery X-Git-Tag: v1.2.4^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=931d732af64002c6ce95bef3f53e762ecd4cbb44;p=web%2FGaylordGolfMecca.git Update Photo Gallery To get slideshow working. --- diff --git a/Toolkit/Photos/Display.php b/Toolkit/Photos/Display.php index 5f88ba4..cb6315e 100644 --- a/Toolkit/Photos/Display.php +++ b/Toolkit/Photos/Display.php @@ -108,16 +108,30 @@ class Toolkit_Photos_Display // }}} public function getSlideShow(array $photoCatIds, $galleries) { + $GLOBALS['styleSheets'][] + = $this->baseURL . 'photoswipe/photoswipe.css'; + $GLOBALS['bottomScripts'][] + = $this->baseURL . 'photoswipe/lib/klass.min.js'; + $GLOBALS['bottomScripts'][] + = $this->baseURL . 'photoswipe/code.photoswipe.jquery-3.0.5.js'; + $GLOBALS['bottomScripts'][] + = $this->baseURL . 'Toolkit/Photos/js/photoGallery.js'; + $GLOBALS['styleSheets'][] = $this->glmAppBaseURL . 'libjs/plugins/nivoslider/3.2/prod/nivo-slider.css'; $GLOBALS['styleSheets'][] = $this->glmAppBaseURL . 'libjs/plugins/nivoslider/themes/default/default.css'; $GLOBALS['bottomScripts'][] = $this->glmAppBaseURL . 'libjs/plugins/nivoslider/3.2/prod/jquery.nivo.slider.js'; + $GLOBALS['bottomScripts'][] = $this->baseURL + . 'Toolkit/Photos/js/photoSlideShow.js'; + $GLOBALS['styleSheets'][] = $this->baseURL + . 'Toolkit/Photos/css/gallery.css'; $tpl = new HTML_Template_Flexy($this->flexyOptions); $tpl->compile(self::PHOTO_SLIDER); $page = new stdClass(); + $page->base_url = MEDIA_BASE_URL; // Filter the categories so only slideshow ones are in $categories $categories = $this->getCategories($photoCatIds); @@ -130,6 +144,7 @@ class Toolkit_Photos_Display $slideShowCategories->append($index); $photoCatIds[] = $index['id']; } + //echo '
'.print_r($photoCatIds, true).'
'; if (empty($photoCatIds)) { return false; } @@ -141,7 +156,7 @@ class Toolkit_Photos_Display $page->webUrl = BASE_URL . 'download-photo-web/'; $page->printUrl = BASE_URL . 'download-photo-print/'; $page->photoUrlLarge = FILE_SERVER_URL . IS_OWNER_ID - . '/rotatingImagesResized/'; + . '/photoSlideshow/'; $page->photoUrlSmall = FILE_SERVER_URL . IS_OWNER_ID . '/mediaGallery/'; $catid = filter_var($_REQUEST['photoCategoryId']); diff --git a/Toolkit/Photos/Gallery.php b/Toolkit/Photos/Gallery.php index e658738..0bdda04 100644 --- a/Toolkit/Photos/Gallery.php +++ b/Toolkit/Photos/Gallery.php @@ -94,7 +94,7 @@ class Toolkit_Photos_Gallery ? " AND exclusive <> true" : ''; $sql = " - SELECT pcb.photocat_id + SELECT pcb.photocat_id,pc.slideshow FROM photo_category_bus pcb, photo_category pc WHERE buscat_id = :pageId AND pc.id = pcb.photocat_id @@ -140,12 +140,17 @@ class Toolkit_Photos_Gallery public function getPageGallery($pageId) { $galleries = $this->_getGalleriesAssignedToPage($pageId); + //echo '
'.print_r($galleries, true).'
'; $photoCatIds = array(); foreach ($galleries as $gallery) { $photoCatIds[] = $gallery['photocat_id']; } + if ($galleries[0]['slideshow']) { + return $this->_photoApp->getSlideShow($photoCatIds, $galleries); + } + return !empty($photoCatIds) ? $this->_photoApp->toHTML($photoCatIds, $galleries) : ''; diff --git a/Toolkit/Photos/application.ini b/Toolkit/Photos/application.ini index d576e1c..778c54a 100644 --- a/Toolkit/Photos/application.ini +++ b/Toolkit/Photos/application.ini @@ -9,7 +9,7 @@ application.application = "Photos/Controllers" ; This option also may need other new fields not added yet to the contact table settings.mediaExclusive = Off settings.photoNameSearch = Off -settings.slideShowOption = Off +settings.slideShowOption = On ; default Flexy Options for this application flexyOptions.templateDir = BASE "Toolkit/Photos/templates" diff --git a/Toolkit/Photos/css/gallery.css b/Toolkit/Photos/css/gallery.css index 545a01c..124a118 100755 --- a/Toolkit/Photos/css/gallery.css +++ b/Toolkit/Photos/css/gallery.css @@ -26,3 +26,13 @@ div.thumb { .photocattitle {text-align: center; font-weight: bold;} .phototitle {text-align: center; font-weight: normal; width: 110px;} .galleryRow {clear: left;} +#photo_slideshow_wrapper { + max-width: 600px; + max-height: 400px; + margin: 0 auto; +} +#photo_slideshow_wrapper .nivo-caption { + background-color: rgba(0, 0, 0, 0.7); + width: 100%; +} +.download_wrapper * {clear: none !important;} diff --git a/Toolkit/Photos/js/photoSlideShow.js b/Toolkit/Photos/js/photoSlideShow.js new file mode 100644 index 0000000..13fb89a --- /dev/null +++ b/Toolkit/Photos/js/photoSlideShow.js @@ -0,0 +1,12 @@ +$(function() { + $("#photoSliderCategoryId").change(function(){ + $(this).parent().submit(); + }); + $('#photo-slider').nivoSlider({ + effect: 'fade', + pauseTime: 5000, + directionNav: true, + controlNav: false, + controlNavThumbs: false + }); +}); diff --git a/Toolkit/Photos/templates/photoSlider.html b/Toolkit/Photos/templates/photoSlider.html new file mode 100644 index 0000000..1dbc18f --- /dev/null +++ b/Toolkit/Photos/templates/photoSlider.html @@ -0,0 +1,81 @@ + +categories) > 1) { + // echo $t->base_url; + //echo ''; +?> +
+
+ +
+ + + +
+
+
+" . $t->categories[0]['category'] . ""; +} +?> +{if:all} +
+{else:} +
+{end:} +
+
+
+
+ {foreach:photos,photo} + + + + {end:} +
+
+ {foreach:photos,photo} +
+ {photo.getTitle()} + {photo.getDescription()} + {if:photo.getDownload()} +
Download for Web + - Print
+ {end:} +
+ {end:} +
+ {if:showAllUrl} + + {else:} + + {end:} +