Index: /extensions/HasHigh/has_high.php
===================================================================
--- /extensions/HasHigh/has_high.php	(revision 3297)
+++ /extensions/HasHigh/has_high.php	(revision 3297)
@@ -0,0 +1,41 @@
+<?php
+
+load_language('plugin.lang', HASHIGH_PATH);
+
+global $template, $page, $conf, $prefixeTable;
+
+$forbidden = get_sql_condition_FandF (
+    			array ('forbidden_categories' => 'ic.category_id',
+        			 'visible_categories' => 'ic.category_id',
+        			 'visible_images' => 'i.id'), 'WHERE', true);
+
+$page['section'] = 'has_high';
+
+if (get_db_plugins('active','HDavecPrefixe'))
+{
+  $query = 'SELECT DISTINCT (i.id)
+  FROM ' . IMAGES_TABLE . ' AS i
+  INNER JOIN ' . IMAGE_CATEGORY_TABLE . ' AS ic
+    ON i.id = ic.image_id
+  INNER JOIN '.$prefixeTable.'hdavecprefixe AS hd
+    ON i.id = hd.id_image
+  ' . $forbidden . '
+  ' . $conf['order_by'] . ';';
+}
+else
+{
+  $query = 'SELECT DISTINCT (i.id)
+  FROM ' . IMAGES_TABLE . ' AS i
+  INNER JOIN ' . IMAGE_CATEGORY_TABLE . ' AS ic
+    ON i.id = ic.image_id
+    AND i.has_high = "true"
+  ' . $forbidden . '
+  ' . $conf['order_by'] . ';';
+}
+
+$page = array_merge($page, array(
+  'title' => '<a href="' . duplicate_index_url(array('start'=>0)).'">'.l10n('has_high_cat').'</a>',
+  'items' => array_from_query($query, 'id')
+));
+
+?>
Index: /extensions/HasHigh/language/en_UK/index.php
===================================================================
--- /extensions/HasHigh/language/en_UK/index.php	(revision 3297)
+++ /extensions/HasHigh/language/en_UK/index.php	(revision 3297)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/HasHigh/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/HasHigh/language/en_UK/plugin.lang.php	(revision 3297)
+++ /extensions/HasHigh/language/en_UK/plugin.lang.php	(revision 3297)
@@ -0,0 +1,6 @@
+<?php
+
+$lang['has_high_cat'] = 'With high definition';
+$lang['has_high_cat_hint'] = 'displays pictures which high definition';
+
+?>
Index: /extensions/HasHigh/language/fr_FR/index.php
===================================================================
--- /extensions/HasHigh/language/fr_FR/index.php	(revision 3297)
+++ /extensions/HasHigh/language/fr_FR/index.php	(revision 3297)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/HasHigh/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/HasHigh/language/fr_FR/plugin.lang.php	(revision 3297)
+++ /extensions/HasHigh/language/fr_FR/plugin.lang.php	(revision 3297)
@@ -0,0 +1,6 @@
+<?php
+
+$lang['has_high_cat'] = 'Avec haute définition';
+$lang['has_high_cat_hint'] = 'afficher les images avec une haute définition';
+
+?>
Index: /extensions/HasHigh/main.inc.php
===================================================================
--- /extensions/HasHigh/main.inc.php	(revision 3297)
+++ /extensions/HasHigh/main.inc.php	(revision 3297)
@@ -0,0 +1,48 @@
+<?php
+/*
+Plugin Name: Has High
+Version: 2.0.c
+Description: Add a "With high definition" link in "Specials" menu / Ajoute un lien "Avec haute définition" dans le menu "Spéciales"
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=222
+Author: P@t
+Author URI: http://www.gauchon.com
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+define('HASHIGH_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
+
+function add_link_has_high($menu_ref_arr)
+{
+  global $conf, $user;
+
+  $menu = & $menu_ref_arr[0];
+  
+  if ($user['enabled_high'] and ($block = $menu->get_block('mbSpecials')) != null)
+  {
+    load_language('plugin.lang', HASHIGH_PATH);
+
+    $position = (isset($conf['hashigh_position']) and is_numeric($conf['hashigh_position'])) ? $conf['hashigh_position'] : count($block->data)+1;
+
+    array_splice($block->data, $position-1, 0, array('has_high' =>
+      array(
+        'URL' => make_index_url(array('section' => 'has_high')),
+        'TITLE' => l10n('has_high_cat_hint'),
+        'NAME' => l10n('has_high_cat')
+        )
+      )
+    );
+  }
+}
+
+function section_init_has_high()
+{
+  global $tokens;
+  if (in_array('has_high', $tokens))
+    include(HASHIGH_PATH . 'has_high.php');
+}
+
+add_event_handler('blockmanager_apply' , 'add_link_has_high');
+add_event_handler('loc_end_section_init', 'section_init_has_high');
+
+?>
Index: /extensions/HasHigh/maintain.inc.php
===================================================================
--- /extensions/HasHigh/maintain.inc.php	(revision 3297)
+++ /extensions/HasHigh/maintain.inc.php	(revision 3297)
@@ -0,0 +1,15 @@
+<?php
+
+function plugin_install()
+{
+  $q = pwg_query('SHOW COLUMNS FROM ' . HISTORY_TABLE . ' LIKE "section"');
+  $section = mysql_fetch_array($q);
+  $type = $section['Type'];
+
+  if (substr_count($type, 'has_high') == 0)
+    $type = strtr($type , array(')' => ',\'has_high\')'));
+
+  pwg_query('ALTER TABLE ' . HISTORY_TABLE . ' CHANGE section section ' . $type . ' DEFAULT NULL');
+}
+
+?>
