Skip to content

Commit

Permalink
bug:2224 one parameter for change thumnails number (needs some transl…
Browse files Browse the repository at this point in the history
…ations)

git-svn-id: http://piwigo.org/svn/trunk@10198 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
mistic100 committed Apr 9, 2011
1 parent fe28570 commit 7619427
Show file tree
Hide file tree
Showing 48 changed files with 197 additions and 208 deletions.
10 changes: 2 additions & 8 deletions admin/themes/default/template/profile_content.tpl
Expand Up @@ -45,15 +45,9 @@
<ul>
<li>
<span class="property">
<label for="nb_image_line">{'Number of photos per row'|@translate}</label>
<label for="nb_image_page">{'Number of photos per page'|@translate}</label>
</span>
<input type="text" size="3" maxlength="2" name="nb_image_line" id="nb_image_line" value="{$NB_IMAGE_LINE}">
</li>
<li>
<span class="property">
<label for="nb_line_page">{'Number of rows per page'|@translate}</label>
</span>
<input type="text" size="3" maxlength="2" name="nb_line_page" id="nb_line_page" value="{$NB_ROW_PAGE}" >
<input type="text" size="3" maxlength="2" name="nb_image_page" id="nb_image_page" value="{$NB_IMAGE_PAGE}">
</li>
{if not $SPECIAL_USER}
<li>
Expand Down
20 changes: 5 additions & 15 deletions admin/themes/default/template/user_list.tpl
Expand Up @@ -183,25 +183,15 @@

<table>
<tr>
<td>{'Number of photos per row'|@translate}</td>
<td>{'Number of photos per page'|@translate}</td>
<td>
<label><input type="radio" name="nb_image_line_action" value="leave" checked="checked"> {'leave'|@translate}</label>
<label><input type="radio" name="nb_image_line_action" value="set" id="nb_image_line_action_set"> {'set to'|@translate}</label>
<input onmousedown="document.getElementById('nb_image_line_action_set').checked = true;"
size="3" maxlength="2" type="text" name="nb_image_line" value="{$NB_IMAGE_LINE}">
<label><input type="radio" name="nb_image_page_action" value="leave" checked="checked"> {'leave'|@translate}</label>
<label><input type="radio" name="nb_image_page_action" value="set" id="nb_image_page_action_set"> {'set to'|@translate}</label>
<input onmousedown="document.getElementById('nb_image_page_action_set').checked = true;"
size="3" maxlength="2" type="text" name="nb_image_page" value="{$NB_IMAGE_PAGE}">
</td>
</tr>

<tr>
<td>{'Number of rows per page'|@translate}</td>
<td>
<label><input type="radio" name="nb_line_page_action" value="leave" checked="checked"> {'leave'|@translate}</label>
<label><input type="radio" name="nb_line_page_action" value="set" id="nb_line_page_action_set"> {'set to'|@translate}</label>
<input onmousedown="document.getElementById('nb_line_page_action_set').checked = true;"
size="3" maxlength="2" type="text" name="nb_line_page" value="{$NB_LINE_PAGE}">
<td>
</tr>

<tr>
<td>{'Interface theme'|@translate}</td>
<td>
Expand Down
8 changes: 3 additions & 5 deletions admin/user_list.php
Expand Up @@ -384,7 +384,7 @@ function get_filtered_user_list()
$dbfields = array('primary' => array('user_id'), 'update' => array());

