<?php
/*
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2008 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
GalleryCoreApi::requireOnce('modules/slideshow/classes/SlideshowHelper.class');
/**
* Display the slideshow
* @package Slideshow
* @subpackage UserInterface
* @author Alan Harder <alan.harder@sun.com>
* @version $Revision: 17625 $
*/
class SlideshowView extends GalleryView {
/**
* @see GalleryView::loadTemplate
*/
function loadTemplate(&$template, &$form) {
global $gallery;
$urlGenerator =& $gallery->getUrlGenerator();
$Slideshow = array();
list ($itemListString, $startId, $offset) =
GalleryUtilities::getRequestVariables('itemList', 'startId', 'offset');
if (isset($startId)) {
$startId = (int)$startId;
}
if (isset($offset)) {
$offset = (int)$offset;
}
/**
* @todo Remove the redundancy of calling buildAlbumSlideshow() twice (here and in
* SlideshowMediaRss), e.g. by building the lytebox slideshow via AJAX/DOM.
*/
if (!empty($itemListString)) {
foreach (explode('|', $itemListString) as $id) {
$itemIds[] = (int)$id;
}
list ($ret, $items, $start) = SlideshowHelper::buildItemsSlideshow($itemIds, $startId);
if ($ret) {
return array($ret, null);
}
} else {
/* Build slideshow for an album */
list ($ret, $item) = $this->getItem();
if ($ret) {
return array($ret, null);
}
list ($ret, $items, $start) =
SlideshowHelper::buildAlbumSlideshow($item, $startId, $offset);
if ($ret) {
return array($ret, null);
}
}
list ($ret, $module) = GalleryCoreApi::loadPlugin('module', 'slideshow');
if ($ret) {
return array($ret, null);
}
if (!empty($Slideshow['item']['title'])) {
$template->title($module->translate(array('text' => 'Slideshow for %s',
'arg1' => $Slideshow['item']['title'])));
} else {
$template->title($module->translate('Slideshow'));
}
list ($ret, $picLensVersion) = $module->getParameter('piclens.version');
if ($ret) {
return array($ret, null);
}
if ($picLensVersion) {
$Slideshow['piclensVersion'] = $picLensVersion;
$template->javascript($urlGenerator->generateUrl(
array('view' => 'slideshow.DownloadPicLens',
'file' => 'js',
'v' => $picLensVersion),
array('forceDirect' => true, 'forceFullUrl' => true)));
$jsUrlParams = array('forJavascript' => true, 'forceFullUrl' => true,
'htmlEntities' => false);
$jsUrlParamsDirect = array_merge($jsUrlParams, array('forceDirect' => true));
$Slideshow['piclensSwfUrl'] = $urlGenerator->generateUrl(
array('view' => 'slideshow.DownloadPicLens',
'file' => 'swf',
'v' => $picLensVersion),
$jsUrlParamsDirect);
if (empty($itemListString)) {
$Slideshow['mediaRssUrl'] = $urlGenerator->generateUrl(
array('view' => 'slideshow.SlideshowMediaRss',
'itemId' => $item->getId()),
$jsUrlParams);
} else {
$Slideshow['mediaRssUrl'] = $urlGenerator->generateUrl(
array('view' => 'slideshow.SlideshowMediaRss',
'itemList' => $itemListString),
$jsUrlParams);
}
/* Set the start item */
if (!empty($items)) {
$Slideshow['startItemId'] = $items[$start]['item']['id'];
} else {
$Slideshow['startItemId'] = $item->getId();
}
if (GalleryUtilities::hasRequestVariable('return')) {
/* Remove HTML entities */
$Slideshow['returnUrl'] =
html_entity_decode(GalleryUtilities::getRequestVariables('return'));
}
if (empty($Slideshow['returnUrl'])) {
$Slideshow['returnUrl'] = $urlGenerator->generateUrl(
array('view' => 'core.ShowItem', 'itemId' => $Slideshow['startItemId']),
$jsUrlParams);
}
$Slideshow['returnUrl'] = $urlGenerator->makeAbsoluteUrl($Slideshow['returnUrl']);
}
$Slideshow['items'] = $items;
$Slideshow['count'] = count($items);
$Slideshow['start'] = $start;
$template->setVariable('Slideshow', $Slideshow);
$template->javascript('lib/yui/yahoo-dom-event.js');
$template->javascript('modules/slideshow/data/lytebox.js');
$template->link(array('rel' => 'stylesheet',
'href' => 'modules/slideshow/data/lytebox.css',
'type' => 'text/css',
'media' => 'screen'));
return array(null, array('body' => 'modules/slideshow/templates/Slideshow.tpl',
'useFullScreen' => true));
}
}
?>
Posts: 8339
the advice from the wiki is outdated, pre 2.3 slideshow.
Are you referring to the lytebox slideshow or the cooliris version?
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 18
It's the cooliris version, well there is a link to the cooliris website, so I assume it is.
Posts: 8339
1st my opinion:
recursive is idiotic. forcing your visitors to download possibly 1000's of images is irresponsible as a webmaster/website owner.
That said. My picLensRss.php can supply a recursive feed for cooliris.
Instructions to use it within your templates are somewhere in these forums, you'll have to search.
http://gallery.menalto.com/node/79065#comment-279440
http://gallery.menalto.com/node/66745?page=1#comment-268732
I also have an update to the slideshow module which fixes many bugs and allows you to set delay and which resizes appear in the slideshow.
Discussion here if you're interested. Someone mentioned recursive slideshows and we shot 'em down.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 18
Well I think is a good idea for my users to not just see bear carvings, I want them to get a variety of carvings. I don't see the site getting that many pictures until years from now. A random slideshow would be nice, but I think that would entail a lot more work.
Posts: 8339
my script allows for random, updates, popular...
http://www.flashyourweb.com/gallery2/picLensRss.php?mode=dynamic&g2_view=dynamicalbum.UpdatesAlbum
http://www.flashyourweb.com/gallery2/picLensRss.php?mode=dynamic&g2_view=dynamicalbum.RandomAlbum
http://www.flashyourweb.com/gallery2/picLensRss.php?mode=dynamic&g2_view=dynamicalbum.PopularAlbum
its used similar to my mediaRss.php
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 18
Does lytebox slideshow support recursiveness?
Posts: 26
I'm hoping to link to a cooliris slideshow of a dynamic album, can you let me know how to call it?
I have picLensRss.php uploaded
Slideshow update from flashyourweb, working
http://jacksonsteen.ca/gallery2/main.php?g2_view=slideshow.Slideshow&g2_itemId=146&g2_return=%2Fgallery2%2Fmain.php%3Fg2_itemId%3D146
When I link
http://jacksonsteen.ca/gallery2/picLensRss.php?mode=dynamic&g2_view=dynamicalbum.RandomAlbum
I get a page of the feed, but if I use it like I would mediaRss.php, I would make this code:
I recognise it's calling the minislideshow.swf, is that why I'm not getting the cooliris slide? Thanks for any help.
Posts: 8339
something like:
untested
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 26
Mr. Suprsidr, you are singularly the most helpful person I have ever met on the open source internet. Your devotion to sharing your knowledge of things that people care about is truly astounding. You may have no idea how many times your posts have helped me along the way without even having to post a new question to the community. May your tireless efforts be rewarded in all aspects of your life. I truly thank you. I thank you myself, and on the behalf of anyone too busy to thank you that has been reading any of these threads, though they may read like a mystery novel.
btw, I think that advice worked, I can't totally tell yet, because I'm on dialup.
Posts: 8339
A little flattery will get you everywhere.(everyone else take note)
Only question... what is dialup?
Have a good holiday and may you find the $20/mnth for broadband.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 26
Very funny. I happen to like living out in the sticks. It's quiet, and there is time for musical devotions and careful contemplation.
Speaking of which, do you know a way to keep the filename from showing up in the black rectangle in the upper right corner of the cooliris slideshow?
same link, www.jacksonsteen.ca View Slideshow link on main page
Thanks for your consideration