Index: trunk/include/template.class.php
===================================================================
--- trunk/include/template.class.php	(revision 8399)
+++ trunk/include/template.class.php	(revision 8401)
@@ -429,5 +429,5 @@
           $css = array_merge($css, $files);
       }
-      
+
       $content = array();
       foreach( $css as $file_ver )
@@ -598,5 +598,5 @@
       if (count($this->scriptLoader->inline_scripts))
       {
-        $content[]= '<script type="text/javascript">//<![CDATA[ 
+        $content[]= '<script type="text/javascript">//<![CDATA[
 ';
         $content = array_merge($content, $this->scriptLoader->inline_scripts);
@@ -979,4 +979,5 @@
       }
     }
+
     foreach( array_keys($todo) as $id )
     {
@@ -1020,5 +1021,5 @@
     return $results;
   }
-  
+
   // checks that if B depends on A, then B->load_mode >= A->load_mode in order to respect execution order
   private static function check_load_dep($scripts)
@@ -1042,5 +1043,5 @@
             $changed = true;
           }
-          if ($load==2 && $scripts[$precedent]->load_mode==2 && ($script->is_remote() or !$conf['template_combine_files']) )
+          if ($load==2 && $scripts[$precedent]->load_mode==2 && ($scripts[$precedent]->is_remote() or !$conf['template_combine_files']) )
           {// we are async -> a predecessor cannot be async unlesss it can be merged; otherwise script execution order is not guaranteed
             $scripts[$precedent]->load_mode = 1;
@@ -1159,5 +1160,5 @@
     global $conf;
     $key = array();
-    if ($is_css) 
+    if ($is_css)
       $key[] = get_absolute_root_url(false);//because we modify bg url
     for ($i=0; $i<count($this->files); $i++)
@@ -1171,5 +1172,5 @@
     $file = base_convert(crc32($key),10,36);
     $file = self::OUT_SUB_DIR . $file . '.' . $this->type;
-    
+
     $exists = file_exists( PHPWG_ROOT_PATH . $file );
     if ($exists)
@@ -1221,5 +1222,5 @@
     return $js;
   }
-  
+
   private static function process_css($file)
   {
@@ -1227,8 +1228,8 @@
     require_once(PHPWG_ROOT_PATH.'include/cssmin.class.php');
     $css = CssMin::minify($css, array('emulate-css3-variables'=>false));
-		$css = trigger_event('combined_css_postfilter', $css);
+    $css = trigger_event('combined_css_postfilter', $css);
     return $css;
   }
-  
+
   private static function process_css_rec($file)
   {
@@ -1244,5 +1245,5 @@
           $relative = dirname($file) . "/$match[1]";
           $search[] = $match[0];
-          $replace[] = 'url('.embellish_url(get_absolute_root_url(false)).$relative.')';
+          $replace[] = 'url('.embellish_url(get_absolute_root_url(false).$relative).')';
         }
       }
Index: trunk/index.php
===================================================================
--- trunk/index.php	(revision 8399)
+++ trunk/index.php	(revision 8401)
@@ -27,10 +27,19 @@
 include(PHPWG_ROOT_PATH.'include/section_init.inc.php');
 
+// Check Access and exit when user status is not ok
+check_status(ACCESS_GUEST);
+
+if (!isset($page['start']))
+{
+  $page['start'] = 0;
+}
+
+// access authorization check
+if (isset($page['category']))
+{
+  check_restrictions($page['category']['id']);
+}
+
 trigger_action('loc_begin_index');
-
-// +-----------------------------------------------------------------------+
-// | Check Access and exit when user status is not ok                      |
-// +-----------------------------------------------------------------------+
-check_status(ACCESS_GUEST);
 
 //---------------------------------------------- change of image display order
@@ -53,15 +62,4 @@
 }
 //-------------------------------------------------------------- initialization
-// detection of the start picture to display
-if (!isset($page['start']))
-{
-  $page['start'] = 0;
-}
-
-// access authorization check
-if (isset($page['category']))
-{
-  check_restrictions($page['category']['id']);
-}
 
 $page['navigation_bar'] = array();
@@ -256,5 +254,5 @@
 
 // category comment
