Index: /extensions/Comments_on_Albums/branch_20/include/coa_admin_comments.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/include/coa_admin_comments.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/include/coa_admin_comments.php	(revision 19992)
@@ -0,0 +1,173 @@
+<?php
+/* Code adapted from admin/comments.php */
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $template, $conf, $user;
+load_language('plugin.lang', COA_PATH);
+
+// +-----------------------------------------------------------------------+
+// |                               tabsheet                                |
+// +-----------------------------------------------------------------------+
+include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
+
+if (isset($_GET['section']) and $_GET['section'] == 'albums')
+{
+  $page['tab'] = 'albums';
+} 
+else 
+{
+  $page['tab'] = 'pictures';
+}
+
+$tabsheet = new tabsheet();
+$tabsheet->add('pictures', l10n('Comments on photos'), get_root_url().'admin.php?page=comments');
+$tabsheet->add('albums', l10n('Comments on albums'), get_root_url().'admin.php?page=comments&amp;section=albums');
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+
+if ($page['tab'] == 'albums') 
+{
+  // clear template sended by original page
+  $template->clear_assign(array('ADMIN_CONTENT', 'comments', 'LIST', 'F_ACTION'));
+
+  // +-----------------------------------------------------------------------+
+  // |                                actions                                |
+  // +-----------------------------------------------------------------------+
+  if (!empty($_POST)) 
+  {
+    if (empty($_POST['comments']))
+    {
+      array_push(
+        $page['errors'],
+        l10n('Select at least one comment')
+        );
+    }
+    else
+    {
+      include_once(COA_PATH.'include/functions_comment.inc.php'); // custom functions
+      check_input_parameter('comments', $_POST, true, PATTERN_ID);
+
+      if (isset($_POST['validate_albums'])) 
+      {
+        validate_user_comment_albums($_POST['comments']);
+
+        array_push(
+          $page['infos'], 
+          l10n_dec(
+            '%d user comment validated', '%d user comments validated',
+            count($_POST['comments'])
+            )
+          );
+      }
+
+      if (isset($_POST['reject_albums'])) 
+      {
+        delete_user_comment_albums($_POST['comments']);
+
+        array_push(
+          $page['infos'], 
+          l10n_dec(
+            '%d user comment rejected', '%d user comments rejected',
+            count($_POST['comments'])
+            )
+          );
+      }
+    }
+  }
+
+  // +-----------------------------------------------------------------------+
+  // |                             template init                             |
+  // +-----------------------------------------------------------------------+
+
+  $template->set_filename('comments', dirname(__FILE__) .'/../template/admin_comments.tpl');
+
+  $template->assign(
+    array(
+      'F_ACTION' => get_root_url().'admin.php?page=comments&amp;section=albums'
+      )
+    );
+    
+  if (count($page['infos']) != 0) 
+  {
+    $template->assign('infos', $page['infos']);
+  }
+
+  // +-----------------------------------------------------------------------+
+  // |                           comments display                            |
+  // +-----------------------------------------------------------------------+
+  $list = array();
+
+  $query = '
+SELECT 
+    com.id, 
+    com.category_id, 
+    com.date, 
+    com.author,
+    u.'.$conf['user_fields']['username'].' AS username, 
+    com.content, 
+    cat.name,
+    img.id AS image_id,
+    img.path
+  FROM '.COA_TABLE.' AS com
+    LEFT JOIN '.CATEGORIES_TABLE.' AS cat
+      ON cat.id = com.category_id
+    LEFT JOIN '.USERS_TABLE.' AS u
+      ON u.'.$conf['user_fields']['id'].' = com.author_id
+    LEFT JOIN '.USER_CACHE_CATEGORIES_TABLE.' AS ucc 
+      ON ucc.cat_id = com.category_id AND ucc.user_id = '.$user['id'].'
+    LEFT JOIN '.IMAGES_TABLE.' AS img
+      ON img.id = ucc.user_representative_picture_id
+  WHERE validated = \'false\'
+  ORDER BY com.date DESC
+;';
+  $result = pwg_query($query);
+
+  while ($row = pwg_db_fetch_assoc($result)) 
+  {
+    // author
+    if (empty($row['author_id'])) 
+    {
+      $author_name = $row['author'];
+    } 
+    else 
+    {
+      $author_name = stripslashes($row['username']);
+    }
+    
+    // thumbnail
+    $row['thumb'] = DerivativeImage::thumb_url(
+      array(
+        'id'=>$row['image_id'],
+        'path'=>$row['path'],
+        )
+     );
+
+    // comment content
+    $template->append(
+      'comments', 
+      array(
+        'ID' => $row['id'],
+        'CAT_URL' => PHPWG_ROOT_PATH.'admin.php?page=album-'.$row['category_id'],
+        'CAT_NAME' => trigger_event('render_category_name', $row['name']),
+        'TN_SRC' => $row['thumb'],
+        'AUTHOR' => trigger_event('render_comment_author', $author_name),
+        'DATE' => format_date($row['date'], true),
+        'CONTENT' => trigger_event('render_comment_content', $row['content'], 'album'),
+        )
+      );
+
+    array_push($list, $row['id']);
+  }
+
+  $template->assign('LIST', implode(',', $list));
+
+  // +-----------------------------------------------------------------------+
+  // |                           sending html code                           |
+  // +-----------------------------------------------------------------------+
+
+  $template->assign_var_from_handle('ADMIN_CONTENT', 'comments');
+
+}
+
+?>
Index: /extensions/Comments_on_Albums/branch_20/include/coa_admin_intro.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/include/coa_admin_intro.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/include/coa_admin_intro.php	(revision 19992)
@@ -0,0 +1,59 @@
+<?php
+/* adds info about comments count on main admin page, uses javascript */
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $template;
+
+// comments count
+$query = '
+SELECT COUNT(*)
+  FROM '.COA_TABLE.'
+;';
+list($nb_comments) = pwg_db_fetch_row(pwg_query($query));
+
+$template->assign(
+  'DB_COMMENTS_ALBUMS', 
+  l10n_dec('%d comment', '%d comments', $nb_comments)
+  );
+
+// unvalidated comments
+$query = '
+SELECT COUNT(*)
+  FROM '.COA_TABLE.'
+  WHERE validated=\'false\'
+;';
+list($nb_comments) = pwg_db_fetch_row(pwg_query($query));
+
+if ($nb_comments > 0) 
+{
+  $template->assign(
+    'unvalidated_albums', 
+    array(
+      'URL' => PHPWG_ROOT_PATH.'admin.php?page=comments&amp;section=albums',
+      'INFO' => sprintf(l10n('%d waiting for validation'), $nb_comments)
+      )
+    );
+}
+
+$template->set_prefilter('intro', 'coa_admin_intro_prefilter');
+
+function coa_admin_intro_prefilter($content, &$smarty)
+{
+  $search = '(<a href="{$unvalidated.URL}">{$unvalidated.INFO}</a>)';
+        
+  $replace = $search.'
+        {/if}
+        [{\'Photos\'|@translate}]
+      </li>
+      <li>
+        {$DB_COMMENTS_ALBUMS}
+        {if isset($unvalidated_albums)}
+        (<a href="{$unvalidated_albums.URL}">{$unvalidated_albums.INFO}</a>)
+        {/if}
+        [{\'Albums\'|@translate}]
+      {if true}';
+
+  return str_replace($search, $replace, $content);
+}
+
+?>
Index: /extensions/Comments_on_Albums/branch_20/include/coa_albums.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/include/coa_albums.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/include/coa_albums.php	(revision 19992)
@@ -0,0 +1,365 @@
+<?php
+/* Code adapted from include/picture_comment.inc.php and picture.php */
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// +-----------------------------------------------------------------------+
+// |                            category infos                             |
+// +-----------------------------------------------------------------------+
+$category = $page['category'];
+
+$url_self = duplicate_index_url(array(
+  'category' => array(
+    'id' => $category['id'], 
+    'name' => $category['name'], 
+    'permalink' => $category['permalink']
+    ), 
+  array('start')
+  ));
+
+
+// +-----------------------------------------------------------------------+
+// |                                actions                                |
+// +-----------------------------------------------------------------------+
+if (isset($_GET['action'])) 
+{
+  switch ($_GET['action']) 
+  {
+    case 'edit_comment' : 
+    {
+      include_once(COA_PATH.'include/functions_comment.inc.php'); // custom fonctions
+      check_input_parameter('comment_to_edit', $_GET, false, PATTERN_ID);
+      $author_id = get_comment_author_id_albums($_GET['comment_to_edit']);
+
+      if (can_manage_comment('edit', $author_id)) 
+      {
+        if (!empty($_POST['content'])) 
+        {
+          check_pwg_token();
+          $comment_action = update_user_comment_albums(
+            array(
+              'comment_id' => $_GET['comment_to_edit'],
+              'category_id' => $category['id'],
+              'content' => $_POST['content']
+              ),
+            $_POST['key']
+            );
+          
+          $perform_redirect = false;
+          switch ($comment_action)
+          {
+            case 'moderate':
+              $_SESSION['page_infos'][] = l10n('An administrator must authorize your comment before it is visible.');
+            case 'validate':
+              $_SESSION['page_infos'][] = l10n('Your comment has been registered');
+              $perform_redirect = true;
+              break;
+            case 'reject':
+              $_SESSION['page_errors'][] = l10n('Your comment has NOT been registered because it did not pass the validation rules');
+              $perform_redirect = true;
+              break;
+            default:
+              trigger_error('Invalid comment action '.$comment_action, E_USER_WARNING);
+          }
+
+          if ($perform_redirect)
+          {
+            redirect($url_self);
+          }
+          unset($_POST['content']);
+        } 
+        else 
+        {
+          $edit_comment = $_GET['comment_to_edit'];
+        }
+        break;
+      }
+    }
+    case 'delete_comment' : 
+    {
+      check_pwg_token();
+      
+      include_once(COA_PATH.'include/functions_comment.inc.php'); // custom fonctions
+      
+      check_input_parameter('comment_to_delete', $_GET, false, PATTERN_ID);
+      
+      $author_id = get_comment_author_id_albums($_GET['comment_to_delete']);
+
+      if (can_manage_comment('delete', $author_id)) 
+      {
+        delete_user_comment_albums($_GET['comment_to_delete']);
+      }
+
+      redirect($url_self);
+    }
+    case 'validate_comment' : 
+    {
+      check_pwg_token();
+      
+      include_once(COA_PATH.'include/functions_comment.inc.php'); // custom fonctions
+      
+      check_input_parameter('comment_to_validate', $_GET, false, PATTERN_ID);
+      
+      $author_id = get_comment_author_id_albums($_GET['comment_to_validate']);
+
+      if (can_manage_comment('validate', $author_id)) 
+      {
+        validate_user_comment_albums($_GET['comment_to_validate']);
+      }
+
+      redirect($url_self);
+    }
+  }
+}
+
+
+// +-----------------------------------------------------------------------+
+// |                            insert comment                             |
+// +-----------------------------------------------------------------------+
+if ($category['commentable'] and isset($_POST['content'])) 
+{
+  if (is_a_guest() and !$conf['comments_forall']) 
+  {
+    die('Session expired');
+  }
+
+  $comm = array(
+    'author' => trim( @$_POST['author'] ),
+    'content' => trim( $_POST['content'] ),
+    'category_id' => $category['id'],
+  );
+
+  include_once(COA_PATH.'include/functions_comment.inc.php'); // custom fonctions
+  
+  $comment_action = insert_user_comment_albums($comm, @$_POST['key'], $page['infos']);
+
+  switch ($comment_action) 
+  {
+    case 'moderate':
+      array_push($page['infos'], l10n('An administrator must authorize your comment before it is visible.'));
+    case 'validate':
+      array_push($page['infos'], l10n('Your comment has been registered'));
+      break;
+    case 'reject':
+      set_status_header(403);
+      array_push($page['errors'], l10n('Your comment has NOT been registered because it did not pass the validation rules'));
+      break;
+    default:
+      trigger_error('Invalid comment action '.$comment_action, E_USER_WARNING);
+  }
+    
+  // allow plugins to notify what's going on
+  trigger_action( 'user_comment_insertion',
+      array_merge($comm, array('action'=>$comment_action) )
+    );
+    
+  $template->assign('DISPLAY_COMMENTS_BLOCK', true);
+} 
+else if (isset($_POST['content'])) 
+{
+  set_status_header(403);
+  die('ugly spammer');
+}
+
+
+// +-----------------------------------------------------------------------+
+// |                           display comments                            |
+// +-----------------------------------------------------------------------+
+if ($category['commentable']) 
+{
+  if (!is_admin()) 
+  {
+    $validated_clause = " AND validated = 'true'";
+  } 
+  else 
+  {
+    $validated_clause = null;
+  }
+
+  // number of comments for this category
+  $query = '
+SELECT 
+    COUNT(*) AS nb_comments
+  FROM '.COA_TABLE.'
+  WHERE category_id = '.$category['id']
+  .$validated_clause.'
+;';
+  $row = pwg_db_fetch_assoc(pwg_query($query));
+
+  // navigation bar creation, can't use $_GET['start'] because used by thumbnails navigation bar
+  if (isset($_GET['start_comments'])) 
+  {
+    $page['start_comments'] = $_GET['start_comments'];
+  } 
+  else 
+  {
+    $page['start_comments'] = 0;
+  }
+  include_once(COA_PATH.'include/functions.inc.php'); // custom fonctions
+
+  $navigation_bar = create_comment_navigation_bar(
+    duplicate_index_url(array(), array('start')),
+    $row['nb_comments'],
+    $page['start_comments'],
+    $conf['nb_comment_page']
+    );
+
+  $template->assign(
+    array(
+      'COMMENT_COUNT' => $row['nb_comments'],
+      'comment_navbar' => $navigation_bar,
+      )
+    );
+
+  if ($row['nb_comments'] > 0) 
+  {
+    // comments order (get, session, conf)
+    if (!empty($_GET['comments_order']) && in_array(strtoupper($_GET['comments_order']), array('ASC', 'DESC')))
+    {
+      pwg_set_session_var('comments_order', $_GET['comments_order']);
+    }
+    $comments_order = pwg_get_session_var('comments_order', $conf['comments_order']);
+
+    $template->assign(array(
+      'COMMENTS_ORDER_URL' => add_url_params( duplicate_index_url(), array('comments_order'=> ($comments_order == 'ASC' ? 'DESC' : 'ASC') ) ),
+      'COMMENTS_ORDER_TITLE' => $comments_order == 'ASC' ? l10n('Show latest comments first') : l10n('Show oldest comments first'),
+      ));
+      
+    // get comments
+    $query = '
+SELECT
+    com.id,
+    com.author,
+    com.author_id,
+    '.$conf['user_fields']['username'].' AS username,
+    com.date,
+    com.category_id,
+    com.content,
+    com.validated
+  FROM '.COA_TABLE.' AS com
+  LEFT JOIN '.USERS_TABLE.' AS u
+    ON u.'.$conf['user_fields']['id'].' = author_id
+  WHERE category_id = '.$category['id'].'
+    '.$validated_clause.'
+  ORDER BY date '.$comments_order.'
+  LIMIT '.$conf['nb_comment_page'].' OFFSET '.$page['start_comments'].'
+;';
+    $result = pwg_query($query);
+
+    while ($row = pwg_db_fetch_assoc($result)) 
+    {
+      // author
+      if (!empty($row['author'])) 
+      {
+        $author = $row['author'];
+        if ($author == 'guest') 
+        {
+          $author = l10n('guest');
+        }
+      } 
+      else 
+      {
+        $author = stripslashes($row['username']);
+      }
+      
+      // comment content
+      $tpl_comment = array(
+        'ID' => $row['id'],
+        'AUTHOR' => trigger_event('render_comment_author', $author),
+        'DATE' => format_date($row['date'], true),
+        'CONTENT' => trigger_event('render_comment_content', $row['content'], 'album'),
+        );
+      
+      // rights
+      if (can_manage_comment('delete', $row['author_id'])) 
+      {
+        $tpl_comment['U_DELETE'] = add_url_params(
+          $url_self, 
+          array(
+            'action' => 'delete_comment',
+            'comment_to_delete' => $row['id'],
+            'pwg_token' => get_pwg_token(),
+            )
+          );
+      }
+      if (can_manage_comment('edit', $row['author_id'])) 
+      {
+        $tpl_comment['U_EDIT'] = add_url_params(
+          $url_self, 
+          array(
+            'action' => 'edit_comment',
+            'comment_to_edit' => $row['id'],
+            )
+          );
+        if (isset($edit_comment) and ($row['id'] == $edit_comment)) 
+        {
+          $tpl_comment['IN_EDIT'] = true;
+          $key = get_ephemeral_key(2, $category['id']);
+          $tpl_comment['KEY'] = $key;
+          $tpl_comment['CONTENT'] = $row['content'];
+          $tpl_comment['PWG_TOKEN'] = get_pwg_token();
+        }
+      }
+      if (is_admin() AND $row['validated'] != 'true') 
+      {
+        $tpl_comment['U_VALIDATE'] = add_url_params(
+          $url_self, 
+          array(
+            'action' => 'validate_comment',
+            'comment_to_validate' => $row['id'],
+            'pwg_token' => get_pwg_token(),
+            )
+          );
+      }
+      
+      $template->append('comments', $tpl_comment);
+    }
+  }
+
+  // comment form
+  $show_add_comment_form = true;
+  if (isset($edit_comment)) 
+  {
+    $show_add_comment_form = false;
+  }
+  if (is_a_guest() and !$conf['comments_forall']) 
+  {
+    $show_add_comment_form = false;
+  }
+
+  if ($show_add_comment_form) 
+  {
+    $key = get_ephemeral_key(3, $category['id']);
+    $content = null;
+    if ('reject'===@$comment_action) 
+    {
+      $content = htmlspecialchars(stripslashes($comm['content']));
+    }
+    $template->assign('comment_add', 
+      array(
+        'F_ACTION' => $url_self,
+        'KEY' => $key,
+        'CONTENT' => $content,
+        'SHOW_AUTHOR' => !is_classic_user(),
+        )
+      );
+  }
+  
+  // template
+  $template->assign(array(
+    'COA_PATH' => COA_PATH, // for css
+    'COA_ABSOLUTE_PATH' => dirname(__FILE__) .'/../', // for template
+    ));
+  
+  $template->set_filename('comments_on_albums', dirname(__FILE__) .'/../template/albums.tpl');
+  if (isset($pwg_loaded_plugins['rv_tscroller']) AND count($page['navigation_bar']) != 0)
+  {
+    $template->assign('COMMENTS_ON_TOP', true);
+    $template->concat('PLUGIN_INDEX_CONTENT_BEGIN', $template->parse('comments_on_albums', true));
+  }
+  else
+  {
+    $template->concat('PLUGIN_INDEX_CONTENT_END', $template->parse('comments_on_albums', true));
+  }
+}
+
+?>
Index: /extensions/Comments_on_Albums/branch_20/include/coa_comments_page.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/include/coa_comments_page.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/include/coa_comments_page.php	(revision 19992)
@@ -0,0 +1,323 @@
+<?php 
+/* inspired by comments.php */
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+load_language('plugin.lang', COA_PATH);
+
+// +-----------------------------------------------------------------------+
+// |                             main page                                 |
+// +-----------------------------------------------------------------------+
+
+if ( !isset($_GET['display_mode']) or $_GET['display_mode'] != 'albums' ) 
+{  
+  // adds a button for switch page
+  $template->set_prefilter('comments', 'coa_add_button');
+  
+  function coa_add_button($content, &$smarty) 
+  {    
+    $search ='<form class="filter" action="{$F_ACTION}" method="get">';
+    $replacement = '
+<form class="filter">
+<fieldset>
+  <legend>{\'Display comments on\'|@translate}</legend>
+  <span style="font-size:1.1em;"><a href="#" style="font-weight:bold;">{\'Photos\'|@translate}</a> | <a href="comments.php?display_mode=albums">{\'Albums\'|@translate}</a></span>
+</fieldset>
+</form>';
+
+    return str_replace($search, $replacement.$search, $content);
+  }
+  
+  
+// +-----------------------------------------------------------------------+
+//                        comments on albums page                          |
+// +-----------------------------------------------------------------------+
+
+} 
+else if ($_GET['display_mode'] == 'albums') 
+{
+  include_once(COA_PATH.'include/functions_comment.inc.php'); // custom functions
+  
+  // reset some template vars
+  $template->clear_assign(array('comments', 'navbar', 'sort_by_options'));
+  
+  // sort_by : database fields proposed for sorting comments list
+  $sort_by = array(
+    'date' => l10n('comment date'),
+    'category_id' => l10n('album')
+    );
+  $template->assign('sort_by_options', $sort_by);
+
+  // +-----------------------------------------------------------------------+
+  // |                         comments management                           |
+  // +-----------------------------------------------------------------------+
+  $comment_id = null;
+  $action = null;
+
+  $actions = array('delete_albums', 'validate_albums', 'edit_albums'); // different indexes to not interfer with the main process
+  foreach ($actions as $loop_action) 
+  {
+    if (isset($_GET[$loop_action])) 
+    {
+      $action = $loop_action;
+      check_input_parameter($action, $_GET, false, PATTERN_ID);
+      $comment_id = $_GET[$action];
+      break;
+    }
+  }
+
+  if (isset($action)) 
+  {
+    $comment_author_id = get_comment_author_id_albums($comment_id);
+    
+    if (can_manage_comment(str_replace('_albums', null, $action), $comment_author_id)) 
+    {
+      $perform_redirect = false;
+
+      if ('delete_albums' == $action) 
+      {
+        check_pwg_token();
+        delete_user_comment_albums($comment_id);
+        $perform_redirect = true;
+      }
+      if ('validate_albums' == $action) 
+      {
+        check_pwg_token();
+        validate_user_comment_albums($comment_id);
+        $perform_redirect = true;
+      }
+      if ('edit_albums' == $action) 
+      {
+        if (!empty($_POST['content'])) 
+        {
+          check_pwg_token();
+          update_user_comment_albums(
+            array(
+              'comment_id' => $_GET['edit_albums'],
+              'category_id' => $_POST['image_id'],
+              'content' => $_POST['content']
+              ), 
+            $_POST['key']
+            );
+          
+          $perform_redirect = true;
+        } 
+        else 
+        {
+          $edit_comment = $_GET['edit_albums'];
+        }
+      }
+      if ($perform_redirect) 
+      {
+        $redirect_url = 
+          PHPWG_ROOT_PATH
+          .'comments.php'
+          .get_query_string_diff(array('delete_albums','validate_albums','edit_albums','pwg_token'));
+        
+        redirect($redirect_url);
+      }
+    }
+  }
+
+  // +-----------------------------------------------------------------------+
+  // |                            navigation bar                             |
+  // +-----------------------------------------------------------------------+
+  if (isset($_GET['start']) and is_numeric($_GET['start'])) 
+  {
+    $start = $_GET['start'];
+  } 
+  else 
+  {
+    $start = 0;
+  }
+
+  $query = '
+SELECT COUNT(DISTINCT(com.id))
+  FROM '.COA_TABLE.' AS com
+  LEFT JOIN '.USERS_TABLE.' As u
+    ON u.'.$conf['user_fields']['id'].' = com.author_id
+  WHERE '.implode('
+    AND ', $page['where_clauses']).'
+;';
+  list($counter) = pwg_db_fetch_row(pwg_query($query));
+
+  $url = PHPWG_ROOT_PATH
+      .'comments.php'
+    .get_query_string_diff(array('start','delete_albums','validate_albums','edit_albums','pwg_token'));
+    
+  $navbar = create_navigation_bar(
+    $url, 
+    $counter, 
+    $start, 
+    $page['items_number'], 
+    ''
+    );
+  
+  $template->assign('navbar', $navbar);
+
+  // +-----------------------------------------------------------------------+
+  // |                        last comments display                          |
+  // +-----------------------------------------------------------------------+
+  $comments = array();
+  $element_ids = array();
+  $category_ids = array();
+
+  $query = '
+SELECT
+    com.id AS comment_id,
+    com.category_id,
+    com.author,
+    com.author_id,
+    '.$conf['user_fields']['username'].' AS username,
+    com.date,
+    com.content,
+    com.validated
+  FROM '.COA_TABLE.' AS com
+    LEFT JOIN '.USERS_TABLE.' As u
+      ON u.'.$conf['user_fields']['id'].' = com.author_id
+  WHERE '.implode('
+    AND ', $page['where_clauses']).'
+  GROUP BY
+    comment_id,
+    com.category_id,
+    com.author,
+    com.author_id,
+    com.date,
+    com.content,
+    com.validated
+  ORDER BY '.$page['sort_by'].' '.$page['sort_order'];
+if ('all' != $page['items_number']) 
+{
+  $query.= '
+  LIMIT '.$page['items_number'].' OFFSET '.$start;
+}
+$query.= '
+;';
+  $result = pwg_query($query);
+
+  while ($row = pwg_db_fetch_assoc($result)) 
+  {
+    array_push($comments, $row);
+    array_push($element_ids, $row['category_id']);
+  }
+
+  if (count($comments) > 0) 
+  {
+    // retrieving category informations
+    $query = '
+SELECT 
+    cat.id, 
+    cat.name, 
+    cat.permalink, 
+    cat.uppercats, 
+    com.id as comment_id,
+    img.id AS image_id,
+    img.path
+  FROM '.CATEGORIES_TABLE.' AS cat
+    LEFT JOIN '.COA_TABLE.' AS com
+      ON com.category_id = cat.id
+    LEFT JOIN '.USER_CACHE_CATEGORIES_TABLE.' AS ucc 
+      ON ucc.cat_id = cat.id AND ucc.user_id = '.$user['id'].'
+    LEFT JOIN '.IMAGES_TABLE.' AS img
+      ON img.id = ucc.user_representative_picture_id
+  '.get_sql_condition_FandF(
+    array(
+      'forbidden_categories' => 'cat.id',
+      'visible_categories' => 'cat.id'
+      ), 
+    'WHERE'
+    ).'
+    AND cat.id IN ('.implode(',', $element_ids).')
+;';
+    $categories = hash_from_query($query, 'comment_id');
+
+    foreach ($comments as $comment) 
+    {
+      // source of the thumbnail picture
+      $comment['src_image'] = new SrcImage($categories[$comment['comment_id']]);
+    
+      // category url
+      $comment['cat_url'] = duplicate_index_url(
+        array(
+          'category' => array(
+            'id' => $categories[$comment['comment_id']]['id'], 
+            'name' => $categories[$comment['comment_id']]['name'], 
+            'permalink' => $categories[$comment['comment_id']]['permalink'],
+            ),
+          array('start')
+          )
+        );
+      
+      // comment content
+      $tpl_comment = array(
+        'ID' => $comment['comment_id'],
+        'U_PICTURE' => $comment['cat_url'],
+        'ALT' => trigger_event('render_category_name', $categories[$comment['comment_id']]['name']),
+        'src_image' => $comment['src_image'],
+        'AUTHOR' => trigger_event('render_comment_author', $comment['author']),
+        'DATE' => format_date($comment['date'], true),
+        'CONTENT' => trigger_event('render_comment_content', $comment['content'], 'album'),
+        );
+
+      // rights
+      if (can_manage_comment('delete', $comment['author_id'])) 
+      {
+        $tpl_comment['U_DELETE'] = add_url_params(
+          $url, 
+          array(
+            'delete_albums' => $comment['comment_id'],
+            'pwg_token' => get_pwg_token(),
+            )
+          );
+      }
+      if (can_manage_comment('edit', $comment['author_id'])) 
+      {
+        $tpl_comment['U_EDIT'] = add_url_params(
+          $url, 
+          array(
+            'edit_albums' => $comment['comment_id'],
+            )
+          );
+
+        if (isset($edit_comment) and ($comment['comment_id'] == $edit_comment)) 
+        {
+          $tpl_comment['IN_EDIT'] = true;
+          $key = get_ephemeral_key(2, $comment['category_id']);
+          $tpl_comment['KEY'] = $key;
+          $tpl_comment['IMAGE_ID'] = $comment['category_id'];
+          $tpl_comment['CONTENT'] = $comment['content'];
+          $tpl_comment['PWG_TOKEN'] = get_pwg_token();
+        }
+      }
+      if (can_manage_comment('validate', $comment['author_id'])) 
+      {
+        if ('true' != $comment['validated']) 
+        {
+          $tpl_comment['U_VALIDATE'] = add_url_params(
+            $url, 
+            array(
+              'validate_albums'=> $comment['comment_id'],
+              'pwg_token' => get_pwg_token(),
+              )
+            );
+        }
+      }
+      
+      $template->append('comments', $tpl_comment);
+    }
+  }
+
+  // +-----------------------------------------------------------------------+
+  // |                            template                                   |
+  // +-----------------------------------------------------------------------+
+  $template->set_filenames(array('comments'=> dirname(__FILE__).'/../template/comments_page.tpl'));
+  
+  // add a line to display category name
+  $template->set_prefilter('comments', 'coa_change_comments_list');
+  
+  function coa_change_comments_list($content, &$smarty) {
+    $search = '<img src="{$pwg->derivative_url($derivative_params, $comment.src_image)}" alt="{$comment.ALT}">';
+    $replacement = $search.'<br/>{$comment.ALT}';
+    return str_replace($search, $replacement, $content);
+  }
+}
+
+?>
Index: /extensions/Comments_on_Albums/branch_20/include/functions.inc.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/include/functions.inc.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/include/functions.inc.php	(revision 19992)
@@ -0,0 +1,59 @@
+<?php
+/* This is from include/functions.inc.php but adapted for Comments On Albums */
+
+/**
+ * return an array which will be sent to template to display navigation bar
+ */
+function create_comment_navigation_bar($url, $nb_element, $start, $nb_element_page)
+{
+  global $conf;
+
+  $navbar = array();
+  $pages_around = $conf['paginate_pages_around'];
+  $start_str = (strpos($url, '?')===false ? '?':'&amp;').'start_comments=';
+
+  if (!isset($start) or !is_numeric($start) or (is_numeric($start) and $start < 0))
+  {
+    $start = 0;
+  }
+
+  // navigation bar useful only if more than one page to display !
+  if ($nb_element > $nb_element_page)
+  {
+    $cur_page = ceil($start / $nb_element_page) + 1;
+    $maximum = ceil($nb_element / $nb_element_page);
+    $previous = $start - $nb_element_page;
+    $next = $start + $nb_element_page;
+    $last = ($maximum - 1) * $nb_element_page;
+
+    $navbar['CURRENT_PAGE'] = $cur_page;
+
+    // link to first page and previous page?
+    if ($cur_page != 1)
+    {
+      $navbar['URL_FIRST'] = $url;
+      $navbar['URL_PREV'] = $url.($previous > 0 ? $start_str.$previous : '');
+    }
+    // link on next page and last page?
+    if ($cur_page != $maximum)
+    {
+      $navbar['URL_NEXT'] = $url.$start_str.$next;
+      $navbar['URL_LAST'] = $url.$start_str.$last;
+    }
+
+    // pages to display
+    $navbar['pages'] = array();
+    $navbar['pages'][1] = $url;
+    $navbar['pages'][$maximum] = $url.$start_str.$last;
+
+    for ($i = max($cur_page - $pages_around , 2), $stop = min($cur_page + $pages_around + 1, $maximum);
+         $i < $stop; $i++)
+    {
+      $navbar['pages'][$i] = $url.$start_str.(($i - 1) * $nb_element_page);
+    }
+    ksort($navbar['pages']);
+  }
+  return $navbar;
+}
+
+?>
Index: /extensions/Comments_on_Albums/branch_20/include/functions_comment.inc.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/include/functions_comment.inc.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/include/functions_comment.inc.php	(revision 19992)
@@ -0,0 +1,342 @@
+<?php
+/* This is a copy of include/functions_comment.inc.php but adapted for Comments On Albums */
+
+include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php');
+add_event_handler('user_comment_check_albums', 'user_comment_check',
+  EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
+
+/**
+ * Tries to insert a user comment in the database and returns one of :
+ * validate, moderate, reject
+ * @param array comm contains author, content, category_id
+ * @param string key secret key sent back to the browser
+ * @param array infos out array of messages
+ */
+function insert_user_comment_albums( &$comm, $key, &$infos )
+{
+  global $conf, $user;
+
+  $comm = array_merge( $comm,
+    array(
+      'ip' => $_SERVER['REMOTE_ADDR'],
+      'agent' => $_SERVER['HTTP_USER_AGENT']
+    )
+   );
+
+  $infos = array();
+  if (!$conf['comments_validation'] or is_admin())
+  {
+    $comment_action='validate'; //one of validate, moderate, reject
+  }
+  else
+  {
+    $comment_action='moderate'; //one of validate, moderate, reject
+  }
+
+  // display author field if the user status is guest or generic
+  if (!is_classic_user())
+  {
+    if ( empty($comm['author']) )
+    {
+      $comm['author'] = 'guest';
+    }
+    $comm['author_id'] = $conf['guest_id'];
+    // if a guest try to use the name of an already existing user, he must be
+    // rejected
+    if ( $comm['author'] != 'guest' )
+    {
+      $query = '
+SELECT COUNT(*) AS user_exists
+  FROM '.USERS_TABLE.'
+  WHERE '.$conf['user_fields']['username']." = '".addslashes($comm['author'])."'";
+      $row = pwg_db_fetch_assoc( pwg_query( $query ) );
+      if ( $row['user_exists'] == 1 )
+      {
+        array_push($infos, l10n('This login is already used by another user') );
+        $comment_action='reject';
+      }
+    }
+  }
+  else
+  {
+    $comm['author'] = addslashes($user['username']);
+    $comm['author_id'] = $user['id'];
+  }
+
+  if ( empty($comm['content']) )
+  { // empty comment content
+    $comment_action='reject';
+  }
+
+  if ( !verify_ephemeral_key(@$key, $comm['category_id']) )
+  {
+    $comment_action='reject';
+    $_POST['cr'][] = 'key';
+  }
+  
+  // anonymous id = ip address
+  $ip_components = explode('.', $comm['ip']);
+  if (count($ip_components) > 3)
+  {
+    array_pop($ip_components);
+  }
+  $comm['anonymous_id'] = implode('.', $ip_components);
+
+  if ($comment_action!='reject' and $conf['anti-flood_time']>0 and !is_admin())
+  { // anti-flood system
+    $reference_date = pwg_db_get_flood_period_expression($conf['anti-flood_time']);
+
+    $query = '
+SELECT count(1) FROM '.COA_TABLE.'
+  WHERE date > '.$reference_date.'
+    AND author_id = '.$comm['author_id'];
+    if (!is_classic_user())
+    {
+      $query.= '
+      AND anonymous_id = "'.$comm['anonymous_id'].'"';
+    }
+    $query.= '
+;';
+
+    list($counter) = pwg_db_fetch_row(pwg_query($query));
+    if ( $counter > 0 )
+    {
+      array_push( $infos, l10n('Anti-flood system : please wait for a moment before trying to post another comment') );
+      $comment_action='reject';
+    }
+  }
+
+  // perform more spam check
+  $comment_action = trigger_event('user_comment_check_albums',
+      $comment_action, $comm
+    );
+
+  if ( $comment_action!='reject' )
+  {
+    $query = '
+INSERT INTO '.COA_TABLE.'
+  (author, author_id, content, date, validated, validation_date, category_id)
+  VALUES (
+    \''.$comm['author'].'\',
+    '.$comm['author_id'].',
+    \''.$comm['content'].'\',
+    NOW(),
+    \''.($comment_action=='validate' ? 'true':'false').'\',
+    '.($comment_action=='validate' ? 'NOW()':'NULL').',
+    '.$comm['category_id'].'
+  )
+';
+
+    pwg_query($query);
+
+    $comm['id'] = pwg_db_insert_id(COA_TABLE);
+
+    if ( ($conf['email_admin_on_comment'] && 'validate' == $comment_action)
+        or ($conf['email_admin_on_comment_validation'] and 'moderate' == $comment_action))
+    {
+      include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
+
+      $comment_url = get_absolute_root_url().'comments.php?display_mode=albums&comment_id='.$comm['id'];
+
+      $keyargs_content = array
+      (
+        get_l10n_args('Author: %s', stripslashes($comm['author']) ),
+        get_l10n_args('Comment: %s', stripslashes($comm['content']) ),
+        get_l10n_args('', ''),
+        get_l10n_args('Manage this user comment: %s', $comment_url)
+      );
+
+      if ('moderate' == $comment_action)
+      {
+        $keyargs_content[] = get_l10n_args('', '');
+        $keyargs_content[] = get_l10n_args('(!) This comment requires validation', '');
+      }
+
+      pwg_mail_notification_admins
+      (
+        get_l10n_args('Comment by %s', stripslashes($comm['author']) ),
+        $keyargs_content
+      );
+    }
+  }
+  return $comment_action;
+}
+
+/**
+ * Tries to delete a user comment in the database
+ * only admin can delete all comments
+ * other users can delete their own comments
+ * so to avoid a new sql request we add author in where clause
+ *
+ * @param comment_id
+ */
+function delete_user_comment_albums($comment_id) 
+{
+  $user_where_clause = '';
+  if (!is_admin())
+  {
+    $user_where_clause = '   AND author_id = \''.$GLOBALS['user']['id'].'\'';
+  }
+  
+  if (is_array($comment_id))
+    $where_clause = 'id IN('.implode(',', $comment_id).')';
+  else
+    $where_clause = 'id = '.$comment_id;
+  
+  $query = '
+DELETE FROM '.COA_TABLE.'
+  WHERE '.$where_clause.
+$user_where_clause.'
+;';
+  $result = pwg_query($query);
+  
+  if ($result) 
+  {
+    email_admin('delete', 
+                array('author' => $GLOBALS['user']['username'],
+                      'comment_id' => $comment_id
+                  ));
+  }
+  
+  trigger_action('user_comment_deletion', $comment_id, 'category');
+}
+
+/**
+ * Tries to update a user comment in the database
+ * only admin can update all comments
+ * users can edit their own comments if admin allow them
+ * so to avoid a new sql request we add author in where clause
+ *
+ * @param comment_id
+ * @param post_key
+ * @param content
+ */
+function update_user_comment_albums($comment, $post_key)
+{
+  global $conf;
+
+  $comment_action = 'validate';
+
+  if ( !verify_ephemeral_key($post_key, $comment['category_id']) )
+  {
+    $comment_action='reject';
+  }
+  elseif (!$conf['comments_validation'] or is_admin()) // should the updated comment must be validated
+  {
+    $comment_action='validate'; //one of validate, moderate, reject
+  }
+  else
+  {
+    $comment_action='moderate'; //one of validate, moderate, reject
+  }
+
+  // perform more spam check
+  $comment_action =
+    trigger_event('user_comment_check_albums',
+      $comment_action,
+      array_merge($comment,
+            array('author' => $GLOBALS['user']['username'])
+            )
+      );
+
+  if ( $comment_action!='reject' )
+  {
+    $user_where_clause = '';
+    if (!is_admin())
+    {
+      $user_where_clause = '   AND author_id = \''.
+  $GLOBALS['user']['id'].'\'';
+    }
+
+    $query = '
+UPDATE '.COA_TABLE.'
+  SET content = \''.$comment['content'].'\',
+      validated = \''.($comment_action=='validate' ? 'true':'false').'\',
+      validation_date = '.($comment_action=='validate' ? 'NOW()':'NULL').'
+  WHERE id = '.$comment['comment_id'].
+$user_where_clause.'
+;';
+    $result = pwg_query($query);
+    
+    // mail admin and ask to validate the comment
+    if ($result and $conf['email_admin_on_comment_validation'] and 'moderate' == $comment_action) 
+    {
+      include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
+
+      $comment_url = get_absolute_root_url().'comments.php?display_mode=albums&amp;comment_id='.$comment['comment_id'];
+
+      $keyargs_content = array
+      (
+        get_l10n_args('Author: %s', stripslashes($GLOBALS['user']['username']) ),
+        get_l10n_args('Comment: %s', stripslashes($comment['content']) ),
+        get_l10n_args('', ''),
+        get_l10n_args('Manage this user comment: %s', $comment_url),
+        get_l10n_args('', ''),
+        get_l10n_args('(!) This comment requires validation', ''),
+      );
+
+      pwg_mail_notification_admins
+      (
+        get_l10n_args('Comment by %s', stripslashes($GLOBALS['user']['username']) ),
+        $keyargs_content
+      );
+    }
+    // just mail admin
+    else if ($result)
+    {
+      email_admin('edit', array('author' => $GLOBALS['user']['username'],
+        'content' => stripslashes($comment['content'])) );
+    }
+  }
+  
+  return $comment_action;
+}
+
+function get_comment_author_id_albums($comment_id, $die_on_error=true)
+{
+  $query = '
+SELECT
+    author_id
+  FROM '.COA_TABLE.'
+  WHERE id = '.$comment_id.'
+;';
+  $result = pwg_query($query);
+  if (pwg_db_num_rows($result) == 0)
+  {
+    if ($die_on_error)
+    {
+      fatal_error('Unknown comment identifier');
+    }
+    else
+    {
+      return false;
+    }
+  }
+  
+  list($author_id) = pwg_db_fetch_row($result);
+
+  return $author_id;
+}
+
+/**
+ * Tries to validate a user comment in the database
+ * @param int or array of int comment_id
+ */
+function validate_user_comment_albums($comment_id)
+{
+  if (is_array($comment_id))
+    $where_clause = 'id IN('.implode(',', $comment_id).')';
+  else
+    $where_clause = 'id = '.$comment_id;
+    
+  $query = '
+UPDATE '.COA_TABLE.'
+  SET validated = \'true\'
+    , validation_date = NOW()
+  WHERE '.$where_clause.'
+;';
+  pwg_query($query);
+  
+  trigger_action('user_comment_validation', $comment_id, 'category');
+}
+?>
Index: /extensions/Comments_on_Albums/branch_20/include/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/include/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/include/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/ca_ES/description.txt
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/ca_ES/description.txt	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/ca_ES/description.txt	(revision 19992)
@@ -0,0 +1,1 @@
+Permet activar els comentaris a les pàgines dels àlbums
Index: /extensions/Comments_on_Albums/branch_20/language/ca_ES/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/ca_ES/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/ca_ES/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/ca_ES/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/ca_ES/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/ca_ES/plugin.lang.php	(revision 19992)
@@ -0,0 +1,28 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['Comments on albums'] = 'Comentaris dels àlbums';
+$lang['Comments on photos'] = 'Comentaris de les imatges';
+$lang['Display comments on'] = 'Mostrar comentaris a';
+$lang['Display last posted comments on albums'] = 'Mostrar els últims comentaris publicats als àlbums';
+$lang['Last comments on albums'] = 'Últims comentaris als àlbums';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/cs_CZ/description.txt
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/cs_CZ/description.txt	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/cs_CZ/description.txt	(revision 19992)
@@ -0,0 +1,1 @@
+Aktivuje možnost komentářů na stránkách fotoalb
Index: /extensions/Comments_on_Albums/branch_20/language/cs_CZ/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/cs_CZ/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/cs_CZ/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/cs_CZ/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/cs_CZ/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/cs_CZ/plugin.lang.php	(revision 19992)
@@ -0,0 +1,8 @@
+<?php
+
+$lang['Comments on photos'] = 'Komentáře fotografií';
+$lang['Comments on albums'] = 'Komentáře alb';
+$lang['Display last posted comments on albums'] = 'Zobraz poslední vytvořené komentáře alba';
+$lang['Last comments on albums'] = 'Poslední komentáře alba';
+$lang['Display comments on'] = 'Zobrazit komentáře';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/da_DK/description.txt
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/da_DK/description.txt	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/da_DK/description.txt	(revision 19992)
@@ -0,0 +1,1 @@
+Aktivér kommentarer på albumsider.
Index: /extensions/Comments_on_Albums/branch_20/language/da_DK/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/da_DK/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/da_DK/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/da_DK/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/da_DK/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/da_DK/plugin.lang.php	(revision 19992)
@@ -0,0 +1,28 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['Comments on albums'] = 'Kommentarer til albummer';
+$lang['Comments on photos'] = 'Kommentarer til fotografier';
+$lang['Display comments on'] = 'Vis kommentarer til';
+$lang['Display last posted comments on albums'] = 'Vis seneste tilføjede kommentarer til albummer';
+$lang['Last comments on albums'] = 'Seneste kommentarer til albummer';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/de_DE/description.txt
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/de_DE/description.txt	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/de_DE/description.txt	(revision 19992)
@@ -0,0 +1,1 @@
+Aktiviert die Kommentare auf der Albumseite.
Index: /extensions/Comments_on_Albums/branch_20/language/de_DE/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/de_DE/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/de_DE/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/de_DE/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/de_DE/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/de_DE/plugin.lang.php	(revision 19992)
@@ -0,0 +1,8 @@
+<?php
+
+$lang['Comments on photos'] = 'Kommentare zu Fotos';
+$lang['Comments on albums'] = 'Kommentare zu Alben';
+$lang['Display last posted comments on albums'] = 'Zeigt den zuletzt geposteten Kommentare zu den Alben an';
+$lang['Last comments on albums'] = 'Letzte Kommentare zu den Alben';
+$lang['Display comments on'] = 'Anzeige von Kommentaren "Ein"';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/el_GR/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/el_GR/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/el_GR/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/el_GR/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/el_GR/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/el_GR/plugin.lang.php	(revision 19992)
@@ -0,0 +1,8 @@
+<?php
+
+$lang['Comments on photos'] = 'Σχόλια σε φωτογραφίες';
+$lang['Comments on albums'] = 'Σχόλια σε άλμπουμς';
+$lang['Display last posted comments on albums'] = 'Εμφάνιση των τελευταίων δημοσιευμένων σχόλιων στα λευκώματα';
+$lang['Last comments on albums'] = 'Τελευταία σχόλια σε λευκώματα';
+$lang['Display comments on'] = 'Εμφάνιση σχολίων σχετικά με';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/en_UK/description.txt
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/en_UK/description.txt	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/en_UK/description.txt	(revision 19992)
@@ -0,0 +1,1 @@
+Activate comments on albums pages
Index: /extensions/Comments_on_Albums/branch_20/language/en_UK/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/en_UK/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/en_UK/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/en_UK/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/en_UK/plugin.lang.php	(revision 19992)
@@ -0,0 +1,9 @@
+<?php
+
+$lang['Comments on photos'] = 'Comments on photos';
+$lang['Comments on albums'] = 'Comments on albums';
+$lang['Display comments on'] = 'Display comments on';
+$lang['Last comments on albums'] = 'Last comments on albums';
+$lang['Display last posted comments on albums'] = 'Display last posted comments on albums';
+
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/es_ES/description.txt
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/es_ES/description.txt	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/es_ES/description.txt	(revision 19992)
@@ -0,0 +1,1 @@
+Activa los comentarios en las paginas de los albumes
Index: /extensions/Comments_on_Albums/branch_20/language/es_ES/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/es_ES/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/es_ES/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/es_ES/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/es_ES/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/es_ES/plugin.lang.php	(revision 19992)
@@ -0,0 +1,8 @@
+<?php
+
+$lang['Comments on photos'] = 'Comentarios sobre las fotos';
+$lang['Comments on albums'] = 'Comentarios sobre los albumes';
+$lang['Display last posted comments on albums'] = 'Mostrar los últimos comentarios hechos en álbums.';
+$lang['Last comments on albums'] = 'Últimos comentarios en álbums.';
+$lang['Display comments on'] = 'Mostrar comentarios en';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/fr_FR/description.txt
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/fr_FR/description.txt	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/fr_FR/description.txt	(revision 19992)
@@ -0,0 +1,1 @@
+Active les commentaires sur les pages d'albums
Index: /extensions/Comments_on_Albums/branch_20/language/fr_FR/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/fr_FR/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/fr_FR/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/fr_FR/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/fr_FR/plugin.lang.php	(revision 19992)
@@ -0,0 +1,8 @@
+<?php
+
+$lang['Comments on photos'] = 'Commentaires sur les photos';
+$lang['Comments on albums'] = 'Commentaires sur les albums';
+$lang['Display comments on'] = 'Afficher les commentaires des';
+$lang['Last comments on albums'] = 'Derniers commentaires sur les albums';
+$lang['Display last posted comments on albums'] = 'Affiche les derniers commentaires postés sur les albums';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/hu_HU/description.txt
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/hu_HU/description.txt	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/hu_HU/description.txt	(revision 19992)
@@ -0,0 +1,1 @@
+Hozzászólások aktiválása az album oldalakon
Index: /extensions/Comments_on_Albums/branch_20/language/hu_HU/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/hu_HU/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/hu_HU/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/hu_HU/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/hu_HU/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/hu_HU/plugin.lang.php	(revision 19992)
@@ -0,0 +1,8 @@
+<?php
+
+$lang['Comments on photos'] = 'Hozzászólások a kép oldalakon';
+$lang['Comments on albums'] = 'Hozzászólások az album oldalakon';
+$lang['Display last posted comments on albums'] = 'Albumok utolsó hozzászólásainak megjelenítése';
+$lang['Last comments on albums'] = 'Friss hozzászólások az albumokban';
+$lang['Display comments on'] = 'Hozzászólások megjelenítése';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/it_IT/description.txt
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/it_IT/description.txt	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/it_IT/description.txt	(revision 19992)
@@ -0,0 +1,1 @@
+Attiva i commenti sulla pagina degli album.
Index: /extensions/Comments_on_Albums/branch_20/language/it_IT/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/it_IT/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/it_IT/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/it_IT/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/it_IT/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/it_IT/plugin.lang.php	(revision 19992)
@@ -0,0 +1,8 @@
+<?php
+
+$lang['Comments on photos'] = 'Commenti sulle foto';
+$lang['Comments on albums'] = 'Commenti sugli album';
+$lang['Display last posted comments on albums'] = 'Mostra ultimi commenti sugli album';
+$lang['Last comments on albums'] = 'Ultimi commenti sugli album';
+$lang['Display comments on'] = 'Mostra commenti su';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/lv_LV/description.txt
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/lv_LV/description.txt	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/lv_LV/description.txt	(revision 19992)
@@ -0,0 +1,1 @@
+Aktivēt komentārus albūma lapās
Index: /extensions/Comments_on_Albums/branch_20/language/lv_LV/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/lv_LV/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/lv_LV/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/lv_LV/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/lv_LV/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/lv_LV/plugin.lang.php	(revision 19992)
@@ -0,0 +1,8 @@
+<?php
+
+$lang['Comments on photos'] = 'Komentāri fotogrāfijam';
+$lang['Comments on albums'] = 'Komentāri albūmiem';
+$lang['Last comments on albums'] = 'Pēdējie komentēri par albūmiem';
+$lang['Display last posted comments on albums'] = 'Parādīt pēdējos publicētos komentērus par albūmiem';
+$lang['Display comments on'] = 'Rādīt komentārus uz';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/nl_NL/description.txt
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/nl_NL/description.txt	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/nl_NL/description.txt	(revision 19992)
@@ -0,0 +1,1 @@
+Maakt het mogelijk om ook op albums commentaar te geven.
Index: /extensions/Comments_on_Albums/branch_20/language/nl_NL/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/nl_NL/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/nl_NL/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/nl_NL/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/nl_NL/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/nl_NL/plugin.lang.php	(revision 19992)
@@ -0,0 +1,8 @@
+<?php
+
+$lang['Comments on albums'] = 'Commentaar op albums';
+$lang['Comments on photos'] = 'Commentaar op afbeeldingen';
+$lang['Display last posted comments on albums'] = 'Geef de laatste commentaren op albums weer';
+$lang['Last comments on albums'] = 'De laatste commentaren op albums';
+$lang['Display comments on'] = 'Geef reacties weer op';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/pl_PL/description.txt
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/pl_PL/description.txt	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/pl_PL/description.txt	(revision 19992)
@@ -0,0 +1,1 @@
+Aktywuj komentarze o albumie
Index: /extensions/Comments_on_Albums/branch_20/language/pl_PL/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/pl_PL/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/pl_PL/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/pl_PL/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/pl_PL/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/pl_PL/plugin.lang.php	(revision 19992)
@@ -0,0 +1,8 @@
+<?php
+
+$lang['Comments on photos'] = 'Komentarze zdjęć';
+$lang['Comments on albums'] = 'Komentarze albumów';
+$lang['Last comments on albums'] = 'Ostatnie komentarze albumów';
+$lang['Display last posted comments on albums'] = 'Wyświetla ostatnie komentarze albumów';
+$lang['Display comments on'] = 'Wyświetl komentarze o';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/pt_PT/description.txt
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/pt_PT/description.txt	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/pt_PT/description.txt	(revision 19992)
@@ -0,0 +1,1 @@
+Activar Coment&aacute;rios nas p&aacute;ginas de &aacute;lbum
Index: /extensions/Comments_on_Albums/branch_20/language/pt_PT/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/pt_PT/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/pt_PT/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/pt_PT/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/pt_PT/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/pt_PT/plugin.lang.php	(revision 19992)
@@ -0,0 +1,8 @@
+<?php
+
+$lang['Comments on albums'] = 'Comentários em álbums';
+$lang['Comments on photos'] = 'Comentários em fotos';
+$lang['Display last posted comments on albums'] = 'Mostrar os últimos cometários feitos em álbums';
+$lang['Last comments on albums'] = 'Últimos comentários em álbums';
+$lang['Display comments on'] = 'Mostrar comentários em';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/ru_RU/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/ru_RU/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/ru_RU/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/ru_RU/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/ru_RU/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/ru_RU/plugin.lang.php	(revision 19992)
@@ -0,0 +1,8 @@
+<?php
+
+$lang['Comments on albums'] = 'Комментарии для альбомов';
+$lang['Comments on photos'] = 'Комментарии для фотографий';
+$lang['Display last posted comments on albums'] = 'Отображать последние комментарии для альбомов';
+$lang['Last comments on albums'] = 'Последние комментарии для альбомов';
+$lang['Display comments on'] = 'Показать комментарии';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/sh_RS/description.txt
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/sh_RS/description.txt	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/sh_RS/description.txt	(revision 19992)
@@ -0,0 +1,1 @@
+Uključite komentare na stranama albuma
Index: /extensions/Comments_on_Albums/branch_20/language/sh_RS/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/sh_RS/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/sh_RS/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/sh_RS/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/sh_RS/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/sh_RS/plugin.lang.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+
+$lang['Comments on albums'] = 'Komentari albuma';
+$lang['Comments on photos'] = 'Komentari fotografija';
+$lang['Display last posted comments on albums'] = 'Prikaži poslednje komentare albuma';
+$lang['Last comments on albums'] = 'Poslednji komentari albuma';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/sk_SK/description.txt
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/sk_SK/description.txt	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/sk_SK/description.txt	(revision 19992)
@@ -0,0 +1,1 @@
+Aktivácia komentárov na stránkach albumov
Index: /extensions/Comments_on_Albums/branch_20/language/sk_SK/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/sk_SK/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/sk_SK/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/sk_SK/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/sk_SK/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/sk_SK/plugin.lang.php	(revision 19992)
@@ -0,0 +1,8 @@
+<?php
+
+$lang['Comments on photos'] = 'Komentáre fotiek';
+$lang['Comments on albums'] = 'Komentáre albumov';
+$lang['Display last posted comments on albums'] = 'Zobraziť ostatné komentáre albumov';
+$lang['Last comments on albums'] = 'Ostatné komentáre albumov';
+$lang['Display comments on'] = 'Zobraziť komentáre';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/sv_SE/description.txt
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/sv_SE/description.txt	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/sv_SE/description.txt	(revision 19992)
@@ -0,0 +1,1 @@
+Aktivera kommentarer på album-sidor
Index: /extensions/Comments_on_Albums/branch_20/language/sv_SE/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/sv_SE/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/sv_SE/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/sv_SE/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/sv_SE/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/sv_SE/plugin.lang.php	(revision 19992)
@@ -0,0 +1,8 @@
+<?php
+
+$lang['Comments on photos'] = 'Kommentarer till foton';
+$lang['Comments on albums'] = 'Kommentarer till album'; 
+$lang['Display comments on'] = 'Visa kommentarer om';
+$lang['Display last posted comments on albums'] = 'Visa senaste kommentarer på album';
+$lang['Last comments on albums'] = 'Senaste kommentarer på album';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/tr_TR/description.txt
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/tr_TR/description.txt	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/tr_TR/description.txt	(revision 19992)
@@ -0,0 +1,1 @@
+Albümlerdeki aktif yorumlar
Index: /extensions/Comments_on_Albums/branch_20/language/tr_TR/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/tr_TR/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/tr_TR/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/tr_TR/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/tr_TR/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/tr_TR/plugin.lang.php	(revision 19992)
@@ -0,0 +1,8 @@
+<?php
+
+$lang['Comments on photos'] = 'Fotoğraf Yorumları';
+$lang['Comments on albums'] = 'Albüm Yorumları';
+$lang['Last comments on albums'] = 'Albümlerdeki Son yorumlar';
+$lang['Display last posted comments on albums'] = 'Albümlerdeki son yorumları görüntüle';
+$lang['Display comments on'] = 'Yorumu görüntüle';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/uk_UA/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/uk_UA/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/uk_UA/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/uk_UA/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/uk_UA/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/uk_UA/plugin.lang.php	(revision 19992)
@@ -0,0 +1,8 @@
+<?php
+
+$lang['Comments on albums'] = 'Коментарі до альбомів';
+$lang['Comments on photos'] = 'Коментарі до зображення';
+$lang['Display last posted comments on albums'] = 'Показати останні коментарі опубліковані до альбомів';
+$lang['Last comments on albums'] = 'Останні коментарі до альбомів';
+$lang['Display comments on'] = 'Показати коментарі';
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/zh_CN/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/zh_CN/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/zh_CN/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/language/zh_CN/plugin.lang.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/language/zh_CN/plugin.lang.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/language/zh_CN/plugin.lang.php	(revision 19992)
@@ -0,0 +1,8 @@
+<?php
+
+$lang['Comments on albums'] = '相册评论';
+$lang['Comments on photos'] = '图片评论';
+$lang['Display last posted comments on albums'] = '显示相册最新提交的评论';
+$lang['Last comments on albums'] = '相册最新评论';
+$lang['Display comments on'] = '显示评论';
+?>
Index: /extensions/Comments_on_Albums/branch_20/main.inc.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/main.inc.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/main.inc.php	(revision 19992)
@@ -0,0 +1,102 @@
+<?php
+/*
+Plugin Name: Comments on Albums
+Version: auto
+Description: Activate comments on albums pages
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=512
+Author: Mistic
+Author URI: http://www.strangeplanet.fr
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $prefixeTable;
+
+// +-----------------------------------------------------------------------+
+//          Global variables
+// +-----------------------------------------------------------------------+
+define('COA_DIR' , basename(dirname(__FILE__)));
+define('COA_PATH' , PHPWG_PLUGINS_PATH . COA_DIR . '/');
+define('COA_TABLE' , $prefixeTable . 'comments_categories');
+define('COA_ADMIN', get_root_url().'admin.php?page=plugin-' . COA_DIR);
+
+
+// +-----------------------------------------------------------------------+
+//          Triggers
+// +-----------------------------------------------------------------------+
+add_event_handler('init', 'coa_init');
+function coa_init()
+{
+  global $user;
+  
+  // luciano doesn't use comments
+  // incompatible with dynamic display of Stripped & Collumns
+  if ($user['theme'] == 'luciano' or $user['theme'] == 'stripped_black_bloc') return;
+  
+  add_event_handler('loc_after_page_header', 'COA_albums');
+  add_event_handler('loc_after_page_header', 'COA_comments_page');
+  add_event_handler('loc_begin_admin_page', 'COA_admin_intro');
+  add_event_handler('loc_end_admin', 'COA_admin_comments');
+  add_event_handler('get_stuffs_modules', 'COA_register_stuffs_module');
+}
+
+
+// +-----------------------------------------------------------------------+
+//          Functions
+// +-----------------------------------------------------------------------+
+
+function COA_albums() 
+{
+  global $template, $page, $conf, $pwg_loaded_plugins;
+  
+  if ( !empty($page['section']) AND $page['section'] == 'categories' AND isset($page['category']) AND $page['body_id'] == 'theCategoryPage' )
+  {    
+    trigger_action('loc_begin_coa');
+    include(COA_PATH . 'include/coa_albums.php');
+  }
+}
+
+function COA_comments_page() 
+{
+  global $template, $page, $conf, $user;
+  
+  if (isset($page['body_id']) AND $page['body_id'] == 'theCommentsPage') 
+  {
+    include(COA_PATH . 'include/coa_comments_page.php');
+  }
+}
+
+function COA_admin_intro() 
+{
+  global $page;
+  
+  if ($page['page'] == 'intro') 
+  {  
+    include(COA_PATH . 'include/coa_admin_intro.php');
+  } 
+}
+
+function COA_admin_comments() 
+{
+  global $page;
+  
+  if ($page['page'] == 'comments') 
+  {  
+    include(COA_PATH . 'include/coa_admin_comments.php');
+  }
+}
+
+function COA_register_stuffs_module($modules) 
+{
+  load_language('plugin.lang', COA_PATH);
+  
+  array_push($modules, array(
+    'path' => COA_PATH . '/stuffs_module',
+    'name' => l10n('Last comments on albums'),
+    'description' => l10n('Display last posted comments on albums'),
+  ));
+
+  return $modules;
+}
+
+?>
Index: /extensions/Comments_on_Albums/branch_20/maintain.inc.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/maintain.inc.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/maintain.inc.php	(revision 19992)
@@ -0,0 +1,47 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+function plugin_install() 
+{
+  global $prefixeTable;
+
+  pwg_query("
+CREATE TABLE `" . $prefixeTable . "comments_categories` (
+  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+  `category_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
+  `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+  `author` varchar(255) DEFAULT NULL,
+  `author_id` smallint(5) DEFAULT NULL,
+  `anonymous_id` varchar(45) NOT NULL,
+  `content` longtext,
+  `validated` enum('true','false') NOT NULL DEFAULT 'false',
+  `validation_date` datetime DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) DEFAULT CHARSET=utf8
+;");
+}
+
+function plugin_activate()
+{
+  global $conf, $prefixeTable;
+  
+  if (isset($conf['comments_on_albums']))
+  {
+    pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param="comments_on_albums" LIMIT 1;');
+  }
+  
+  $query = 'SHOW COLUMNS FROM `' . $prefixeTable . 'comments_categories`;';
+  $columns = hash_from_query($query, 'Field');
+  if (!isset($columns['anonymous_id']))
+  {
+    pwg_query('ALTER TABLE `' . $prefixeTable . 'comments_categories` ADD `anonymous_id` VARCHAR( 45 ) DEFAULT NULL;');
+  }
+}
+
+function plugin_uninstall() 
+{
+  global $prefixeTable;
+
+  pwg_query("DROP TABLE `" . $prefixeTable . "comments_categories`;");
+}
+?>
Index: /extensions/Comments_on_Albums/branch_20/stuffs_module/config.inc.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/stuffs_module/config.inc.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/stuffs_module/config.inc.php	(revision 19992)
@@ -0,0 +1,43 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+if (!isset($datas)) $datas = array(5, 'on', 'default', '', '');
+
+// Enregistrement de la configuration
+if (isset($_POST['submit']))
+{
+  if (empty($_POST['nb_comments']))
+  {
+    array_push($page['errors'], l10n('lastcoms_no_nb_comments'));
+  }
+  else
+  {
+    $datas = array(
+      $_POST['nb_comments'],
+      isset($_POST['show_admin_buttons']),
+      $_POST['nb_cadres'],
+      $_POST['width'],
+      $_POST['height']
+      );
+  }
+}
+
+// Parametrage du template
+$template->assign('nb_cadres', array(
+  'OPTIONS' => array('default' => 'default', 1 => 1, 2 => 2, 3 => 3),
+  'SELECTED' => $datas[2]));
+
+$template->assign(array(
+  'NB_COMMENTS' => $datas[0],
+  'WIDTH'       => $datas[3],
+  'HEIGHT'      => $datas[4]
+));
+if ($datas[1])
+{
+  $template->assign(array('SHOW_ADMIN_BUTTONS' => 'checked="checked"'));
+}
+
+$template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl'));
+$template->assign_var_from_handle('MODULE_OPTIONS', 'module_options');
+
+?>
Index: /extensions/Comments_on_Albums/branch_20/stuffs_module/config.tpl
===================================================================
--- /extensions/Comments_on_Albums/branch_20/stuffs_module/config.tpl	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/stuffs_module/config.tpl	(revision 19992)
@@ -0,0 +1,29 @@
+<table>
+	<tr>
+		<td align="right"><br>{'lastcoms_nb_comments'|@translate} &nbsp;&nbsp;</td>
+		<td><br>
+		<input type="text" size="3" maxlength="2" value="{$NB_COMMENTS}" name="nb_comments"/></td>
+	</tr>
+	<tr>
+		<td align="right"><br>{'lastcoms_show_buttons'|@translate} &nbsp;&nbsp;</td>
+		<td><br>
+		<input type="checkbox" name="show_admin_buttons" value="on" {$SHOW_ADMIN_BUTTONS}/></td>
+	</tr>
+  <tr>
+		<td align="right"><br>{'lastcoms_nb_cadres'|@translate} &nbsp;&nbsp;</td>
+		<td><br>
+    {html_options name=nb_cadres options=$nb_cadres.OPTIONS selected=$nb_cadres.SELECTED}
+    </td>
+	</tr>
+  <tr>
+		<td align="right"><br>{'lastcoms_dim'|@translate} : &nbsp;&nbsp; {'lastcoms_width'|@translate} &nbsp;&nbsp;</td>
+		<td><br>
+		<input type="text" size="3" maxlength="3" value="{$WIDTH}" name="width"/>&nbsp;px</td>
+	</tr>
+	<tr>
+		<td align="right">{'lastcoms_height'|@translate} &nbsp;&nbsp;</td>
+		<td>
+		<input type="text" size="3" maxlength="3" value="{$HEIGHT}" name="height"/>&nbsp;px</td>
+	</tr>
+</table>
+<br>
Index: /extensions/Comments_on_Albums/branch_20/stuffs_module/cr_stuffs.tpl
===================================================================
--- /extensions/Comments_on_Albums/branch_20/stuffs_module/cr_stuffs.tpl	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/stuffs_module/cr_stuffs.tpl	(revision 19992)
@@ -0,0 +1,35 @@
+{combine_css path=$block.CR_PATH|@cat:'template/style.css'}
+
+<ul class="thumbnailCategories">
+  {foreach from=$block.contests item=contest}
+  <li class="{$block.SIZE_CLASS} {if !$contest.VISIBLE}novisible{/if}">
+    <div class="thumbnailCategory">
+      <div class="illustration">
+        <a href="{$contest.URL}">
+        {if $contest.STATUS != 'finished' AND !empty($contest.LOGO)}
+          <img src="{$contest.LOGO}" alt="{$contest.NAME}" style="max-height:120px;max-width:120px;">
+        {elseif !empty($contest.RESULTS.1.TN_SRC)}
+          <img src="{$contest.RESULTS.1.TN_SRC}" alt="{$contest.NAME|@replace:'"':' '}">
+        {/if}
+        </a>
+      </div>
+      <div class="description">
+        <h3><a href="{$contest.URL}">{$contest.NAME}</a></h3>
+        <div class="text">
+          <p class="Nb_images">{$contest.DATE_BEGIN} - {$contest.DATE_END}</p>
+          <span class="CR_finished">({$contest.DAYS})</span>
+          <p>
+          {if $contest.STATUS != 'finished' AND !empty($contest.SUMMARY)}
+            {$contest.SUMMARY}
+          {else}
+            {foreach from=$contest.RESULTS item=result}
+              {'CR_order_'|cat:$result.RANK|@translate} {'CR_place'|@translate} - <u>{$result.AUTHOR}</u><br>
+            {/foreach}
+          {/if}
+          </p>
+        </div>
+      </div>
+    </div>
+  </li>
+  {/foreach}
+</ul>
Index: /extensions/Comments_on_Albums/branch_20/stuffs_module/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/stuffs_module/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/stuffs_module/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/stuffs_module/main.inc.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/stuffs_module/main.inc.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/stuffs_module/main.inc.php	(revision 19992)
@@ -0,0 +1,189 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+global $user, $conf;
+
+// +-----------------------------------------------------------------------+
+// |                         comments management                           |
+// +-----------------------------------------------------------------------+
+// comments deletion
+if (isset($_GET['delete_album']) and is_numeric($_GET['delete_album']) and is_admin())
+{
+    check_status(ACCESS_ADMINISTRATOR);
+    check_pwg_token();
+    $query = '
+DELETE FROM ' . COA_TABLE . '
+  WHERE id=' . $_GET['delete_album'] . '
+;';
+    pwg_query($query);
+}
+
+// comments validation
+if (isset($_GET['validate_album']) and is_numeric($_GET['validate_album']) and is_admin())
+{
+    check_status(ACCESS_ADMINISTRATOR);
+    check_pwg_token();
+    $query = '
+UPDATE ' . COA_TABLE . '
+  SET validated = \'true\'
+  , validation_date = NOW()
+  WHERE id=' . $_GET['validate_album'] . '
+;';
+    pwg_query($query);
+}
+
+// +-----------------------------------------------------------------------+
+// |                        last comments display                          |
+// +-----------------------------------------------------------------------+
+$comments = array();
+$element_ids = array();
+$category_ids = array();
+$max_width = 0;
+if (!is_admin())
+{
+  $clauses[] = 'validated="true"';
+}
+$clauses[] = get_sql_condition_FandF (
+    array ('forbidden_categories' => 'category_id',
+        'visible_categories' => 'category_id'), '', true);
+
+$query = '
+SELECT
+    com.id AS comment_id,
+    com.category_id,
+    com.author,
+    com.author_id,
+    '.$conf['user_fields']['username'].' AS username,
+    com.date,
+    com.content,
+    com.validated
+  FROM '.COA_TABLE.' AS com
+    LEFT JOIN '.USERS_TABLE.' As u
+      ON u.'.$conf['user_fields']['id'].' = com.author_id
+  WHERE '.implode('
+    AND ', $clauses).'
+  GROUP BY
+    comment_id
+  ORDER BY date DESC
+  LIMIT 0, ' . $datas[0] . '
+;';
+
+$result = pwg_query($query);
+while ($row = mysql_fetch_assoc($result))
+{
+  array_push($comments, $row);
+  array_push($element_ids, $row['category_id']);
+}
+
+if (count($comments) > 0)
+{
+  $block['TITLE_URL'] = 'comments.php?display_mode=albums';
+  $block['comments'] = array();
+
+  // retrieving category informations
+  $query = '
+SELECT 
+    cat.id, 
+    cat.name, 
+    cat.permalink, 
+    cat.uppercats, 
+    com.id as comment_id,
+    img.id AS image_id,
+    img.path,
+    img.tn_ext
+  FROM '.CATEGORIES_TABLE.' AS cat
+    LEFT JOIN '.COA_TABLE.' AS com
+      ON com.category_id = cat.id
+    LEFT JOIN '.USER_CACHE_CATEGORIES_TABLE.' AS ucc 
+      ON ucc.cat_id = cat.id AND ucc.user_id = '.$user['id'].'
+    LEFT JOIN '.IMAGES_TABLE.' AS img
+      ON img.id = ucc.user_representative_picture_id
+  '.get_sql_condition_FandF(
+    array(
+      'forbidden_categories' => 'cat.id',
+      'visible_categories' => 'cat.id'
+      ), 
+    'WHERE'
+    ).'
+    AND cat.id IN ('.implode(',', $element_ids).')
+;';
+  $categories = hash_from_query($query, 'comment_id');
+
+  foreach ($comments as $comment)
+  {
+    // category url
+    $comment['cat_url'] = duplicate_index_url(
+      array(
+        'category' => array(
+          'id' => $categories[$comment['comment_id']]['id'], 
+          'name' => $categories[$comment['comment_id']]['name'], 
+          'permalink' => $categories[$comment['comment_id']]['permalink'],
+          ),
+        array('start')
+        )
+      );
+     
+    // category thumbnail
+    $comment['thumb'] = get_thumbnail_url(
+      array(
+        'id' => $categories[$comment['comment_id']]['image_id'],
+        'path' => $categories[$comment['comment_id']]['path'],
+        'tn_ext' => @$categories[$comment['comment_id']]['tn_ext'],
+        )
+     );
+
+    // author
+    $author = $comment['author'];
+    if (empty($comment['author']))
+    {
+      $author = l10n('guest');
+    }
+    
+    // comment content
+    $tpl_comment = array(
+      'ID' => $comment['comment_id'],
+      'U_PICTURE' => $comment['cat_url'],
+      'ALT' => trigger_event('render_category_name', $categories[$comment['comment_id']]['name']),
+      'TN_SRC' => $comment['thumb'],
+      'AUTHOR' => trigger_event('render_comment_author', $author),
+      'DATE' => format_date($comment['date'], true),
+      'CONTENT' => trigger_event('render_comment_content', $comment['content'], 'album'),
+      'WIDTH' => $datas[3],
+      'HEIGHT' => $datas[4],
+      );
+
+    switch ($datas[2])
+    {
+      case 1 :
+        $tpl_comment['CLASS'] = 'one_comment';
+        break;
+      case 2 :
+        $tpl_comment['CLASS'] = 'two_comment';
+        break;
+      case 3 :
+        $tpl_comment['CLASS'] = 'three_comment';
+        break;
+    }
+
+    // actions
+    if ( is_admin() and $datas[1])
+    {
+      $url = get_root_url().'index.php'.get_query_string_diff(array('delete_album','validate_album'));
+      $tpl_comment['U_DELETE'] = add_url_params($url, array(
+            'delete_album' => $comment['comment_id'],
+            'pwg_token' => get_pwg_token()));
+
+      if ($comment['validated'] != 'true')
+      {
+        $tpl_comment['U_VALIDATE'] = add_url_params($url, array(
+            'validate_album' => $comment['comment_id'],
+            'pwg_token' => get_pwg_token()));
+      }
+    }
+    
+    array_push($block['comments'], $tpl_comment);
+  }
+  $block['TEMPLATE'] = dirname(__FILE__).'/stuffs_lastcoms.tpl';
+}
+
+?>
Index: /extensions/Comments_on_Albums/branch_20/stuffs_module/stuffs_lastcoms.tpl
===================================================================
--- /extensions/Comments_on_Albums/branch_20/stuffs_module/stuffs_lastcoms.tpl	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/stuffs_module/stuffs_lastcoms.tpl	(revision 19992)
@@ -0,0 +1,40 @@
+<div id="comments">
+<ul class="thumbnailCategories">
+{foreach from=$block.comments item=comment}
+<li {if isset($comment.CLASS)}class="{$comment.CLASS}"{/if}>
+	<div class="thumbnailCategory">
+    {if isset($comment.TN_SRC)}
+    <div class="illustration">
+      <a href="{$comment.U_PICTURE}">
+        <img src="{$comment.TN_SRC}" alt="{$comment.ALT}"
+          style="{if !empty($comment.WIDTH)}max-width: {$comment.WIDTH}px; {/if}{if !empty($comment.HEIGHT)}max-height: {$comment.HEIGHT}px; {/if}"/>
+        <br>{$comment.ALT}
+      </a>
+    </div>
+    {/if}
+    <div class="description">
+      {if isset($comment.U_DELETE) or isset($comment.U_VALIDATE) }
+      <div class="actions" style="float:right">
+        {if !empty($comment.U_DELETE)}
+          <a href="{$comment.U_DELETE}" title="{'delete this comment'|@translate}" onClick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">
+            <img src="{$ROOT_URL}{$themeconf.icon_dir}/delete.png" class="button" alt="[delete]" />
+          </a>
+        {/if}
+        {if !empty($comment.U_VALIDATE)}
+          <a href="{$comment.U_VALIDATE}" title="validate this comment">
+            <img src="{$ROOT_URL}{$themeconf.icon_dir}/validate_s.png" class="button" alt="[validate]" />
+          </a>
+        {/if}
+      </div>
+      {/if}
+      <span class="author">{$comment.AUTHOR}</span> - <span class="date">{$comment.DATE}</span>
+      <blockquote>{$comment.CONTENT}</blockquote>
+    </div>
+  </div>
+</li>
+{if isset($comment_separator)}
+<hr/>
+{/if}
+{/foreach}
+</ul>
+</div>
Index: /extensions/Comments_on_Albums/branch_20/template/admin_comments.tpl
===================================================================
--- /extensions/Comments_on_Albums/branch_20/template/admin_comments.tpl	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/template/admin_comments.tpl	(revision 19992)
@@ -0,0 +1,87 @@
+{* this is a copy of admin/theme/defaults/template/comments.tpl a bit modified *}
+  
+{footer_script}{literal}
+jQuery(document).ready(function(){
+  function highlighComments() {
+    jQuery(".checkComment").each(function() {
+      var parent = jQuery(this).parent('tr');
+      if (jQuery(this).children("input[type=checkbox]").is(':checked')) {
+        jQuery(parent).addClass('selectedComment'); 
+      }
+      else {
+        jQuery(parent).removeClass('selectedComment'); 
+      }
+    });
+  }
+
+  jQuery(".checkComment").click(function(event) {
+    var checkbox = jQuery(this).children("input[type=checkbox]");
+    if (event.target.type !== 'checkbox') {
+      jQuery(checkbox).attr('checked', !jQuery(checkbox).is(':checked'));
+    }
+    highlighComments();
+  });
+
+  jQuery("#commentSelectAll").click(function () {
+    jQuery(".checkComment input[type=checkbox]").attr('checked', true);
+    highlighComments();
+    return false;
+  });
+
+  jQuery("#commentSelectNone").click(function () {
+    jQuery(".checkComment input[type=checkbox]").attr('checked', false);
+    highlighComments();
+    return false;
+  });
+
+  jQuery("#commentSelectInvert").click(function () {
+    jQuery(".checkComment input[type=checkbox]").each(function() {
+      jQuery(this).attr('checked', !$(this).is(':checked'));
+    });
+    highlighComments();
+    return false;
+  });
+
+});
+{/literal}{/footer_script}
+
+<div class="titrePage">
+  <h2>{'Pending Comments'|@translate} [{'Albums'|@translate}]</h2>
+</div>
+
+{if !empty($comments) }
+<form method="post" action="{$F_ACTION}" id="pendingComments">
+
+<table>
+  {foreach from=$comments item=comment name=comment}
+    <tr valign="top" class="{if $smarty.foreach.comment.index is odd}row2{else}row1{/if}">
+      <td style="width:50px;" class="checkComment">
+        <input type="checkbox" name="comments[]" value="{$comment.ID}">
+      </td>
+      <td>
+        <div class="comment">
+          <a class="illustration" href="{$comment.CAT_URL}"><img src="{$comment.TN_SRC}"><br/>{$comment.CAT_NAME}</a>
+          <p class="commentHeader"><strong>{$comment.AUTHOR}</strong> - <em>{$comment.DATE}</em></p>
+          <blockquote>{$comment.CONTENT}</blockquote>
+        </div>
+      </td>
+    </tr>
+  {/foreach}
+</table>
+
+  <p class="checkActions">
+    {'Select:'|@translate}
+    <a href="#" id="commentSelectAll">{'All'|@translate}</a>,
+    <a href="#" id="commentSelectNone">{'None'|@translate}</a>,
+    <a href="#" id="commentSelectInvert">{'Invert'|@translate}</a>
+  </p>
+
+  <p class="bottomButtons">
+    <input class="submit" type="submit" name="validate_albums" value="{'Validate'|@translate}">
+    <input class="submit" type="submit" name="reject_albums" value="{'Reject'|@translate}">
+  </p>
+
+</form>
+{else}
+{'No pending comment'|@translate}
+{/if}
Index: /extensions/Comments_on_Albums/branch_20/template/albums.tpl
===================================================================
--- /extensions/Comments_on_Albums/branch_20/template/albums.tpl	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/template/albums.tpl	(revision 19992)
@@ -0,0 +1,116 @@
+{* this is inspired by theme/defaults/template/picture.tpl *}
+ 
+{* <!-- need some css modifications, specific to each theme --> *}
+{html_head}
+<style type="text/css">
+#comments .commentElement {ldelim} width:98%;}
+{if $COMMENTS_ON_TOP}
+#commentAdd, #pictureCommentList {ldelim} float:none; display:inline-block; width:47.5%; vertical-align:top;}
+#commentsSwitcher {ldelim} float:none; display:inline-block; margin: 2px 0; cursor:pointer;}
+.noCommentContent #commentsSwitcher	{ldelim} display: none;}
+.switchArrow{ldelim} width: 16px; height: 16px; margin: 5px;}
+.commentshidden #pictureComments {ldelim} display: none;}
+.commentContent .comments_toggle 	{ldelim} cursor: pointer;}
+{/if}
+{if $themeconf.name == 'Sylvia'}
+#comments .description {ldelim} padding: 15px 2px 6px 12px;}
+#comments .commentElement {ldelim} border: 1px solid #666;}
+{/if}
+{if $themeconf.name|strstr:"stripped"}
+#comments {ldelim} text-align: left;}
+#comments .description {ldelim} height:auto;}
+#thumbnails_block2 {ldelim} min-height:0;}
+{/if}
+
+</style>
+{/html_head}
+
+{* <!-- if RV Thumb Scroller is installed comments block is displayed on top with a drop-down --> *}
+{if $COMMENTS_ON_TOP}
+{footer_script}{literal}
+	// comments show/hide
+	var commentsswicther=jQuery("#commentsSwitcher");
+	var comments=jQuery("#theCategoryPage #comments");
+	
+	commentsswicther.html("<div class=\"switchArrow\">&nbsp;</div>");
+  {/literal}{if $themeconf.name != 'elegant'}switcharrow = commentsswicther.children(".switchArrow");{else}switcharrow = $("<div></div>");{/if}{literal}
+	
+	if (comments.length == 1) {
+		var comments_button=jQuery("#comments h3");
+
+		if (comments_button.length == 0) {
+			jQuery("#addComment").before("<h3>Comments</h3>");
+			comments_button=jQuery("#comments h3");
+		}
+	
+    {/literal}{if $DISPLAY_COMMENTS_BLOCK}
+		comments.addClass("commentsshown");
+		comments_button.addClass("comments_toggle").addClass("comments_toggle_on");
+    switcharrow.html("&uarr;");
+    {else}
+    comments.addClass("commentshidden");
+		comments_button.addClass("comments_toggle").addClass("comments_toggle_off");
+    switcharrow.html("&darr;");
+		{/if}{literal}
+    
+		comments_button.click(function() { commentsToggle() });
+		commentsswicther.click(function() { commentsToggle() });
+	
+	}
+  
+  function commentsToggle() {
+    var comments=jQuery("#theCategoryPage #comments");
+    var comments_button=jQuery("#comments h3");
+
+    if (comments.hasClass("commentshidden")) {
+        comments.removeClass("commentshidden").addClass("commentsshown");
+        comments_button.addClass("comments_toggle_off").removeClass("comments_toggle_off");
+        switcharrow.html("&uarr;");
+      } else {
+        comments.addClass("commentshidden").removeClass("commentsshown");
+        comments_button.addClass("comments_toggle_on").removeClass("comments_toggle_on");
+        switcharrow.html("&darr;");
+      }
+
+  }
+{/literal}{/footer_script}
+{/if}
+
+{if isset($COMMENT_COUNT)}
+<div id="comments" style="margin:10px 0 10px 0;" {if (!isset($comment_add) && ($COMMENT_COUNT == 0))}class="noCommentContent"{else}class="commentContent"{/if}>
+  <h3 style="margin:0 0 0 5px;"><div id="commentsSwitcher"></div>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>
+
+  <div id="pictureComments"><fieldset>
+    {if isset($comment_add)}
+		<div id="commentAdd">
+			<h4>{'Add a comment'|@translate}</h4>
+			<form method="post" action="{$comment_add.F_ACTION}" id="addComment">
+				{if $comment_add.SHOW_AUTHOR}
+					<p><label>{'Author'|@translate} :</label></p>
+					<p><input type="text" name="author"></p>
+					<p><label>{'Comment'|@translate} :</label></p>
+				{/if}
+				<p><textarea name="content" id="contentid" rows="5" cols="50">{$comment_add.CONTENT}</textarea></p>
+				<p><input type="hidden" name="key" value="{$comment_add.KEY}">
+					<input type="submit" value="{'Submit'|@translate}"></p>
+			</form>
+		</div>
+    {/if}
+    {if isset($comments)}
+		<div id="pictureCommentList">
+			{if (($COMMENT_COUNT > 2) || !empty($comment_navbar))}
+				<div id="pictureCommentNavBar">
+					{if $COMMENT_COUNT > 2}
+						<a href="{$COMMENTS_ORDER_URL}#comments" rel="nofollow" class="commentsOrder">{$COMMENTS_ORDER_TITLE}</a>
+					{/if}
+					{if !empty($comment_navbar) }{include file=$COA_ABSOLUTE_PATH|@cat:'template/navigation_bar.tpl'|@get_extent:'navbar'}{/if}
+				</div>
+			{/if}
+      {include file='comment_list.tpl'}
+		</div>
+		{/if}
+		{if not $COMMENTS_ON_TOP}<div style="clear:both"></div>{/if}
+	</fieldset></div>
+
+</div>
+{/if}{*comments*}
Index: /extensions/Comments_on_Albums/branch_20/template/comments_page.tpl
===================================================================
--- /extensions/Comments_on_Albums/branch_20/template/comments_page.tpl	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/template/comments_page.tpl	(revision 19992)
@@ -0,0 +1,107 @@
+{* this is a copy of theme/default/template/comments.tpl a bit modified *}
+
+{* <!-- stripped uses a custom layout -->*}
+{if $themeconf.name|strstr:"stripped"}
+  <div class="titrePage">
+    <div class="browsePath">
+      <h2>
+        {if isset($MENUBAR)}
+          <span id="menuswitcher" title="{'Show/hide menu'|@translate}">{'Menu'|@translate}</span><span class="arrow"> »</span>
+        {/if}
+        <a href="{$U_HOME}">{'Home'|@translate}</a>{$LEVEL_SEPARATOR}{'User comments'|@translate}
+      </h2>
+    </div>
+  </div>
+
+  <div id="content">
+  {if isset($MENUBAR)}{$MENUBAR}{/if}
+  <div id="content_cell">
+      <div class="content_block">
+{else}
+  {if isset($MENUBAR)}{$MENUBAR}{/if}
+  <div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}">
+
+  <div class="titrePage">
+    <ul class="categoryActions">
+    </ul>
+    <h2><a href="{$U_HOME}">{'Home'|@translate}</a>{$LEVEL_SEPARATOR}{'User comments'|@translate}</h2>
+  </div>
+{/if}
+
+{include file='infos_errors.tpl'}
+
+<form class="filter">
+<fieldset>
+  <legend>{'Display comments on'|@translate}</legend>
+  <span style="font-size:1.1em;"><a href="comments.php">{'Photos'|@translate}</a> | <a href="#" style="font-weight:bold;">{'Albums'|@translate}</a></span>
+</fieldset>
+</form>
+
+<form class="filter" action="{$F_ACTION}?display_mode=albums" method="get">
+
+  <fieldset>
+    <legend>{'Filter'|@translate}</legend>
+
+    <label>{'Keyword'|@translate} <input type="text" name="keyword" value="{$F_KEYWORD}"></label>
+
+    <label>{'Author'|@translate} <input type="text" name="author" value="{$F_AUTHOR}"></label>
+
+    <label>
+      {'Album'|@translate}
+      <select name="cat">
+        <option value="0">------------</option>
+        {html_options options=$categories selected=$categories_selected}
+      </select>
+    </label>
+
+    <label>
+      {'Since'|@translate}
+      <select name="since">
+        {html_options options=$since_options selected=$since_options_selected}
+      </select>
+    </label>
+
+  </fieldset>
+
+  <fieldset>
+
+    <legend>{'Display'|@translate}</legend>
+
+    <label>
+      {'Sort by'|@translate}
+      <select name="sort_by">
+        {html_options options=$sort_by_options selected=$sort_by_options_selected}
+      </select>
+    </label>
+
+    <label>
+      {'Sort order'|@translate}
+      <select name="sort_order">
+        {html_options options=$sort_order_options selected=$sort_order_options_selected}
+      </select>
+    </label>
+
+    <label>
+      {'Number of items'|@translate}
+      <select name="items_number">
+        {html_options options=$item_number_options selected=$item_number_options_selected}
+      </select>
+    </label>
+
+  </fieldset>
+
+  <input type="hidden" name="display_mode" value="albums"/>
+  <p><input class="submit" type="submit" value="{'Filter and display'|@translate}"></p>
+
+</form>
+ 
+{if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
+
+{if isset($comments)}
+<div id="comments">
+  {include file='comment_list.tpl' comment_derivative_params=$derivative_params}
+</div>
+{/if}
+
+</div> <!-- content -->
+{if $themeconf.name|strstr:"stripped"}</div></div>{/if}
Index: /extensions/Comments_on_Albums/branch_20/template/index.php
===================================================================
--- /extensions/Comments_on_Albums/branch_20/template/index.php	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/template/index.php	(revision 19992)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Comments_on_Albums/branch_20/template/navigation_bar.tpl
===================================================================
--- /extensions/Comments_on_Albums/branch_20/template/navigation_bar.tpl	(revision 19992)
+++ /extensions/Comments_on_Albums/branch_20/template/navigation_bar.tpl	(revision 19992)
@@ -0,0 +1,31 @@
+{* this is a copy of theme/defaults/template/navigation_bar.tpl 
+  but with other variables to not interfer with the thumbnails' navigation bar *}
+  
+<div class="navigationBar">
+  {if isset($comment_navbar.URL_FIRST)}
+    <a href="{$comment_navbar.URL_FIRST}#comments" rel="first">{'First'|@translate}</a> |
+    <a href="{$comment_navbar.URL_PREV}#comments" rel="prev">{'Previous'|@translate}</a> |
+  {else}
+    {'First'|@translate} |
+    {'Previous'|@translate} |
+  {/if}
+
+  {assign var='prev_page' value=0}
+  {foreach from=$comment_navbar.pages key=page item=url}
+    {if $page > $prev_page+1}...{/if}
+    {if $page == $comment_navbar.CURRENT_PAGE}
+      <span class="pageNumberSelected">{$page}</span>
+    {else}
+      <a href="{$url}#comments">{$page}</a>
+    {/if}
+    {assign var='prev_page' value=$page}
+  {/foreach}
+
+  {if isset($comment_navbar.URL_NEXT)}
+    | <a href="{$comment_navbar.URL_NEXT}#comments" rel="next">{'Next'|@translate}</a>
+    | <a href="{$comment_navbar.URL_LAST}#comments" rel="last">{'Last'|@translate}</a>
+  {else}
+    | {'Next'|@translate}
+    | {'Last'|@translate}
+  {/if}
+</div>
