Index: /extensions/UserCollections/include/UserCollection.class.php
===================================================================
--- /extensions/UserCollections/include/UserCollection.class.php	(revision 17177)
+++ /extensions/UserCollections/include/UserCollection.class.php	(revision 17178)
@@ -292,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['public_id'],
+      'U_PUBLIC' => get_absolute_root_url().'collection/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 17177)
+++ /extensions/UserCollections/include/collections.inc.php	(revision 17178)
@@ -120,10 +120,10 @@
       $col['date_creation'] = format_date($col['date_creation'], true);
       $col['U_EDIT'] = USER_COLLEC_PUBLIC.'edit/'.$col['id'];
-      $col['U_ACTIVE'] = USER_COLLEC_PUBLIC.'&amp;action=set_active&amp;col_id='.$col['id'];
-      $col['U_DELETE'] = USER_COLLEC_PUBLIC.'&amp;action=delete&amp;col_id='.$col['id'];
+      $col['U_ACTIVE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'set_active','col_id'=>$col['id']));
+      $col['U_DELETE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'delete','col_id'=>$col['id']));
       
       if (isset($pwg_loaded_plugins['BatchDownloader']))
       {
-        $col['U_DOWNLOAD'] = USER_COLLEC_PUBLIC.'view/'.$col['public_id'].'&amp;action=advdown_set';
+        $col['U_DOWNLOAD'] = add_url_params(USER_COLLEC_PUBLIC.'view/'.$col['public_id'], array('action'=>'advdown_set'));
       }
       
@@ -132,5 +132,5 @@
       {
         $col['name'] = 'temp #'.$col['id'];
-        $col['U_SAVE'] = USER_COLLEC_PUBLIC.'&amp;action=save&amp;col_id='.$col['id'];
+        $col['U_SAVE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'save','col_id'=>$col['id']));
         $template->append('temp_col', $col);
       }
@@ -141,5 +141,5 @@
     }
     
-    $template->assign('U_CREATE', USER_COLLEC_PUBLIC.'&amp;action=new&amp;col_id=0');
+    $template->assign('U_CREATE', add_url_params(USER_COLLEC_PUBLIC, array('action'=>'new','col_id'=>'0')));
     break;
   }
@@ -202,5 +202,5 @@
       $col = $UserCollection->getCollectionInfo();
       $col['U_CLEAR'] = $self_url.'&amp;action=clear';
-      $col['U_DELETE'] = USER_COLLEC_PUBLIC.'&amp;action=delete&amp;col_id='.$page['col_id'];
+      $col['U_DELETE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'delete','col_id'=>$page['col_id']));
       $template->assign('collection', $col);
       
Index: /extensions/UserCollections/include/events.inc.php
===================================================================
--- /extensions/UserCollections/include/events.inc.php	(revision 17177)
+++ /extensions/UserCollections/include/events.inc.php	(revision 17178)
@@ -16,4 +16,6 @@
   global $tokens, $page, $conf;
   
+  define('USER_COLLEC_PUBLIC',     make_index_url(array('section' => 'collections')) . '/');
+
   if ($tokens[0] == 'collections')
   {
@@ -35,15 +37,4 @@
     }
   }
-  
-  // if ( script_basename() == 'picture' and @$tokens[1] == 'collections' and preg_match('#^[0-9]+$#', @$tokens[2]) )
-  // {
-    // try
-    // {
-      // $UserCollection = new UserCollection($tokens[2]);
-      // $page['title'].= $conf['level_separator'].l10n('Collection').': <a href="'.USER_COLLEC_PUBLIC . 'view/'.$tokens[2].'">'.$UserCollection->getParam('name').'</a>';
-      // $page['items'] = $UserCollection->getImages();
-      // $page['col_id'] = $tokens[2];
-    // } catch (Exception $e) {}
-  // }
 }
 
@@ -125,5 +116,5 @@
   $template->assign(array(
     'USER_COLLEC_PATH' => USER_COLLEC_PATH,
-    'collection_toggle_url' =>  $self_url,
+    'collection_toggle_url' =>  add_url_params($self_url, array('collection_toggle'=>'')),
     ));
   $template->set_prefilter('index_thumbnails', 'user_collections_thumbnails_list_prefilter');
@@ -137,9 +128,9 @@
   $search = '<span class="wrap1">';
   $replace = $search.'
-{strip}<a class="addCollection" href="{$collection_toggle_url}&amp;collection_toggle={$thumbnail.id}" data-id="{$thumbnail.id}" rel="nofollow">
+{strip}<a class="addCollection" href="{$collection_toggle_url}{$thumbnail.id}" data-id="{$thumbnail.id}" rel="nofollow">
 {if $COL_ID or $thumbnail.COLLECTION_SELECTED}