$formfields =
array('nb_image_line', 'nb_line_page', 'theme', 'language',
array('nb_image_page', 'theme', 'language',
'recent_period', 'maxwidth', 'expand', 'show_nb_comments',
'show_nb_hits', 'maxheight', 'status', 'enabled_high',
'level');
Expand Down Expand Up @@ -559,8 +559,7 @@ function get_filtered_user_list()
{
$template->assign(
array(
'NB_IMAGE_LINE' => $_POST['nb_image_line'],
'NB_LINE_PAGE' => $_POST['nb_line_page'],
'NB_IMAGE_PAGE' => $_POST['nb_image_page'],
'MAXWIDTH' => $_POST['maxwidth'],
'MAXHEIGHT' => $_POST['maxheight'],
'RECENT_PERIOD' => $_POST['recent_period'],
Expand All @@ -571,8 +570,7 @@ function get_filtered_user_list()
$default_user = get_default_user_info(true);
$template->assign(
array(
'NB_IMAGE_LINE' => $default_user['nb_image_line'],
'NB_LINE_PAGE' => $default_user['nb_line_page'],
'NB_IMAGE_PAGE' => $default_user['nb_image_page'],
'MAXWIDTH' => $default_user['maxwidth'],
'MAXHEIGHT' => $default_user['maxheight'],
'RECENT_PERIOD' => $default_user['recent_period'],
Expand Down
3 changes: 0 additions & 3 deletions include/functions_user.inc.php
Expand Up @@ -244,9 +244,6 @@ function build_user( $user_id, $use_cache )
$user['internal_status']['guest_must_be_guest'] = true;
}

// calculation of the number of picture to display per page
$user['nb_image_page'] = $user['nb_image_line'] * $user['nb_line_page'];

// Check user theme
if (!isset($user['theme_name']))
{
Expand Down
65 changes: 65 additions & 0 deletions install/db/101-database.php
@@ -0,0 +1,65 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2011 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. |
// +-----------------------------------------------------------------------+

if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}

$upgrade_description = 'merge nb_line_page and nb_image_line into nb_image_page';

// add column
if ('mysql' == $conf['dblayer'])
{
pwg_query('
ALTER TABLE '.USER_INFOS_TABLE.'
ADD COLUMN `nb_image_page` tinyint(3) unsigned NOT NULL default \'15\'
;');
}
else if (in_array($conf['dblayer'], array('pgsql', 'sqlite', 'pdo-sqlite')))
{
pwg_query('
ALTER TABLE '.IMAGES_TABLE.'
ADD COLUMN "nb_image_page" INTEGER default 15 NOT NULL
;');
}

// merge datas
pwg_query('
UPDATE '.USER_INFOS_TABLE.'
SET nb_image_page = nb_line_page*nb_image_line
;');

// delete old columns
pwg_query('
ALTER TABLE '.USER_INFOS_TABLE.'
DROP `nb_line_page`,
DROP `nb_image_line`
;');

echo
"\n"
. $upgrade_description
."\n"
;
?>
3 changes: 1 addition & 2 deletions install/piwigo_structure-mysql.sql
Expand Up @@ -404,8 +404,7 @@ CREATE TABLE `piwigo_user_group` (
DROP TABLE IF EXISTS `piwigo_user_infos`;
CREATE TABLE `piwigo_user_infos` (
`user_id` smallint(5) NOT NULL default '0',
`nb_image_line` tinyint(1) unsigned NOT NULL default '5',
`nb_line_page` tinyint(3) unsigned NOT NULL default '3',
`nb_image_page` tinyint(3) unsigned NOT NULL default '15',
`status` enum('webmaster','admin','normal','generic','guest') NOT NULL default 'guest',
`language` varchar(50) NOT NULL default 'en_UK',
`maxwidth` smallint(6) default NULL,
Expand Down
3 changes: 1 addition & 2 deletions install/piwigo_structure-pdo-sqlite.sql
Expand Up @@ -467,8 +467,7 @@ DROP TABLE IF EXISTS piwigo_user_infos;
CREATE TABLE piwigo_user_infos
(
"user_id" INTEGER default 0 NOT NULL,
"nb_image_line" INTEGER default 5 NOT NULL,
"nb_line_page" INTEGER default 3 NOT NULL,
"nb_image_page" INTEGER default 15 NOT NULL,
"status" VARCHAR(50) default 'guest',
"language" VARCHAR(50) default 'en_UK' NOT NULL,
"maxwidth" INTEGER,
Expand Down
3 changes: 1 addition & 2 deletions install/piwigo_structure-pgsql.sql
Expand Up @@ -568,8 +568,7 @@ DROP TABLE IF EXISTS "piwigo_user_infos" CASCADE;
CREATE TABLE "piwigo_user_infos"
(
"user_id" INTEGER default 0 NOT NULL,
"nb_image_line" INTEGER default 5 NOT NULL,
"nb_line_page" INTEGER default 3 NOT NULL,
"nb_image_page" INTEGER default 15 NOT NULL,
"status" USER_INFOS_STATUS default 'guest'::USER_INFOS_STATUS,
"language" VARCHAR(50) default 'en_UK' NOT NULL,
"maxwidth" INTEGER,
Expand Down
3 changes: 1 addition & 2 deletions install/piwigo_structure-sqlite.sql
Expand Up @@ -467,8 +467,7 @@ DROP TABLE IF EXISTS piwigo_user_infos;
CREATE TABLE piwigo_user_infos
(
"user_id" INTEGER default 0 NOT NULL,
"nb_image_line" INTEGER default 5 NOT NULL,
"nb_line_page" INTEGER default 3 NOT NULL,
"nb_image_page" INTEGER default 15 NOT NULL,
"status" VARCHAR(50) default 'guest',
"language" VARCHAR(50) default 'en_UK' NOT NULL,
"maxwidth" INTEGER,
Expand Down
8 changes: 4 additions & 4 deletions language/ar_SA/common.lang.php
Expand Up @@ -234,10 +234,10 @@
$lang['month'][9] = 'سبتمبر';
$lang['Most visited'] = 'الصور الأكثر مشاهدة';
$lang['display most visited photos'] = 'أعرض الصور الاكثر مشاهدة';
$lang['The number of photos per row must be a not null scalar'] = 'عدد الصور لكل صف لا يجب ان يكون فارغ';
$lang['Number of photos per row'] = 'عدد الصورلكل صف';
$lang['The number of rows per page must be a not null scalar'] = 'عدد الصورلكل صف لا يجب ان يكون فارغ';
$lang['Number of rows per page'] = 'عدد الصفوف في الصفحة';
// $lang['The number of photos per row must be a not null scalar'] = 'عدد الصور لكل صف لا يجب ان يكون فارغ';
// $lang['Number of photos per row'] = 'عدد الصورلكل صف';
// $lang['The number of rows per page must be a not null scalar'] = 'عدد الصورلكل صف لا يجب ان يكون فارغ';
// $lang['Number of rows per page'] = 'عدد الصفوف في الصفحة';
$lang['Unknown identifier'] = 'معرف مجهول';
$lang['New password'] = 'كلمة مرور جديدة';
$lang['Rate this photo'] = 'قيم هذه الصورة';
Expand Down
6 changes: 2 additions & 4 deletions language/ca_ES/common.lang.php
Expand Up @@ -227,10 +227,8 @@
$lang['month'][9] = 'Setembre';
$lang['Most visited'] = 'Més visitades';
$lang['display most visited photos'] = 'visualitza les imatges més visitades';
$lang['The number of photos per row must be a not null scalar'] = 'El nombre d\'imatges per fila ha de ser un escalar no nul';
$lang['Number of photos per row'] = 'Nombre d\'imatges per fila';
$lang['The number of rows per page must be a not null scalar'] = 'El nombre de files per pàgina ha de ser un escalar no nul';
$lang['Number of rows per page'] = 'Nombre de files per pàgina';
$lang['The number of photos per page must be a not null scalar'] = 'El nombre d\'imatges per pàgina ha de ser un escalar no nul';
$lang['Number of photos per page'] = 'Nombre d\'imatges per pàgina';
$lang['Unknown identifier'] = 'identificador desconegut';
$lang['New password'] = 'Nova contrasenya';
$lang['Rate this photo'] = 'Valoreu aquesta imatge';
Expand Down
6 changes: 2 additions & 4 deletions language/cs_CZ/common.lang.php
Expand Up @@ -235,10 +235,8 @@
$lang['month'][9] = 'Září';
$lang['Most visited'] = 'Nejčastěji zobrazované';
$lang['display most visited photos'] = 'Nejčastěji zobrazované fotografie';
$lang['The number of photos per row must be a not null scalar'] = 'Počet fotografií v řádku musí být číslo větší než 0.';
$lang['Number of photos per row'] = 'Počet fotografií v řádku';
$lang['The number of rows per page must be a not null scalar'] = 'Počet řádků na stránce musí být číslo větší než 0.';
$lang['Number of rows per page'] = 'Počet řádků na stránce';
$lang['The number of photos per page must be a not null scalar'] = 'Počet fotografií v stránce musí být číslo větší než 0.';
$lang['Number of photos per page'] = 'Počet fotografií v stránce';
$lang['Unknown identifier'] = 'Neznámý identifikátor';
$lang['New password'] = 'Nové heslo';
$lang['Rate this photo'] = 'Ohodnotit tuto fotografii';
Expand Down
6 changes: 2 additions & 4 deletions language/da_DK/common.lang.php
Expand Up @@ -231,10 +231,8 @@
$lang['month'][9] = 'September';
$lang['Most visited'] = 'Mest sete';
$lang['display most visited photos'] = 'vis mest sete fotos';
$lang['The number of photos per row must be a not null scalar'] = 'Antallet af fotos pr. række må ikke være nul';
$lang['Number of photos per row'] = 'antallet af fotos pr. række';
$lang['The number of rows per page must be a not null scalar'] = 'Antallet af rækker pr. side må ikke være nul';
$lang['Number of rows per page'] = 'Antallet af rækker pr. side';
$lang['The number of photos per page must be a not null scalar'] = 'Antallet af fotos pr. side må ikke være nul';
$lang['Number of photos per page'] = 'antallet af fotos pr. side';
$lang['Unknown identifier'] = 'Ukendt identifier';
$lang['New password'] = 'Nyt password';
$lang['Rate this photo'] = 'Bedøm dette foto';
Expand Down
6 changes: 2 additions & 4 deletions language/de_DE/common.lang.php
Expand Up @@ -231,10 +231,8 @@
$lang['month'][9] = 'September';
$lang['Most visited'] = 'Am häufigsten gesehen';
$lang['display most visited photos'] = 'zeige die meistbesuchten Fotos';
$lang['The number of photos per row must be a not null scalar'] = 'Die Anzahl Fotos per Reihe darf nicht Null sein';
$lang['Number of photos per row'] = 'Anzahl Fotos per Reihe';
$lang['The number of rows per page must be a not null scalar'] = 'Die Anzahl der Zeilen pro Seite muss mindestens 1 sein';
$lang['Number of rows per page'] = 'Anzahl der Zeilen pro Seite';
$lang['The number of photos per page must be a not null scalar'] = 'Die Anzahl Fotos pro Seite darf nicht Null sein';
$lang['Number of photos per page'] = 'Anzahl Fotos pro Seite';
$lang['Unknown identifier'] = 'Identifikatoren unbekannt';
$lang['New password'] = 'Neues Passwort';
$lang['Rate this photo'] = 'Bewerte dieses Foto';
Expand Down
6 changes: 2 additions & 4 deletions language/en_UK/common.lang.php
Expand Up @@ -229,10 +229,8 @@
$lang['month'][9] = "September";
$lang['Most visited'] = "Most visited";
$lang['display most visited photos'] = "display most visited photos";
$lang['The number of photos per row must be a not null scalar'] = "The number of photos per row must be a nonzero integer";
$lang['Number of photos per row'] = "Number of photos per row";
$lang['The number of rows per page must be a not null scalar'] = "The number of rows per page must be a nonzero integer";
$lang['Number of rows per page'] = "Number of rows per page";
$lang['The number of photos per page must be a not null scalar'] = "The number of photos per page must be a nonzero integer";
$lang['Number of photos per page'] = "Number of photos per page";
$lang['Unknown identifier'] = "Unknown identifier";
$lang['New password'] = "New password";
$lang['Rate this photo'] = "Rate this photo";
Expand Down
6 changes: 2 additions & 4 deletions language/es_AR/common.lang.php
Expand Up @@ -230,10 +230,8 @@
$lang['month'][9] = 'Septiembre';
$lang['Most visited'] = 'Las más vistas';
$lang['display most visited photos'] = 'mostrar las imágenes más vistas';
$lang['The number of photos per row must be a not null scalar'] = 'La cantidad de imágenes por línea debe ser un número entero superior a cero';
$lang['Number of photos per row'] = 'Cantidad de diapositivas por línea';
$lang['The number of rows per page must be a not null scalar'] = 'La cantidad de líneas por página debe ser un número entero superior a cero';
$lang['Number of rows per page'] = 'Cantidad de líneas por página';
$lang['The number of photos per page must be a not null scalar'] = 'La cantidad de imágenes por página debe ser un número entero superior a cero';
$lang['Number of photos per page'] = 'Cantidad de diapositivas por página';
$lang['Unknown identifier'] = 'Identificador desconocido';
$lang['New password'] = 'Nueva contraseña';
$lang['Rate this photo'] = 'Votar esta imagen';
Expand Down
6 changes: 2 additions & 4 deletions language/es_ES/common.lang.php
Expand Up @@ -230,10 +230,8 @@
$lang['month'][9] = 'Septiembre';
$lang['Most visited'] = 'Imágenes más vistas';
$lang['display most visited photos'] = 'mostrar las fotos más vistas';
$lang['The number of photos per row must be a not null scalar'] = 'La cantidad de fotos por línea debe ser un número entero superior a cero';
$lang['Number of photos per row'] = 'Número de miniaturas por línea';
$lang['The number of rows per page must be a not null scalar'] = 'El número de líneas por página debe ser un numero entero no nulo';
$lang['Number of rows per page'] = 'Número de líneas por pagina';
$lang['The number of photos per page must be a not null scalar'] = 'La cantidad de fotos por pagina debe ser un número entero superior a cero';
$lang['Number of photos per page'] = 'Número de miniaturas por pagina';
$lang['Unknown identifier'] = 'Identificador desconocido';
$lang['New password'] = 'Nueva contraseña';
$lang['Rate this photo'] = 'Votar esta foto';
Expand Down
8 changes: 4 additions & 4 deletions language/fa_IR/common.lang.php
Expand Up @@ -229,10 +229,10 @@
$lang['month'][9] = "سپتامبر";
$lang['Most visited'] = "بیشترین بازدید";
$lang['display most visited photos'] = "نمایش عکس‌هایی که بیشترین بازدید را داشته‌اند.";
$lang['The number of photos per row must be a not null scalar'] = "تعداد عکس‌هایی که در هر سطر نمایش داده می‌شود که باید یک عدد غیر صفر باشد.";
$lang['Number of photos per row'] = "تعداد عکس‌هایی که در هر سطر نمایش داده می‌شود";
$lang['The number of rows per page must be a not null scalar'] = "تعداد عکس‌هایی که در هر صفحه نمایش داده می‌شود که باید یک عدد غیر صفر باشد.";
$lang['Number of rows per page'] = "تعداد عکس‌هایی که در هر صفحه نمایش داده می‌شود";
// $lang['The number of photos per row must be a not null scalar'] = "تعداد عکس‌هایی که در هر سطر نمایش داده می‌شود که باید یک عدد غیر صفر باشد.";
// $lang['Number of photos per row'] = "تعداد عکس‌هایی که در هر سطر نمایش داده می‌شود";
// $lang['The number of rows per page must be a not null scalar'] = "تعداد عکس‌هایی که در هر صفحه نمایش داده می‌شود که باید یک عدد غیر صفر باشد.";
// $lang['Number of rows per page'] = "تعداد عکس‌هایی که در هر صفحه نمایش داده می‌شود";
$lang['Unknown identifier'] = "ناشناخته!";
$lang['New password'] = "گذرواژه جدید";
$lang['Rate this photo'] = "امتیاز دادن به این تصویر";
Expand Down
6 changes: 2 additions & 4 deletions language/fr_CA/common.lang.php
Expand Up @@ -229,10 +229,8 @@
$lang['month'][9] = 'Septembre';
$lang['Most visited'] = 'Plus vues';
$lang['display most visited photos'] = 'afficher les images les plus vues';
$lang['The number of photos per row must be a not null scalar'] = 'Le nombre d\'images par ligne doit être un entier non nul';
$lang['Number of photos per row'] = 'Nombre de miniatures par ligne';
$lang['The number of rows per page must be a not null scalar'] = 'Le nombre de lignes par page doit être un entier non nul';
$lang['Number of rows per page'] = 'Nombre de lignes par page';
$lang['The number of photos per page must be a not null scalar'] = 'Le nombre d\'images par page doit être un entier non nul';
$lang['Number of photos per page'] = 'Nombre de miniatures par page';
$lang['Unknown identifier'] = 'Identifiants inconnus';
$lang['New password'] = 'Nouveau mot de passe';
$lang['Rate this photo'] = 'Votez pour cette image';
Expand Down
6 changes: 2 additions & 4 deletions language/fr_FR/common.lang.php
Expand Up @@ -229,10 +229,8 @@
$lang['month'][9] = 'Septembre';
$lang['Most visited'] = 'Plus vues';
$lang['display most visited photos'] = 'afficher les photos les plus vues';
$lang['The number of photos per row must be a not null scalar'] = 'Le nombre de photos par ligne doit être un entier non nul';
$lang['Number of photos per row'] = 'Nombre de miniatures par ligne';
$lang['The number of rows per page must be a not null scalar'] = 'Le nombre de lignes par page doit être un entier non nul';
$lang['Number of rows per page'] = 'Nombre de lignes par page';
$lang['The number of photos per page must be a not null scalar'] = 'Le nombre de photos par page doit être un entier non nul';
$lang['Number of photos per page'] = 'Nombre de miniatures par page';
$lang['Unknown identifier'] = 'Identifiants inconnus';
$lang['New password'] = 'Nouveau mot de passe';
$lang['Rate this photo'] = 'Votez pour cette photo';
Expand Down

0 comments on commit 7619427

Please sign in to comment.