diff options
-rw-r--r-- | phpfspot.class.php | 31 | ||||
-rw-r--r-- | phpfspot.js | 36 | ||||
-rw-r--r-- | resources/32_fwd.png | bin | 0 -> 1017 bytes | |||
-rw-r--r-- | resources/32_rew.png | bin | 0 -> 1013 bytes | |||
-rw-r--r-- | resources/32_stop.png | bin | 0 -> 259 bytes | |||
-rw-r--r-- | rpc.php | 4 | ||||
-rw-r--r-- | themes/default/templates/slideshow.tpl | 6 |
7 files changed, 73 insertions, 4 deletions
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'])) diff --git a/phpfspot.js b/phpfspot.js index 6bc0d2c..1e074bb 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -302,9 +302,17 @@ function preloadPhotos(lbImg) { function startSlideShow() { - HTML_AJAX.grab(encodeURI('rpc.php?action=reset_slideshow')); - nextSlide(); - setInterval("nextSlide()", 3000); + if(!sliding) { + HTML_AJAX.grab(encodeURI('rpc.php?action=reset_slideshow')); + nextSlide(); + sliding = setInterval("nextSlide()", 3000); + document.getElementById('stop_ico').src = "resources/32_stop.png"; + } + else { + clearInterval(sliding); + sliding = 0; + document.getElementById('stop_ico').src = "resources/32_play.png"; + } } function nextSlide() @@ -313,6 +321,26 @@ function nextSlide() document.getElementById('slide_img').src = next_img; } +function prevSlide() +{ + prev_img = HTML_AJAX.grab(encodeURI('rpc.php?action=get_prev_slideshow_img')); + document.getElementById('slide_img').src = prev_img; +} + +function pauseSlideShow() +{ + if(!sliding_paused) { + sliding_paused = 1; + clearInterval(sliding); + document.getElementById('pause_ico').src = "resources/32_play.png"; + } + else { + sliding_paused = 0; + sliding = setInterval("nextSlide()", 3000); + document.getElementById('pause_ico').src = "resources/32_pause.png"; + } +} + function startAutoBrowse() { if(!autobrowse) { @@ -339,3 +367,5 @@ var startup = 1; var calendar_shown = 0; var calendar_mode = ''; var autobrowse = 0; +var sliding = 0; +var sliding_paused = 0; diff --git a/resources/32_fwd.png b/resources/32_fwd.png Binary files differnew file mode 100644 index 0000000..128920e --- /dev/null +++ b/resources/32_fwd.png diff --git a/resources/32_rew.png b/resources/32_rew.png Binary files differnew file mode 100644 index 0000000..d94192d --- /dev/null +++ b/resources/32_rew.png diff --git a/resources/32_stop.png b/resources/32_stop.png Binary files differnew file mode 100644 index 0000000..4d88e48 --- /dev/null +++ b/resources/32_stop.png @@ -121,6 +121,10 @@ class PHPFSPOT_RPC { case 'get_next_slideshow_img': print $fspot->getNextSlideShowImage(); break; + + case 'get_prev_slideshow_img': + print $fspot->getPrevSlideShowImage(); + break; } diff --git a/themes/default/templates/slideshow.tpl b/themes/default/templates/slideshow.tpl index bba5cd2..3d0ab27 100644 --- a/themes/default/templates/slideshow.tpl +++ b/themes/default/templates/slideshow.tpl @@ -5,5 +5,11 @@ <img id="slide_img" alt="slideshow_img" /> </a> </div> + <div style="margin: 0 auto; padding: 10px;"> + <a href="javascript:prevSlide();" onclick="click(this);" title="slive to previous photo"><img id="rew_ico" src="resources/32_rew.png" /></a> + <a href="javascript:pauseSlideShow();" onclick="click(this);"><img id="pause_ico" src="resources/32_pause.png" /></a> + <a href="javascript:startSlideShow();" onclick="click(this);" title="stop and revert slideshow"><img id="stop_ico" src="resources/32_stop.png" /></a> + <a href="javascript:nextSlide();" onclick="click(this);" title="slide to next photo"><img id="fwd_ico" src="resources/32_fwd.png" /></a> + </div> </body> {include file="footer.tpl"} |