Index: /extensions/UserCollections/include/UserCollection.class.php
===================================================================
--- /extensions/UserCollections/include/UserCollection.class.php	(revision 16657)
+++ /extensions/UserCollections/include/UserCollection.class.php	(revision 16658)
@@ -24,6 +24,27 @@
       'active' => false,
       'public' => false,
+      'public_id' => null,
       );
     $this->images = array();
+    
+    // access from public id
+    if ( strlen($col_id) == 10 and strpos($col_id, 'uc') === 0 )
+    {
+      $query = '
+SELECT id
+  FROM '.COLLECTIONS_TABLE.'
+  WHERE public_id = "'.$col_id.'"
+;';
+      $result = pwg_query($query);
+      
+      if (!pwg_db_num_rows($result))
+      {
+        $col_id = 0;
+      }
+      else
+      {
+        list($col_id) = pwg_db_fetch_row($result);
+      }
+    }
     
     // load specific collection
@@ -37,5 +58,6 @@
     nb_images,
     active,
-    public
+    public,
+    public_id
   FROM '.COLLECTIONS_TABLE.'
   WHERE
@@ -48,12 +70,8 @@
       {
         $this->data['col_id'] = $col_id;
-        list(
-          $this->data['user_id'],
-          $this->data['name'],
-          $this->data['date_creation'],
-          $this->data['nb_images'],
-          $this->data['active'],
-          $this->data['public']
-          ) = pwg_db_fetch_row($result);
+        $this->data = array_merge(
+          $this->data,
+          pwg_db_fetch_assoc($result)
+          );
         
         // make sur all pictures of the collection exist
@@ -89,4 +107,5 @@
       $this->data['active'] = $active;
       $this->data['public'] = $public;
+      $this->data['public_id'] = 'uc'.hash('crc32', uniqid(serialize($this->data, true)));
       
       $query = '
@@ -96,5 +115,6 @@
     date_creation,
     active,
-    public
+    public,
+    public_id
   ) 
   VALUES(
@@ -103,5 +123,6 @@
     NOW(),
     '.(int)$this->data['active'].',
-    '.(int)$this->data['public'].'
+    '.(int)$this->data['public'].',
+    "'.$this->data['public_id'].'"
   )
 ;';
@@ -271,5 +292,5 @@
       'PUBLIC' => (bool)$this->data['public'],
       'DATE_CREATION' => format_date($this->data['date_creation'], true),
-      'U_PUBLIC' => get_absolute_root_url().USER_COLLEC_PUBLIC . 'view/'.$this->data['col_id'],
+      'U_PUBLIC' => get_absolute_root_url().USER_COLLEC_PUBLIC . 'view/'.$this->data['public_id'],
       'IS_TEMP' =>  $this->data['name'] == 'temp',
       );
Index: /extensions/UserCollections/include/collections.inc.php
===================================================================
--- /extensions/UserCollections/include/collections.inc.php	(revision 16657)
+++ /extensions/UserCollections/include/collections.inc.php	(revision 16658)
@@ -11,8 +11,10 @@
   case 'list':
   {
+    // security
     if (is_a_guest()) access_denied();
     
     $template->set_filename('index', dirname(__FILE__) . '/../template/list.tpl');
     
+    // actions
     if ( isset($_GET['action']) and filter_var($_GET['col_id'], FILTER_VALIDATE_INT) !== false )
     {
@@ -115,5 +117,6 @@
       }
     }
-      
+    
+    
     // get collections
     $query = '
