+
+{footer_script require='jquery'}{literal}
+jQuery(document).ready(function () {
+ $('select[name="order_by"]').change(function () {
+ if ($(this).val() == 'custom') {
+ $('input[name="order_by_perso"]').show();
+ } else {
+ $('input[name="order_by_perso"]').hide();
+ }
+ });
+ $('select[name="order_by_inside_category"]').change(function () {
+ if ($(this).val() == 'custom') {
+ $('input[name="order_by_inside_category_perso"]').show();
+ } else {
+ $('input[name="order_by_inside_category_perso"]').hide();
+ }
+ });
+});
+{/literal}{/footer_script}
{/if}
diff --git a/install/config.sql b/install/config.sql
index 0fe30084e..22805cd8e 100644
--- a/install/config.sql
+++ b/install/config.sql
@@ -51,6 +51,8 @@ INSERT INTO piwigo_config (param,value,comment)
);
INSERT INTO piwigo_config (param,value,comment) VALUES ('week_starts_on','monday','Monday may not be the first day of the week');
INSERT INTO piwigo_config (param,value,comment) VALUES ('updates_ignored','a:3:{s:7:"plugins";a:0:{}s:6:"themes";a:0:{}s:9:"languages";a:0:{}}','Extensions ignored for update');
+INSERT INTO piwigo_config (param,value,comment) VALUES ('order_by',' ORDER BY date_available DESC, file ASC, id ASC','default photo order');
+INSERT INTO piwigo_config (param,value,comment) VALUES ('order_by_inside_category',' ORDER BY date_available DESC, file ASC, id ASC','default photo order inside category');
INSERT INTO piwigo_config (param,value) VALUES ('upload_form_websize_resize','true');
INSERT INTO piwigo_config (param,value) VALUES ('upload_form_websize_maxwidth','800');
INSERT INTO piwigo_config (param,value) VALUES ('upload_form_websize_maxheight','600');
diff --git a/install/db/106-database.php b/install/db/106-database.php
new file mode 100644
index 000000000..187754ebe
--- /dev/null
+++ b/install/db/106-database.php
@@ -0,0 +1,48 @@
+
\ No newline at end of file
diff --git a/language/en_UK/admin.lang.php b/language/en_UK/admin.lang.php
index 4457cdecb..1a06d530b 100644
--- a/language/en_UK/admin.lang.php
+++ b/language/en_UK/admin.lang.php
@@ -150,6 +150,7 @@ $lang['Apply to sub-albums'] = "Apply to sub-albums";
$lang['Are you sure to install this upgrade? You must verify if this version does not need uninstallation.'] = "Are you sure you want to install this upgrade? You must verify if this version does not need prior uninstallation.";
$lang['Are you sure you want to delete this plugin?'] = "Are you sure you want to delete this plugin?";
$lang['Are you sure you want to install this plugin?'] = "Are you sure you want to install this plugin?";
+$lang['As default order'] = "As default order";
$lang['Associate to album'] = "Associate to album";
$lang['associate to group'] = "associate to group";
$lang['Associated'] = "Associated";
@@ -202,6 +203,7 @@ $lang['Create the "%s" directory at the root of your Piwigo installation'] = 'Cr
$lang['Create this site'] = "Create this site";
$lang['created'] = "created";
$lang['Current name'] = "Current name";
+$lang['Custom'] = "Custom";
$lang['Database synchronization with files'] = "Database synchronization with files";
$lang['Database'] = "Database";
$lang['Date'] = "Date";
@@ -209,6 +211,8 @@ $lang['Day'] = "Day";
$lang['Deactivate'] = "Deactivate";
$lang['Deactivate all'] = "Deactivate all";
$lang['Default display'] = "Default display";
+$lang['Default photos order'] = "Default photos order";
+$lang['Default photos order inside album'] = "Default photos order inside album";
$lang['Default user cannot be deleted'] = "Default user cannot be deleted";
$lang['Default user does not exist'] = "The default user does not exist";
$lang['default values'] = "default values";
@@ -358,6 +362,7 @@ $lang['Install'] = "Install";
$lang['Installed Languages'] = 'Installed Languages';
$lang['Installed Themes'] = "Installed Themes";
$lang['Instructions to use Piwigo'] = "Instructions to use Piwigo";
+$lang['Invalid order string'] = 'Invalid order string';
$lang['Invert'] = 'Invert';
$lang['IP'] = "IP";
$lang['JPEG files or ZIP archives with JPEG files inside please.'] = 'JPEG files or ZIP archives with JPEG files inside please.';
diff --git a/language/en_UK/help/configuration.html b/language/en_UK/help/configuration.html
index 7fb8d537d..a2a913627 100644
--- a/language/en_UK/help/configuration.html
+++ b/language/en_UK/help/configuration.html
@@ -33,6 +33,20 @@ page.
Mail address is mandatory for all users: mail address will be checked on registration or profile update, except if the action is done by an administrator.
Email admins when a new user registers: administrators will be notified by mail for each registration.
+
+
Default photos order: You can define a personalized order by selecting «Personalized» in the drop-down menu. This field must respect the SQL syntax, example: date_available DESC, file ASC, id ASC
+ Available fields:
+
+
date_available: date of the adding to the gallery
+
file: name of the file
+
id: identifier
+
date_creation: date of element creation
+
name: name of the picture
+
hit: number of visits
+
average_rate: average rate on the picture
+
+ Don't forgot to specify the order for each field with these keywords : ASC and DESC
+
diff --git a/language/fr_FR/admin.lang.php b/language/fr_FR/admin.lang.php
index edc122917..b551498ca 100644
--- a/language/fr_FR/admin.lang.php
+++ b/language/fr_FR/admin.lang.php
@@ -842,9 +842,14 @@ $lang['Height'] = 'Hauteur';
$lang['Follow Orientation'] = "Respecter l'orientation";
$lang['If you want to regenerate thumbnails, please go to the Batch Manager.'] = 'Si vous voulez régénérer des miniatures, merci de vous rendre dans la Gestion par lot.';
$lang['Graphics Library'] = 'Bibliothèque graphique';
-$lang['Show menubar'] = "Afficher le menu";
-$lang['No results'] = "Pas de résultat";
-$lang['Type in a search term'] = "Entrez un terme de recherche";
-$lang['Searching...'] = "Recherche...";
-$lang['new'] = "nouveau";
+$lang['Show menubar'] = 'Afficher le menu';
+$lang['No results'] = 'Pas de résultat';
+$lang['Type in a search term'] = 'Entrez un terme de recherche';
+$lang['Searching...'] = 'Recherche...';
+$lang['new'] = 'nouveau';
+$lang['Default photos order'] = "Ordre par défaut des photos";
+$lang['Default photos order inside album'] = "Ordre par défaut des photos dans un album";
+$lang['Invalid order string'] = 'Chaîne SQL incorrecte';
+$lang['As default order'] = "Comme l'ordre par défaut";
+$lang['Custom'] = "Personnalisé";
?>
\ No newline at end of file
diff --git a/language/fr_FR/help/configuration.html b/language/fr_FR/help/configuration.html
index 45c29066a..e5c7a8eb3 100644
--- a/language/fr_FR/help/configuration.html
+++ b/language/fr_FR/help/configuration.html
@@ -33,6 +33,20 @@ galerie.
L'adresse mail est obligatoire pour tous les utilisateurs: L'adresse mail sera vérifié lors des inscriptions ou de la mise à jour des profils sauf si l'action est effectuée dans la partie administration.
Notifier les administrateurs lors de l'inscription d'un utilisateur: Les administrateurs recevront un courriel à chaque inscription.
+
+
Ordre par défaut des photos: Vous pouvez définir un ordre personnalisé et selectionant «Personnalisé» dans la liste déroulante. Ce champ doit respecter la syntaxe SQL, exemple: date_available DESC, file ASC, id ASC
+ Liste des champs utilisables :
+
+
date_available: date d'ajout à la galerie
+
file: nom du fichier
+
id: identifiant
+
date_creation: date de création
+
name: nom de l'image
+
hit: nombre de visites
+
average_rate: note globale
+
+ N'oubliez pas pour chaque champ de spécifier l'ordre avec les mots clefs ASC et DESC
+