X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.class.php;h=b3455f014cc5450eee2b5de64975343597b6c724;hp=3f06a8772c28de6e091d6a49e3f66f50558ffd12;hb=fa213e56d620580d73b680255370f65eec6db4e6;hpb=9609cbda7f2a5ed1bcd0f3a5540b287a3654f4b9 diff --git a/phpfspot.class.php b/phpfspot.class.php index 3f06a87..b3455f0 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -299,11 +299,15 @@ class PHPFSPOT { } break; case 'export': - $this->tmpl->show("export.tpl"); + /* fetch export template */ + print $this->tmpl->fetch("export.tpl"); + /* no further execution necessary. */ return; break; case 'slideshow': - $this->tmpl->show("slideshow.tpl"); + /* fetch slideshow template */ + print $this->tmpl->show("slideshow.tpl"); + /* no further execution necessary. */ return; break; case 'rss': @@ -343,11 +347,21 @@ class PHPFSPOT { $this->tmpl->assign('preset_available_tags', $this->getAvailableTags()); $this->tmpl->assign('rate_search', $this->get_rate_search()); + /* if no site-content has been set yet... */ if(!isset($content)) { - if(isset($_SESSION['selected_tags']) && !empty($_SESSION['selected_tags'])) + /* if tags are already selected, we can immediately display photo-index */ + if((isset($_SESSION['selected_tags']) && !empty($_SESSION['selected_tags']) && + $_SESSION['start_action'] != 'showp') || $_SESSION['start_action'] == 'showpi') $this->tmpl->assign('initial_content', $this->showPhotoIndex()); - else - $this->tmpl->assign('initial_content', $this->tmpl->fetch('welcome.tpl')); + else { + /* if a photo is already selected, we can immediately display single-photo */ + if(isset($_SESSION['current_photo']) && !empty($_SESSION['current_photo'])) + $this->tmpl->assign('initial_content', $this->showPhoto($_SESSION['current_photo'])); + else { + /* ok, then let us show the welcome page... */ + $this->tmpl->assign('initial_content', $this->tmpl->fetch('welcome.tpl')); + } + } } else $this->tmpl->assign('initial_content', $content);