-if (isset($page['comment']) and $page['comment'] != '')
+if ($page['start']==0 and !isset($page['chronology_field']) and !empty($page['comment']) )
 {
   $template->assign('CONTENT_DESCRIPTION', $page['comment'] );
Index: trunk/themes/default/template/index.tpl
===================================================================
--- trunk/themes/default/template/index.tpl	(revision 8399)
+++ trunk/themes/default/template/index.tpl	(revision 8401)
@@ -4,9 +4,9 @@
 <div class="titrePage">
 	<ul class="categoryActions">
-		{if !empty($image_orders) }
+		{if !empty($image_orders)}
 		<li>
 		{'Sort order'|@translate}:
 		<select onchange="document.location = this.options[this.selectedIndex].value;">
-			{foreach from=$image_orders item=image_order }
+			{foreach from=$image_orders item=image_order}
 			<option value="{$image_order.URL}"{if $image_order.SELECTED} selected="selected"{/if}>{$image_order.DISPLAY}</option>
 			{/foreach}
@@ -76,51 +76,54 @@
 {/if}
 
-{if isset($chronology.TITLE) }
+{if isset($chronology.TITLE)}
 <h2>{$chronology.TITLE}</h2>
 {/if}
 
-</div> <!-- titrePage -->
+</div><!-- titrePage -->
 
 {if !empty($PLUGIN_INDEX_CONTENT_BEGIN)}{$PLUGIN_INDEX_CONTENT_BEGIN}{/if}
 
-{if !empty($category_search_results) }
+{if !empty($category_search_results)}
 <div style="font-size:16px;margin:10px 16px">{'Album results for'|@translate} <strong>{$QUERY_SEARCH}</strong> :
-  <em><strong>
-  {foreach from=$category_search_results item=res name=res_loop}
-  {if !$smarty.foreach.res_loop.first} &mdash; {/if}
-  {$res}
-  {/foreach}
-  </strong></em>
+	<em><strong>
+	{foreach from=$category_search_results item=res name=res_loop}
+	{if !$smarty.foreach.res_loop.first} &mdash; {/if}
+	{$res}
+	{/foreach}
+	</strong></em>
 </div>
 {/if}
 
-{if !empty($tag_search_results) }
+{if !empty($tag_search_results)}
 <div style="font-size:16px;margin:10px 16px">{'Tag results for'|@translate} <strong>{$QUERY_SEARCH}</strong> :
-  <em><strong>
-  {foreach from=$tag_search_results item=res name=res_loop}
-  {if !$smarty.foreach.res_loop.first} &mdash; {/if}
-  {$res}
-  {/foreach}
-  </strong></em>
+	<em><strong>
+	{foreach from=$tag_search_results item=res name=res_loop}
+	{if !$smarty.foreach.res_loop.first} &mdash; {/if}
+	{$res}
+	{/foreach}
+	</strong></em>
 </div>
 {/if}
 
-{if isset($FILE_CHRONOLOGY_VIEW) }
+{if isset($FILE_CHRONOLOGY_VIEW)}
 {include file=$FILE_CHRONOLOGY_VIEW}
 {/if}
 
-{if !empty($CATEGORIES) }{$CATEGORIES}{/if}
-{if !empty($THUMBNAILS) }{$THUMBNAILS}{/if}
-
-{if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
-
-{if !empty($CONTENT_DESCRIPTION) }
+{if !empty($CONTENT_DESCRIPTION)}
 <div class="additional_info">
-  {$CONTENT_DESCRIPTION}
+	{$CONTENT_DESCRIPTION}
 </div>
 {/if}
 
-{if !empty($PLUGIN_INDEX_CONTENT_END) }{$PLUGIN_INDEX_CONTENT_END}{/if}
-</div> <!-- content -->
+{if !empty($CATEGORIES)}{$CATEGORIES}{/if}
+{if !empty($THUMBNAILS)}
+<ul class="thumbnails" id="thumbnails">
+{$THUMBNAILS}
+</ul>
+{/if}
 
+{if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
+
+{if !empty($PLUGIN_INDEX_CONTENT_END)}{$PLUGIN_INDEX_CONTENT_END}{/if}
+</div><!-- content -->
 {if !empty($PLUGIN_INDEX_CONTENT_AFTER)}{$PLUGIN_INDEX_CONTENT_AFTER}{/if}
Index: trunk/themes/default/template/thumbnails.tpl
===================================================================
--- trunk/themes/default/template/thumbnails.tpl	(revision 8399)
+++ trunk/themes/default/template/thumbnails.tpl	(revision 8401)
@@ -1,5 +1,4 @@
 
 {if !empty($thumbnails)}
-<ul class="thumbnails">
 {foreach from=$thumbnails item=thumbnail}
 	<li>
@@ -32,6 +31,3 @@
 	</li>
 {/foreach}
-</ul>
 {/if}
-
-
