To get slideshow working.
// }}}
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);
$slideShowCategories->append($index);
$photoCatIds[] = $index['id'];
}
+ //echo '<pre>'.print_r($photoCatIds, true).'</pre>';
if (empty($photoCatIds)) {
return false;
}
$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']);
? " 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
public function getPageGallery($pageId)
{
$galleries = $this->_getGalleriesAssignedToPage($pageId);
+ //echo '<pre>'.print_r($galleries, true).'</pre>';
$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)
: '';
; 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"
.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;}
--- /dev/null
+$(function() {
+ $("#photoSliderCategoryId").change(function(){
+ $(this).parent().submit();
+ });
+ $('#photo-slider').nivoSlider({
+ effect: 'fade',
+ pauseTime: 5000,
+ directionNav: true,
+ controlNav: false,
+ controlNavThumbs: false
+ });
+});
--- /dev/null
+<flexy:toJavascript base_url="base_url" />
+<?php
+
+if (count($t->categories) > 1) {
+ // echo $t->base_url;
+ //echo '<link rel="stylesheet" type="text/css" href="' . $t->base_url . 'Toolkit/Photos/templates/css/photoSlideshow.css">';
+?>
+<div class="sliderFilterWrapper">
+ <div class="sliderCatWrapper">
+ <h2 class="gallery_header">Select an Album</h2>
+ <form
+ method="get"
+ id="photoGallery"
+ action="{searchFormUrl:h}"
+ flexy:ignore="yes">
+ <input type="hidden" name="catid" value="{_REQUEST[catid]}">
+ <label id="photoCategoryLabel"></label><!--/Filter By Category-->
+ <select id="photoSliderCategoryId" name="photoCategoryId">
+ <?php foreach ($t->categories as $category) {
+ echo '<option value="'.$category['id'].'"';
+ if ($_REQUEST['photoCategoryId'] == $category['id']) {
+ echo ' selected';
+ }
+ echo '>'.$category['category'].'</option>';
+ }?>
+ </select>
+ </form>
+ </div>
+</div>
+<?php
+} else {
+echo "<h2 class='gallery_header'>" . $t->categories[0]['category'] . "</h2>";
+}
+?>
+{if:all}
+<div id="photo_slideshow_wrapper" class="showAll">
+{else:}
+<div id="photo_slideshow_wrapper" class="">
+{end:}
+ <div class="photo_slideshow_wrapper_inner">
+ <div class="slider-wrapper theme-default">
+ <div class="ribbon"></div>
+ <div id="photo-slider" class="nivoSlider">
+ {foreach:photos,photo}
+ <a
+ data-download="<?php if($photo->getDownload()){echo '1';}else{echo '0';}?>"
+ data-photoid="<?php echo $photo->getId()?>"
+ data-download="<?php echo $photo->getDownload()?>"
+ rel="<?php echo htmlspecialchars($photo->getDescription())?>"
+ title="<?php echo htmlspecialchars($photo->getTitle())?>"
+ class="photoimg"
+ href="{photoUrlLarge:h}{photo.getImage():h}" class="photoimg">
+ <img
+ alt=""
+ title="#photoCaption-{photo.getId():h}"
+ src="{photoUrlLarge:h}{photo.getImage():h}"
+ data-thumb="{photoUrlSmall:h}{photo.getImage():h}">
+ </a>
+ {end:}
+ </div>
+ </div>
+ {foreach:photos,photo}
+ <div id="photoCaption-{photo.getId():h}" class="nivo-html-caption">
+ <strong flexy:if="photo.getTitle()">{photo.getTitle()}</strong>
+ {photo.getDescription()}
+ {if:photo.getDownload()}
+ <div>Download for <a href="{webUrl:h}{photo.getId():h}/">Web</a>
+ - <a href="{printUrl:h}{photo.getId():h}/">Print</a></div>
+ {end:}
+ </div>
+ {end:}
+ </div>
+ {if:showAllUrl}
+ <div class="view_all_wrapper"><a href="{showAllUrl:h}">View All ({numphotos:h})</a></div>
+ {else:}
+ <style>
+ #category {display: none;}
+ .listings {display: none;}
+ </style>
+ {end:}
+</div><!--.photo_slideshow_wrapper-->