From a36bd6f4555cf410712611b5efcb82fdf5898551 Mon Sep 17 00:00:00 2001 From: Andreas Unterkircher Date: Sun, 22 Jul 2007 07:31:40 +0000 Subject: issue46, slideshow control (rew, pause/play/stop, fwd) git-svn-id: file:///var/lib/svn/phpfspot/trunk@239 fa6a889d-dae6-447d-9e79-4ba9a3039384 --- phpfspot.class.php | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'phpfspot.class.php') diff --git a/phpfspot.class.php b/phpfspot.class.php index 825f92d..2a28135 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -105,6 +105,7 @@ class PHPFSPOT { $this->tmpl->assign('searchfor', $_SESSION['searchfor']); $this->tmpl->assign('page_title', $this->cfg->page_title); $this->tmpl->assign('current_condition', $_SESSION['tag_condition']); + $this->tmpl->assign('template_path', 'themes/'. $this->cfg->theme_name); $_SESSION['start_action'] = $_GET['mode']; @@ -150,7 +151,6 @@ class PHPFSPOT { $this->tmpl->assign('to_date', $this->get_calendar('to')); $this->tmpl->assign('sort_field', $this->get_sort_field()); $this->tmpl->assign('content_page', 'welcome.tpl'); - $this->tmpl->assign('template_path', 'themes/'. $this->cfg->theme_name); $this->tmpl->show("index.tpl"); @@ -1666,6 +1666,12 @@ class PHPFSPOT { } // get_sort_order() + /*** + * return the next to be shown slide show image + * + * this function returns the URL of the next image + * in the slideshow sequence. + */ public function getNextSlideShowImage() { $all_photos = $this->getPhotoSelection(); @@ -1683,6 +1689,29 @@ class PHPFSPOT { } // getNextSlideShowImage() + /*** + * return the previous to be shown slide show image + * + * this function returns the URL of the previous image + * in the slideshow sequence. + */ + public function getPrevSlideShowImage() + { + $all_photos = $this->getPhotoSelection(); + + if(!isset($_SESSION['slideshow_img']) || $_SESSION['slideshow_img'] == 0) + $_SESSION['slideshow_img'] = 0; + else + $_SESSION['slideshow_img']--; + + $server_name = $_SERVER['SERVER_NAME']; + if(!isset($_SERVER['HTTPS'])) $protocol = "http"; + else $protocol = "https"; + + return $protocol ."://". $server_name . $this->cfg->web_path ."phpfspot_img.php?idx=". $all_photos[$_SESSION['slideshow_img']] ."&width=". $this->cfg->photo_width; + + } // getPrevSlideShowImage() + public function resetSlideShow() { if(isset($_SESSION['slideshow_img'])) -- cgit v1.2.3-18-g5258