@@ -134,7 +137,8 @@
       if (isset($pwg_loaded_plugins['BatchDownloader']))
       {
-        $col['U_DOWNLOAD'] = USER_COLLEC_PUBLIC.'view/'.$col['id'].'&amp;action=advdown_set';
-      }
-      
+        $col['U_DOWNLOAD'] = USER_COLLEC_PUBLIC.'view/'.$col['public_id'].'&amp;action=advdown_set';
+      }
+      
+      // temporary collections are above save collections
       if ($col['name'] == 'temp')
       {
@@ -156,4 +160,5 @@
   case 'edit':
   {
+    // security
     if (empty($page['col_id']))
     {
@@ -162,10 +167,10 @@
     }
     
+    $template->set_filename('index', dirname(__FILE__).'/../template/edit.tpl');
+    
     $self_url = USER_COLLEC_PUBLIC . 'edit/'.$page['col_id'];
-    
-    $template->set_filename('index', dirname(__FILE__).'/../template/edit.tpl');
     $template->assign(array(
       'USER_COLLEC_PATH' => USER_COLLEC_PATH,
-      'U_VIEW' => $self_url,
+      'F_ACTION' => $self_url,
       'collection_toggle_url' => $self_url,
       'U_LIST' => USER_COLLEC_PUBLIC,
@@ -176,5 +181,6 @@
       $UserCollection = new UserCollection($page['col_id']);
       
-      if (!is_admin() and $UserCollection->getParam('user_id') != $user['id'])
+      // security
+      if ( !is_admin() and $UserCollection->getParam('user_id') != $user['id'] )
       {
         access_denied();
@@ -194,12 +200,14 @@
       }
       
+      // special template
+      add_event_handler('loc_end_index_thumbnails', 'user_collections_thumbnails_in_collection', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 2); // +10 to overload GThumb+
+      $template->set_prefilter('index_thumbnails', 'user_collections_thumbnails_list_prefilter');
+      
+      // collection content
       $template->assign('collection', $UserCollection->getCollectionInfo());
-      
-      // add_event_handler('loc_end_index_thumbnails', 'user_collections_thumbnails_in_collection', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
-      $template->set_prefilter('index_thumbnails', 'user_collections_thumbnails_list_prefilter');
-      
+      $page['items'] = $UserCollection->getImages();
+      
+      // navigation bar
       $page['start'] = isset($_GET['start']) ? $_GET['start'] : 0;
-      $page['items'] = $UserCollection->getImages();
-      
       if (count($page['items']) > $page['nb_image_page'])
       {
@@ -214,4 +222,5 @@
       }
       
+      // display
       include(PHPWG_ROOT_PATH . 'include/category_default.inc.php');
       
@@ -229,22 +238,19 @@
   case 'view':
   {
-    if (empty($page['col_id']))
+    // security
+    if ( empty($page['col_id']) or strlen($page['col_id']) != 10 or strpos($page['col_id'], 'uc') === false )
     {
       $_SESSION['page_errors'][] = l10n('Invalid collection');
-      redirect(get_home_url());
-    }
+      redirect('index.php');
+    }
+    
+    $template->set_filename('index', dirname(__FILE__).'/../template/view.tpl');
     
     $self_url = USER_COLLEC_PUBLIC . 'view/'.$page['col_id'];
     
-    $template->set_filename('index', dirname(__FILE__).'/../template/view.tpl');
-    $template->assign(array(
-      'USER_COLLEC_PATH' => USER_COLLEC_PATH,
-      'U_VIEW' => $self_url,
-      ));
-    
-    try
-    {
+    try {
       $UserCollection = new UserCollection($page['col_id']);
       
+      // backlink for owner
       if ($UserCollection->getParam('user_id') == $user['id'])
       {
@@ -252,9 +258,13 @@
       }
       
+      // special template
+      add_event_handler('loc_end_index_thumbnails', 'user_collections_thumbnails_in_collection', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 2); // +10 to overload GThumb+
+      
+      // collection content
       $template->assign('collection', $UserCollection->getCollectionInfo());
-      
+      $page['items'] = $UserCollection->getImages();
+      
+      // navigation bar
       $page['start'] = isset($_GET['start']) ? $_GET['start'] : 0;
-      $page['items'] = $UserCollection->getImages();
-      
       if (count($page['items']) > $page['nb_image_page'])
       {
@@ -269,4 +279,5 @@
       }
       
+      // display
       include(PHPWG_ROOT_PATH . 'include/category_default.inc.php');
       
@@ -289,22 +300,27 @@
 
 
-// function user_collections_thumbnails_in_collection($tpl_thumbnails_var, $pictures)
-// {
-  // global $page;
-  
-  // foreach ($tpl_thumbnails_var as &$thumbnail)
-  // {
-    // $thumbnail['URL'] = duplicate_picture_url(
-        // array(
-          // 'image_id' => $thumbnail['id'],
-          // 'image_file' => $thumbnail['file'],
-          // 'section' => 'collections',
-        // ),
-        // array('start')
-      // ).'/'.$page['col_id'];
-  // }
-  
-  // return $tpl_thumbnails_var;
-// }
+function user_collections_thumbnails_in_collection($tpl_thumbnails_var, $pictures)
+{
+  global $template, $page;
+  
+  $template->set_filename('index_thumbnails', dirname(__FILE__).'/../template/thumbnails.tpl');
+  
+  foreach ($tpl_thumbnails_var as &$thumbnail)
+  {
+    $src_image = new SrcImage($thumbnail);
+    
+    $thumbnail['FILE_SRC'] = DerivativeImage::url(IMG_LARGE, $src_image);
+    $thumbnail['URL'] = duplicate_picture_url(
+        array(
+          'image_id' => $thumbnail['id'],
+          'image_file' => $thumbnail['file'],
+          'section' => 'none',
+        ),
+        array('start')
+      );
+  }
+  
+  return $tpl_thumbnails_var;
+}
 
 ?>
Index: /extensions/UserCollections/maintain.inc.php
===================================================================
--- /extensions/UserCollections/maintain.inc.php	(revision 16657)
+++ /extensions/UserCollections/maintain.inc.php	(revision 16658)
@@ -15,4 +15,5 @@
   `active` tinyint(1) DEFAULT 0,
   `public` tinyint(1) DEFAULT 0,
+  `public_id` varchar(10) NULL,
   PRIMARY KEY (`id`)
 ) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1
@@ -31,5 +32,15 @@
 
 function plugin_activate()
-{}
+{
+  global $prefixeTable;
+  
+  // new collumn in beta2
+  $query = 'SHOW COLUMNS FROM `'.$prefixeTable.'collections`;';
+  $columns = array_from_query($query, 'Field');
+  if (!in_array('public_id', $columns))
+  {
+    pwg_query('ALTER TABLE `'.$prefixeTable.'collections` ADD `public_id` varchar(10) NULL;');
+  }
+}
 
 function plugin_uninstall() 
Index: /extensions/UserCollections/template/edit.tpl
===================================================================
--- /extensions/UserCollections/template/edit.tpl	(revision 16657)
+++ /extensions/UserCollections/template/edit.tpl	(revision 16658)
@@ -27,4 +27,5 @@
 {/footer_script}
 
+
 {if $themeconf.name != "stripped" and $themeconf.parent != "stripped" and $themeconf.name != "simple-grey" and $themeconf.parent != "simple"}
   {$MENUBAR}
@@ -34,4 +35,5 @@
 <div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}">
 {if $intern_menu}{$MENUBAR}{/if}
+
 
 <div class="titrePage">
@@ -46,6 +48,7 @@
 {/if}
 
+
 {if $collection and not $collection.IS_TEMP}
-<form action="{$U_VIEW}" method="post">
+<form action="{$F_ACTION}" method="post">
 <fieldset id="colProperties">
   <legend>{'Properties'|@translate}</legend>
@@ -67,5 +70,4 @@
 {/if}
 
-  
 
 {if !empty($THUMBNAILS)}
@@ -79,4 +81,5 @@
 {if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
 
+
 <p style="text-align:center;font-weight:bold;margin:20px;"><a href="{$U_LIST}" rel="nofollow">{'Return to collections list'|@translate}</a></p>
 
Index: /extensions/UserCollections/template/list.tpl
===================================================================
--- /extensions/UserCollections/template/list.tpl	(revision 16657)
+++ /extensions/UserCollections/template/list.tpl	(revision 16658)
@@ -13,4 +13,10 @@
 {/footer_script}
 
+{if $themeconf.name == "clear"}
+{html_head}{literal}
+<style type="text/css">.collecList a { color:#eee; }</style>
+{/literal}{/html_head}
+{/if}
+
 {if $themeconf.name != "stripped" and $themeconf.parent != "stripped" and $themeconf.name != "simple-grey" and $themeconf.parent != "simple"}
   {$MENUBAR}
@@ -20,4 +26,5 @@
 <div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}">
 {if $intern_menu}{$MENUBAR}{/if}
+
 
 <div class="titrePage">
@@ -30,5 +37,7 @@
 {/if}
 
+
 <p style="text-align:left;font-weight:bold;margin:20px;"><a href="{$U_CREATE}" class="save_col">{'Create a new collection'|@translate}</a></p>
+
 
 {if $temp_col}
@@ -55,4 +64,5 @@
 </fieldset>
 {/if}
+
 
 {if $collections}
@@ -82,3 +92,4 @@
 {/if}
 
+
 </div>{* <!-- content --> *}
Index: /extensions/UserCollections/template/style.css
===================================================================
--- /extensions/UserCollections/template/style.css	(revision 16657)
+++ /extensions/UserCollections/template/style.css	(revision 16658)
@@ -11,13 +11,17 @@
   }
   
-#publicURL {}
+#publicURL {
+  display:inline-block;
+  height:22px;
+}
   #publicURL .url {
     display:inline-block;
-    position:relative;
+    height:14px;
+    vertical-align:bottom;
+    padding:3px 10px;
+    background:#fff;
     font-family:monospace;
     font-size:12px;
-    background:#fff;
     color:#666;
-    padding:3px 10px;
     border:1px solid #999;
     border-radius:0 3px 3px 0;
@@ -28,5 +32,5 @@
     width:25px;
     height:20px;
-    color:#666;
+    vertical-align:bottom;
     border:1px solid #999;
     border-right:none;
Index: /extensions/UserCollections/template/thumbnails.tpl
===================================================================
--- /extensions/UserCollections/template/thumbnails.tpl	(revision 16658)
+++ /extensions/UserCollections/template/thumbnails.tpl	(revision 16658)
@@ -0,0 +1,72 @@
+{combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'}
+{combine_css path="themes/default/js/plugins/colorbox/style2/colorbox.css"}
+{footer_script}
+jQuery("a.preview-box").colorbox({ldelim}
+  rel: ".preview-box",
+  title: function() {ldelim}
+    return $(this).attr("title") +' · <a href="'+ $(this).data('url') +'" target="_blank">{'jump to photo'|@translate} →</a>';
+  }
+});
+{/footer_script}
+
+{if !empty($thumbnails)}{strip}
+{*define_derivative name='derivative_params' width=160 height=90 crop=true*}
+{html_style}
+{*Set some sizes according to maximum thumbnail width and height*}
+.thumbnails SPAN,
+.thumbnails .wrap2 A,
+.thumbnails LABEL{ldelim}
+	width: {$derivative_params->max_width()+2}px;
+}
+
+.thumbnails .wrap2{ldelim}
+	height: {$derivative_params->max_height()+3}px;
+}
+{if $derivative_params->max_width() > 600}
+.thumbLegend {ldelim}font-size: 130%}
+{else}
+{if $derivative_params->max_width() > 400}
+.thumbLegend {ldelim}font-size: 110%}
+{else}
+.thumbLegend {ldelim}font-size: 90%}
+{/if}
+{/if}
+{/html_style}
+{foreach from=$thumbnails item=thumbnail}
+{assign var=derivative value=$pwg->derivative($derivative_params, $thumbnail.src_image)}
+{if !$derivative->is_cached()}
+{combine_script id='jquery.ajaxmanager' path='themes/default/js/plugins/jquery.ajaxmanager.js' load='footer'}
+{combine_script id='thumbnails.loader' path='themes/default/js/thumbnails.loader.js' require='jquery.ajaxmanager' load='footer'}
+{/if}
+<li>
+	<span class="wrap1">
+		<span class="wrap2">
+		<a href="{$thumbnail.FILE_SRC}" class="preview-box" title="{$thumbnail.NAME}" data-url="{$thumbnail.URL}">
+			<img class="thumbnail" {if $derivative->is_cached()}src="{$derivative->get_url()}"{else}src="{$ROOT_URL}{$themeconf.img_dir}/ajax-loader-small.gif" data-src="{$derivative->get_url()}"{/if} alt="{$thumbnail.TN_ALT}" title="{$thumbnail.TN_TITLE}">
+		</a>
+		</span>
+		{if $SHOW_THUMBNAIL_CAPTION }
+		<span class="thumbLegend">
+		<span class="thumbName">{$thumbnail.NAME}</span>
+		{if !empty($thumbnail.icon_ts)}
+		<img title="{$thumbnail.icon_ts.TITLE}" src="{$ROOT_URL}{$themeconf.icon_dir}/recent.png" alt="(!)">
+		{/if}
+		{if isset($thumbnail.NB_COMMENTS)}
+		<span class="{if 0==$thumbnail.NB_COMMENTS}zero {/if}nb-comments">
+		<br>
+		{$pwg->l10n_dec('%d comment', '%d comments',$thumbnail.NB_COMMENTS)}
+		</span>
+		{/if}
+
+		{if isset($thumbnail.NB_HITS)}
+		<span class="{if 0==$thumbnail.NB_HITS}zero {/if}nb-hits">
+		<br>
+		{$pwg->l10n_dec('%d hit', '%d hits',$thumbnail.NB_HITS)}
+		</span>
+		{/if}
+		</span>
+		{/if}
+	</span>
+	</li>
+{/foreach}{/strip}
+{/if}
Index: /extensions/UserCollections/template/thumbnails_css_js.tpl
===================================================================
--- /extensions/UserCollections/template/thumbnails_css_js.tpl	(revision 16657)
+++ /extensions/UserCollections/template/thumbnails_css_js.tpl	(revision 16658)
@@ -1,5 +1,5 @@
 {html_style}
 .thumbnails .wrap1 {ldelim} position:relative !important; }
