Index: /trunk/admin/include/functions.php
===================================================================
--- /trunk/admin/include/functions.php	(revision 1718)
+++ /trunk/admin/include/functions.php	(revision 1719)
@@ -529,9 +529,14 @@
     ('.implode(',', $dbfields).')
      VALUES';
-    foreach ($datas as $insert_id => $insert)
+    $first = 1;
+    foreach ($datas as $insert)
     {
       $query.= '
     ';
-      if ($insert_id > 0)
+      if ($first)
+      {
+        $first = 0;
+      }
+      else
       {
         $query.= ',';
@@ -1891,5 +1896,5 @@
   global $conf, $header_notes;
   $count = 0;
-  
+
   if (($conf['show_exif']) and (!function_exists('read_exif_data')))
   {
Index: /trunk/include/category_cats.inc.php
===================================================================
--- /trunk/include/category_cats.inc.php	(revision 1718)
+++ /trunk/include/category_cats.inc.php	(revision 1719)
@@ -3,5 +3,5 @@
 // | PhpWebGallery - a PHP based picture gallery                           |
 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
-// | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
 // +-----------------------------------------------------------------------+
 // | branch        : BSF (Best So Far)
@@ -38,5 +38,5 @@
 SELECT
   id,name, representative_picture_id, comment, nb_images, uppercats,
-  date_last, max_date_last, count_images, count_categories
+  date_last, max_date_last, count_images, count_categories, global_rank
   FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.'
   ON id = cat_id and user_id = '.$user['id'].'
@@ -152,4 +152,8 @@
 }
 
+if ($page['section']=='recent_cats')
+{
+  usort($categories, 'global_rank_compare');
+}
 if (count($categories) > 0)
 {
Index: /trunk/include/page_header.php
===================================================================
--- /trunk/include/page_header.php	(revision 1718)
+++ /trunk/include/page_header.php	(revision 1719)
@@ -63,5 +63,5 @@
 
 // Header notes
-if (count($header_notes) > 0)
+if ( isset($header_notes) and count($header_notes)>0)
 {
   foreach ($header_notes as $header_note)
Index: /trunk/include/template.php
===================================================================
--- /trunk/include/template.php	(revision 1718)
+++ /trunk/include/template.php	(revision 1719)
@@ -3,8 +3,8 @@
 // | PhpWebGallery - a PHP based picture gallery                           |
 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
-// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
 // +-----------------------------------------------------------------------+
 // | branch        : BSF (Best So Far)
-// | file          : $RCSfile$
+// | file          : $Id$
 // | last update   : $Date$
 // | last modifier : $Author$
@@ -294,8 +294,35 @@
     {
       $this->_tpldata['.'][0][$varname] = $varval;
-
-      return true;
-    }
-
+      return true;
+    }
+
+  /**
+   * Root-level variable concatenation. Appends a  string to an existing
+   * variable assignment with the same name.
+   */
+  function concat_var($varname, $varval)
+    {
+      if ( isset($this->_tpldata['.'][0][$varname]) )
+      {
+        $this->_tpldata['.'][0][$varname] .= $varval;
+      }
+      else
+      {
+        $this->_tpldata['.'][0][$varname] = $varval;
+      }
+      return true;
+    }
+
+  /**
+   * Returns a root-level variable value
+   */
+  function get_var($varname, $default=null)
+    {
+      if ( isset($this->_tpldata['.'][0][$varname]) )
+      {
+        return $this->_tpldata['.'][0][$varname];
+      }
+      return $default;
+    }
 
   /**
Index: /trunk/profile.php
===================================================================
--- /trunk/profile.php	(revision 1718)
+++ /trunk/profile.php	(revision 1719)
@@ -3,8 +3,8 @@
 // | PhpWebGallery - a PHP based picture gallery                           |
 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
-// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
 // +-----------------------------------------------------------------------+
 // | branch        : BSF (Best So Far)
-// | file          : $RCSfile$
+// | file          : $Id$
 // | last update   : $Date$
 // | last modifier : $Author$
@@ -39,11 +39,4 @@
 check_status(ACCESS_CLASSIC);
 
-if ($user['is_the_guest'] and !$guest_allowed)
-{
-  echo '<div style="text-align:center;">'.$lang['only_members'].'<br />';
-  echo '<a href="./identification.php">'.$lang['ident_title'].'</a></div>';
-  exit();
-}
-
 $userdata = $user;
 
Index: /trunk/template/yoga/default-layout.css
===================================================================
--- /trunk/template/yoga/default-layout.css	(revision 1718)
+++ /trunk/template/yoga/default-layout.css	(revision 1719)
@@ -234,5 +234,5 @@
 
 UL.tagSelection {
-  width: 40em;
+  width: 99%;
   margin: 1em 0 1em 0;
   padding: 0;
