cleanup: worked a bit on valid html
[phpfspot.git] / themes / default / templates / photo_index.tpl
1 <!-- Photo Index -->
2 <div class="header">
3  <div class="subheader">
4   <b>Photo Index</b>
5   {if $searchfor }
6    {if $count == 1}
7     {$count} image is the result for your search about "{$searchfor}".
8    {else}
9     {$count} images are the result for your search about "{$searchfor}".
10    {/if}
11   {elseif $tag_result}
12    {if $count == 1}
13     {$count} image has been found for the selected tags.
14    {else}
15     {$count} images have been found for the selected tags.
16    {/if}
17   {else}
18    {if $count == 1}
19     {$count} image has been found.
20    {else}
21     {$count} images have been found.
22    {/if}
23   {/if}
24   {if $from_date && $to_date }
25    <br />
26    Results are limited to a date within {$from_date} to {$to_date}.
27   {/if}
28  </div>
29 <div class="textright">
30   {if $slideshow_link }
31    <a href="{$slideshow_link}" title="Slideshow" target="_blank"><img src="resources/slideshow.png" /></a>
32   {/if}
33   {if $extern_link }
34    <a href="{$extern_link}" title="Use this link to return to the current view"><img src="resources/link.png" /></a>
35   {/if} 
36   {if $export_link }
37    <a href="{$export_link}" target="_blank" title="this will open a new browser window where you can export this page in several formats"><img src="resources/export.png" /></a>
38   {/if}
39   {if $rss_link }
40    <a href="{$rss_link}" target="_blank" title="RSS feed"><img src="resources/rss.png" /></a>
41   {/if}
42  </div>
43 </div>
44 { if $tag_result }
45 <div class="tagresult"></div>
46 <div class="subheader">
47  <div class="tagresulttags">
48  Tags:
49  </div>
50  { $selected_tags }
51 </div>
52 { /if }
53
54 <div id="index">
55
56  {section name="thumb" loop=$thumbs step=1}
57
58   {if $images[thumb] }
59
60    <div class="thumb" onmouseover="setBackGrdColor(this, 'mouseover');" onmouseout="setBackGrdColor(this, 'mouseout');" style="width: { $thumb_container_width }px; height: { $thumb_container_height }px;">
61     <a href="javascript:showImage({$images[thumb]}, 'scrollup');" id="thumblink{$images[thumb]}" name="image{$img_id[thumb]}" class="thumblink" onclick="click(this);" title="{$img_title[thumb]}">
62      <img class="thumb" id="thumbimg{$images[thumb]}" width="{$img_width[thumb]}" height="{$img_height[thumb]}" />
63      <br />
64     {$img_name[thumb]}
65     </a>
66     { if $use_lightbox }
67     <a href="phpfspot_img.php?idx={$images[thumb]}&amp;width={$preview_width}" alt="thumb_{$images[thumb]}" rel="lightbox[photoidx]" title="Preview of {$img_fullname[thumb]}"><img src="resources/eyes.png" /></a>
68     { /if }
69    </div>
70
71   {/if}
72
73  {/section} 
74
75 </div>
76 <br class="clearboth" />
77 <div class="indexnavigation">
78
79  <!-- the right nav arrow -->
80  <div class="indexnavigationright">
81  { if $next_url == "" }
82   { if $count != 0 }
83    <img src="resources/arrow_right_gray.png" alt="last page reached" />
84   { /if }
85  { else }
86   <a href="{$next_url}" id="next_link" title="click for the next page (right cursor)">
87    <img src="resources/arrow_right.png" alt="next photo" />
88   </a>
89  { /if}
90  </div>
91
92  <!-- the left nav arrow -->
93  <div class="indexnavigationleft">
94  { if $previous_url == "" }
95   { if $count != 0 }
96    <img src="resources/arrow_left_gray.png" alt="first page reached" />
97   { /if }
98  { else }
99   <a href="{$previous_url}" id="prev_link" title="click for the previous page (left cursor)">
100   <img src="resources/arrow_left.png" alt="previous photo" />
101   </a>
102  { /if }
103  </div>
104
105  <!-- the middle page selector -->
106  <div class="indexnavigationcenter">
107  { if $page_selector != "" }
108   {$page_selector}
109  { /if}
110  </div>
111 </div>
112 <br class="clearboth" />
113 <script type="text/javascript" language="JavaScript">
114 <!--
115    /*** image preloading ***/
116    { counter start=-1 }
117
118    var current;
119    var image_urls = new Array();
120    var last_thumb;
121
122    {section name="thumb" loop=$thumbs step=1}
123       {if $images[thumb] }
124          image_urls[{counter}] = 'phpfspot_img.php?idx={$images[thumb]}&width={$width}';
125          last_thumb = {$images[thumb]};
126       {/if}
127    {/section}
128
129    preloadPhotos(image_urls);
130
131    // auto-scroll
132    //
133    // if browser is to far down the page, that he can't see the photo at all
134    // scroll it up so that at least the last photo becomes visisble.
135    { literal }
136
137    var ywnd = 0;
138    var yimg = 0;
139    // check where we are with the browser
140    if (window.pageYOffset) {
141       ywnd = window.pageYOffset;
142    } else if (document.body && document.body.scrollTop) {
143       ywnd = document.body.scrollTop;
144    }
145    // check the y-pos of the last thumbnail
146    if(thumbimg = document.getElementById('thumbimg' + last_thumb)) {
147       yimg = findPos(thumbimg,'top');
148    }
149    // if the browser-window is scrolled further then the last_thumb, scroll back
150    if(ywnd > yimg) {
151       window.scrollTo(0, yimg-100);
152    }
153
154    { /literal }
155    // auto-scroll
156
157 -->
158 </script>
159 <!-- /Photo Index -->