-.addCollection {ldelim} width:100%;height:16px;display:none;position:absolute;top:0;background:rgba(0,0,0,0.8);padding:2px;border-radius:2px;font-size:0.8em;z-index:100;color:#eee;white-space:nowrap; }
+.addCollection {ldelim} width:100%;height:16px;display:none;position:absolute;top:0;background:rgba(0,0,0,0.8);padding:2px;border-radius:2px;font-size:10px;z-index:100;color:#eee;white-space:nowrap; }
 .wrap1:hover .addCollection {ldelim} display:block; }
 {/html_style}
Index: /extensions/UserCollections/template/view.tpl
===================================================================
--- /extensions/UserCollections/template/view.tpl	(revision 16657)
+++ /extensions/UserCollections/template/view.tpl	(revision 16658)
@@ -1,3 +1,4 @@
 {combine_css path=$USER_COLLEC_PATH|@cat:"template/style.css"}
+
 
 {if $themeconf.name != "stripped" and $themeconf.parent != "stripped" and $themeconf.name != "simple-grey" and $themeconf.parent != "simple"}
@@ -8,4 +9,5 @@
 <div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}">
 {if $intern_menu}{$MENUBAR}{/if}
+
 
 <div class="titrePage">
@@ -20,4 +22,5 @@
 {/if}
 
+
 {if !empty($THUMBNAILS)}
 <ul class="thumbnails" id="thumbnails">
@@ -28,4 +31,5 @@
 {if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
 
+
 {if $U_LIST}<p style="text-align:center;font-weight:bold;margin:20px;"><a href="{$U_LIST}" rel="nofollow">{'Return to collections list'|@translate}</a></p>{/if}
 
