From: Andreas Unterkircher Date: Sun, 25 May 2008 08:31:19 +0000 (+0200) Subject: Merge commit 'origin/master' X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=commitdiff_plain;h=b00bd5fec92bfd4ed63f47b18259d9ff8cfa3638;hp=5265afe15da056af94e1708e740dcc77b23a7929 Merge commit 'origin/master' --- diff --git a/CHANGELOG b/CHANGELOG index ead9512..12cd368 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -13,7 +13,7 @@ phpfspot (1.5) * bug, file-name-search can now be combined with any other search and will no longer produce SQL errors. - -- Andreas Unterkircher Sat, 13 Apr 2008 11:00:00 +0100 + -- Andreas Unterkircher Sat, 25 May 2008 11:00:00 +0100 phpfspot (1.4) diff --git a/UPGRADE b/UPGRADE index 89313b4..348d989 100644 --- a/UPGRADE +++ b/UPGRADE @@ -1,12 +1,16 @@ == Upgrading from 1.4 == * nothing special necessary. + * Take a look into phpfspot_cfg.php.dist for supporting Nikon's NEF + format. + * If you want to give the new user-friendly-urls a try, checkout + the project website for more information. == Upgrading from 1.3 == * nothing special necessary. - * Take a look into phpfspot_cfg.dist for $use_lightbox and - * $use_autocomplete if you want to use the new features. + * Take a look into phpfspot_cfg.php.dist for $use_lightbox and + $use_autocomplete if you want to use the new features. == Upgrading from 1.2 == diff --git a/phpfspot.class.php b/phpfspot.class.php index 58cda4e..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); @@ -689,7 +703,7 @@ class PHPFSPOT { $info = getimagesize($orig_path); /* get EXIF information if JPEG */ - if($info['mime'] == "image/jpeg") { + if(isset($info['mime']) && $info['mime'] == "image/jpeg") { $meta = $this->get_meta_informations($orig_path); } @@ -748,15 +762,16 @@ class PHPFSPOT { $this->tmpl->assign('current_page', $this->getCurrentPage($current, $count)); $this->tmpl->assign('current_img', $photo); - if($previous_img) { + if(isset($previous_img)) { $this->tmpl->assign('previous_url', "javascript:showPhoto(". $previous_img .");"); $this->tmpl->assign('prev_img', $previous_img); } - if($next_img) { + if(isset($next_img)) { $this->tmpl->assign('next_url', "javascript:showPhoto(". $next_img .");"); $this->tmpl->assign('next_img', $next_img); } + $this->tmpl->assign('mini_width', $this->cfg->mini_width); $this->tmpl->assign('photo_width', $this->cfg->photo_width); $this->tmpl->assign('photo_number', $i); @@ -1322,6 +1337,7 @@ class PHPFSPOT { public function showPhotoIndex() { $photos = $this->getPhotoSelection(); + $current_tags = $this->getCurrentTags(); $count = count($photos); @@ -1479,7 +1495,6 @@ class PHPFSPOT { $this->tmpl->assign('page_selector', $page_select); } - $current_tags = $this->getCurrentTags(); $extern_link = "index.php?mode=showpi"; $rss_link = "index.php?mode=rss"; if($current_tags != "") { @@ -1575,23 +1590,25 @@ class PHPFSPOT { $flip_hori = false; $flip_vert = false; - switch($meta['Orientation']) { - case 1: /* top, left */ - /* nothing to do */ break; - case 2: /* top, right */ - $rotate = 0; $flip_hori = true; break; - case 3: /* bottom, left */ - $rotate = 180; break; - case 4: /* bottom, right */ - $flip_vert = true; break; - case 5: /* left side, top */ - $rotate = 90; $flip_vert = true; break; - case 6: /* right side, top */ - $rotate = 90; break; - case 7: /* left side, bottom */ - $rotate = 270; $flip_vert = true; break; - case 8: /* right side, bottom */ - $rotate = 270; break; + if(isset($meta['Orientation'])) { + switch($meta['Orientation']) { + case 1: /* top, left */ + /* nothing to do */ break; + case 2: /* top, right */ + $rotate = 0; $flip_hori = true; break; + case 3: /* bottom, left */ + $rotate = 180; break; + case 4: /* bottom, right */ + $flip_vert = true; break; + case 5: /* left side, top */ + $rotate = 90; $flip_vert = true; break; + case 6: /* right side, top */ + $rotate = 90; break; + case 7: /* left side, bottom */ + $rotate = 270; $flip_vert = true; break; + case 8: /* right side, bottom */ + $rotate = 270; break; + } } $src_img = @imagecreatefromjpeg($orig_image); @@ -2291,7 +2308,7 @@ class PHPFSPOT { private function _debug($text) { - if($this->fromcmd) { + if(isset($this->fromcmd)) { print $text; } @@ -2549,7 +2566,7 @@ class PHPFSPOT { $orig_path = $this->translate_path($this->parse_uri($details['uri'], 'fullpath')); /* get EXIF information if JPEG */ - if($details['mime'] == "image/jpeg") { + if(isset($details['mime']) && $details['mime'] == "image/jpeg") { $meta = $this->get_meta_informations($orig_path); } @@ -2579,7 +2596,10 @@ class PHPFSPOT { /** - * return all selected tags as one string + * get all selected tags + * + * This function will return all selected tags as one string, seperated + * by a comma. * @return array */ private function getCurrentTags() diff --git a/phpfspot.js b/phpfspot.js index b4e8421..555e8ff 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -337,8 +337,13 @@ function datesearch() * called for photo-index export. will return the * selected mode via AJAX from the server. */ -function setViewMode(mode) +function setViewMode(srv_webpath, mode) { + if(srv_webpath != undefined) + web_path = srv_webpath; + else + web_path = ''; + var exprt = document.getElementById('output'); exprt.innerHTML = "Loading..."; exprt.innerHTML = HTML_AJAX.grab(encodeURI(web_path + '/rpc.php?action=get_export&mode=' + mode)); @@ -655,17 +660,19 @@ function preloadPhotos(image_url) { var waiting = 100; var counting; - lbImg=WSR_getElementsByClassName(document,"img","thumb"); - for(i=0;i
-
+