-{\'Remove from collection\'|@translate}&nbsp;<img src="{$USER_COLLEC_PATH}template/image_delete.png" title="{\'Remove from collection\'|@translate}">
+{\'Remove from collection\'|@translate}&nbsp;<img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/image_delete.png" title="{\'Remove from collection\'|@translate}">
 {else}
-{\'Add to collection\'|@translate}&nbsp;<img src="{$USER_COLLEC_PATH}template/image_add.png" title="{\'Add to collection\'|@translate}">
+{\'Add to collection\'|@translate}&nbsp;<img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/image_add.png" title="{\'Add to collection\'|@translate}">
 {/if}
 </a>{/strip}';
@@ -186,12 +177,12 @@
   }  
   
-  $url = duplicate_picture_url().'&amp;action=collection_toggle';    
+  $url = add_url_params(duplicate_picture_url(), array('action'=>'collection_toggle'));    
   
   $button = '
 <a href="'.$url.'" title="'.($collection?l10n('Remove from collection'):l10n('Add to collection')).'" class="pwg-state-default pwg-button" rel="nofollow">
-  <span class="pwg-icon" style="background:url(\''.USER_COLLEC_PATH.'template/image_'.($collection?'delete':'add').'.png\') center center no-repeat;"> </span>
+  <span class="pwg-icon" style="background:url(\''.get_root_url().USER_COLLEC_PATH.'template/image_'.($collection?'delete':'add').'.png\') center center no-repeat;"> </span>
   <span class="pwg-button-text">'.($collection?l10n('Remove from collection'):l10n('Add to collection')).'</span>
 </a>';
-    
+  // $template->add_picture_button($button, 50);
   $template->concat('PLUGIN_PICTURE_ACTIONS', $button);
 }
@@ -242,5 +233,5 @@
     
     $data['U_LIST'] = USER_COLLEC_PUBLIC;
-    $data['U_CREATE'] = USER_COLLEC_PUBLIC.'&amp;action=new&amp;col_id=0&amp;redirect=true';
+    $data['U_CREATE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'new','col_id'=>'0','redirect'=>'true'));
     
     $template->set_template_dir(USER_COLLEC_PATH . 'template/');
Index: /extensions/UserCollections/main.inc.php
===================================================================
--- /extensions/UserCollections/main.inc.php	(revision 17177)
+++ /extensions/UserCollections/main.inc.php	(revision 17178)
@@ -17,6 +17,4 @@
 define('COLLECTION_IMAGES_TABLE',$prefixeTable.'collection_images');
 define('USER_COLLEC_ADMIN',      get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__)));
-define('USER_COLLEC_PUBLIC',     make_index_url(array('section' => 'collections')) . '/');
-
 
 add_event_handler('init', 'user_collections_init');
Index: /extensions/UserCollections/template/thumbnails_css_js.tpl
===================================================================
--- /extensions/UserCollections/template/thumbnails_css_js.tpl	(revision 17177)
+++ /extensions/UserCollections/template/thumbnails_css_js.tpl	(revision 17178)
@@ -13,9 +13,9 @@
   jQuery.ajax({ldelim}
     type: "POST",
-    url: "{$USER_COLLEC_PATH}toggle_image.php",
+    url: "{$ROOT_URL}{$USER_COLLEC_PATH}toggle_image.php",
     data: {ldelim} {if $COL_ID}"col_id": "{$COL_ID}", {/if}"toggle_id": toggle_id }
   }).done(function(msg) {ldelim}
     if (msg == "true") {ldelim}
-      $trigger.html('{'Remove from collection'|@translate}&nbsp;<img src="{$USER_COLLEC_PATH}template/image_delete.png" title="{'Remove from collection'|@translate}">');
+      $trigger.html('{'Remove from collection'|@translate}&nbsp;<img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/image_delete.png" title="{'Remove from collection'|@translate}">');
       jQuery(".nbImagesCollec").html(parseInt(jQuery(".nbImagesCollec").html()) +1);
     } else if (msg == "false") {ldelim}
@@ -24,5 +24,5 @@
       if (typeof batchdown_count != 'undefined') batchdown_count-=1;
     {else}
-      $trigger.html('{'Add to collection'|@translate}&nbsp;<img src="{$USER_COLLEC_PATH}template/image_add.png" title="{'Add to collection'|@translate}">');
+      $trigger.html('{'Add to collection'|@translate}&nbsp;<img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/image_add.png" title="{'Add to collection'|@translate}">');
     {/if}
       jQuery(".nbImagesCollec").html(parseInt(jQuery(".nbImagesCollec").html()) -1);
