From ea36e81b91c8689ae44d413eca4697d1993ac30b Mon Sep 17 00:00:00 2001 From: Andreas Unterkircher Date: Sat, 23 May 2009 09:45:29 +0200 Subject: avoid notice messages about undefined variables, resolves #179 Signed-off-by: Andreas Unterkircher --- themes/default/templates/calendar.tpl | 2 +- themes/default/templates/header.tpl | 4 ++-- themes/default/templates/photo_index.tpl | 32 +++++++++++++++---------------- themes/default/templates/search.tpl | 12 ++++++------ themes/default/templates/single_photo.tpl | 32 ++++++++++++++++++------------- themes/default/templates/tags.tpl | 2 +- 6 files changed, 45 insertions(+), 39 deletions(-) (limited to 'themes/default/templates') diff --git a/themes/default/templates/calendar.tpl b/themes/default/templates/calendar.tpl index 1f52732..8c1d27e 100644 --- a/themes/default/templates/calendar.tpl +++ b/themes/default/templates/calendar.tpl @@ -18,7 +18,7 @@ {section name="row" loop=$rows step=1} {section name="col" loop=8 step=1} - {if $matrix[row][col] } + {if isset($matrix[row][col]) } {$matrix[row][col]} {/if} {/section} diff --git a/themes/default/templates/header.tpl b/themes/default/templates/header.tpl index c1d7a0c..d592ebf 100644 --- a/themes/default/templates/header.tpl +++ b/themes/default/templates/header.tpl @@ -8,13 +8,13 @@ - { if $use_lightbox } + { if isset($use_lightbox) } { /if } - { if $use_autocomplete } + { if isset($use_autocomplete) } { /if } diff --git a/themes/default/templates/photo_index.tpl b/themes/default/templates/photo_index.tpl index fa63b31..ddc3229 100644 --- a/themes/default/templates/photo_index.tpl +++ b/themes/default/templates/photo_index.tpl @@ -5,13 +5,13 @@
Photo Index - {if $searchfor } + {if isset($searchfor) } {if $count == 1} {$count} image is the result for your search about "{$searchfor}". {else} {$count} images are the result for your search about "{$searchfor}". {/if} - {elseif $tag_result} + {elseif isset($tag_result)} {if $count == 1} {$count} image has been found for the selected tags. {else} @@ -24,22 +24,22 @@ {$count} images have been found. {/if} {/if} - {if $from_date && $to_date } + {if isset($from_date) && isset($to_date) }
Results are limited to a date within {$from_date} to {$to_date}. {/if}
- {if $slideshow_link } + {if isset($slideshow_link) }  Slideshow {/if} - {if $extern_link } + {if isset($extern_link) }  External Link {/if} - {if $export_link } + {if isset($export_link) }  Export {/if} - {if $rss_link } + {if isset($rss_link) }  RSS-Feed {/if}
@@ -48,7 +48,7 @@ -{ if $tag_result } +{ if isset($tag_result) }
@@ -66,10 +66,10 @@ {section name="thumb" loop=$thumbs step=1} - {if $images[thumb] } + {if isset($images[thumb]) }
- { if $user_friendly_url } + { if isset($user_friendly_url) } { else } @@ -79,11 +79,11 @@ {$img_name[thumb]} - { if $use_lightbox } + { if isset($use_lightbox) } { /if } - { if $img_rating[thumb] } + { if isset($img_rating[thumb]) }
{section name="rating" loop=$img_rating[thumb] step=1} @@ -101,7 +101,7 @@
- { if $next_url == "" } + { if !isset($next_url) || $next_url == "" } { if $count != 0 } last page reached { /if } @@ -114,7 +114,7 @@
- { if $previous_url == "" } + { if !isset($previous_url) || $previous_url == "" } { if $count != 0 } first page reached { /if } @@ -127,7 +127,7 @@
- { if $page_selector != "" } + { if isset($page_selector) && $page_selector != "" } {$page_selector} { /if}
@@ -149,7 +149,7 @@ var last_thumb; {section name="thumb" loop=$thumbs step=1} - {if $images[thumb] } + {if isset($images[thumb]) } image_urls[{counter}] = '{$web_path}/phpfspot_img.php?idx={$images[thumb]}&width={$width}'; last_thumb = {$images[thumb]}; {/if} diff --git a/themes/default/templates/search.tpl b/themes/default/templates/search.tpl index 672bb35..69de0a1 100644 --- a/themes/default/templates/search.tpl +++ b/themes/default/templates/search.tpl @@ -7,7 +7,7 @@ Tag: - { if $use_autocomplete } + { if isset($use_autocomplete) } { literal } { /literal } { else } - + { /if } @@ -31,7 +31,7 @@ Name: - + @@ -40,7 +40,7 @@ Date: - { if ! $date_search_enabled } + { if ! isset($date_search_enabled) } { else } @@ -60,11 +60,11 @@ - { if $has_rating } + { if isset($has_rating) } Rating: - { if ! $rate_search_enabled } + { if ! isset($rate_search_enabled) } { else } diff --git a/themes/default/templates/single_photo.tpl b/themes/default/templates/single_photo.tpl index 572bef7..f74b34c 100644 --- a/themes/default/templates/single_photo.tpl +++ b/themes/default/templates/single_photo.tpl @@ -9,7 +9,7 @@ {else} Photos {/if} - {if $description} + {if isset($description) } - {$description}
{/if} {/if} @@ -19,7 +19,7 @@  Auto-Browse - {if $extern_link } + {if isset($extern_link) }  External Link {/if} original resolution Fullsize @@ -29,27 +29,27 @@

- { if $ExifMadeWith } + { if isset($ExifMadeWith) } camera icon Image taken with:
{$ExifMadeWith}
{ /if } - { if $ExifMadeOn } + { if isset($ExifMadeOn) } calendar icon Image made on:
{$ExifMadeOn}
{ /if } - { if $ExifOrigResolution } + { if isset($ExifOrigResolution) } resolution icon Original resolution:
{$ExifOrigResolution}px
{ /if } Size: {$ExifFileSize}
- { if $image_rating } + { if isset($image_rating) && $image_rating > 0 } rating Rating:
{section name="rating" loop=$image_rating step=1} {/section}
{ /if } - { if $has_versions } + { if isset($has_versions) }
Versions:

{ /if } - { if $tags } + { if isset($tags) }
available tags Tagged with:
{ foreach from=$tags key=id item=name } @@ -65,13 +65,13 @@ { /foreach } { /if }
- { if $prev_img } + { if isset($prev_img) && isset($previous_url) } photo icon Previous:

{ /if} - { if $next_img } + { if isset($next_img) && isset($next_url) } photo icon Next:

@@ -82,7 +82,7 @@