diff --git a/admin/admin.php b/admin/admin.php
new file mode 100644
index 000000000..ce0f601e7
--- /dev/null
+++ b/admin/admin.php
@@ -0,0 +1,222 @@
+Open( '../template/'.$user['template'].'/admin/admin.vtp' );
+// language
+$vtp->setGlobalVar( $handle, 'page_title', $lang['title_default'] );
+$vtp->setGlobalVar( $handle, 'menu_title', $lang['menu_title'] );
+//--------------------------------------- validating page and creation of title
+$page_valide = false;
+switch ( $_GET['page'] )
+{
+ case 'ajout':
+ {
+ $titre = $lang['title_add'];
+ $page_valide = true;
+ break;
+ }
+ case 'user_list':
+ {
+ $titre = $lang['title_liste_users'];
+ $page_valide = true;
+ break;
+ }
+ case 'historique':
+ {
+ $titre = $lang['title_history'];
+ $page_valide = true;
+ break;
+ }
+ case 'miseajour':
+ {
+ $titre = $lang['title_update'];
+ $page_valide = true;
+ break;
+ }
+ case 'configuration':
+ {
+ $titre = $lang['title_configuration'];
+ $page_valide = true;
+ break;
+ }
+ case 'manuel':
+ {
+ $titre = $lang['title_instructions'];
+ $page_valide = true;
+ break;
+ }
+ case 'perm':
+ {
+ $titre = $lang['title_permissions'];
+ $page_valide = true;
+ break;
+ }
+ case 'cat':
+ {
+ $titre = $lang['title_categories'];
+ $page_valide = true;
+ break;
+ }
+ case 'edit_cat':
+ {
+ $titre = $lang['title_edit_cat'];
+ $page_valide = true;
+ break;
+ }
+ case 'infos_images':
+ {
+ $titre = $lang['title_info_images'];
+ $page_valide = true;
+ break;
+ }
+ case 'thumbnail':
+ {
+ $titre = $lang['title_thumbnails'];
+ if ( isset( $_GET['dir'] ) )
+ {
+ $titre.= ' '.$lang['title_thumbnails_2'].' ';
+ // $_GET['dir'] contient :
+ // ../galleries/vieux_lyon ou
+ // ../galleries/vieux_lyon/visite ou
+ // ../galleries/vieux_lyon/visite/truc ...
+ $dir = explode( "/", $_GET['dir'] );
+ $titre.= $dir[2];
+ for ( $i = 3; $i < sizeof( $dir ) - 1; $i++ )
+ {
+ $titre.= ' > '.$dir[$i];
+ }
+ $titre.= " ";
+ }
+ $page_valide = true;
+ break;
+ }
+ case 'waiting':
+ {
+ $titre = $lang['title_waiting'];
+ $page_valide = true;
+ break;
+ }
+ default:
+ {
+ $titre = $lang['title_default'];
+ break;
+ }
+}
+$vtp->setGlobalVar( $handle, 'title', $titre );
+//--------------------------------------------------------------------- summary
+$link_start = './admin.php?page=';
+// configuration
+$vtp->addSession( $handle, 'summary' );
+$vtp->setVar( $handle, 'summary.indent', '' );
+$vtp->setVar( $handle, 'summary.link',
+ add_session_id( $link_start.'configuration' ) );
+$vtp->setVar( $handle, 'summary.name', $lang['menu_config'] );
+$vtp->closeSession( $handle, 'summary' );
+// users
+$vtp->addSession( $handle, 'summary' );
+$vtp->setVar( $handle, 'summary.indent', '' );
+$vtp->setVar( $handle, 'summary.link',
+ add_session_id( $link_start.'liste_users' ) );
+$vtp->setVar( $handle, 'summary.name', $lang['menu_users'] );
+$vtp->closeSession( $handle, 'summary' );
+// user list
+$vtp->addSession( $handle, 'summary' );
+$vtp->setVar( $handle, 'summary.indent', ' ' );
+$vtp->setVar( $handle, 'summary.link',
+ add_session_id( $link_start.'user_list' ) );
+$vtp->setVar( $handle, 'summary.name', $lang['menu_list_user'] );
+$vtp->closeSession( $handle, 'summary' );
+// user add
+$vtp->addSession( $handle, 'summary' );
+$vtp->setVar( $handle, 'summary.indent', ' ' );
+$vtp->setVar( $handle, 'summary.link', add_session_id( $link_start.'ajout' ) );
+$vtp->setVar( $handle, 'summary.name', $lang['menu_add_user'] );
+$vtp->closeSession( $handle, 'summary' );
+// categories
+$vtp->addSession( $handle, 'summary' );
+$vtp->setVar( $handle, 'summary.indent', '' );
+$vtp->setVar( $handle, 'summary.link', add_session_id( $link_start.'cat' ) );
+$vtp->setVar( $handle, 'summary.name', $lang['menu_categories'] );
+$vtp->closeSession( $handle, 'summary' );
+// waiting
+$vtp->addSession( $handle, 'summary' );
+$vtp->setVar( $handle, 'summary.indent', '' );
+$vtp->setVar( $handle, 'summary.link',
+ add_session_id( $link_start.'waiting' ) );
+$query = 'select id from '.$prefixeTable.'waiting;';
+$result = mysql_query( $query );
+$nb_waiting = '';
+if ( mysql_num_rows( $result ) > 0 )
+{
+ $nb_waiting = ' [ '.mysql_num_rows( $result ).' ]';
+}
+$vtp->setVar( $handle, 'summary.name', $lang['menu_waiting'].$nb_waiting );
+$vtp->closeSession( $handle, 'summary' );
+// update
+$vtp->addSession( $handle, 'summary' );
+$vtp->setVar( $handle, 'summary.indent', '' );
+$vtp->setVar( $handle, 'summary.link',
+ add_session_id( $link_start.'miseajour' ) );
+$vtp->setVar( $handle, 'summary.name', $lang['menu_update'] );
+$vtp->closeSession( $handle, 'summary' );
+// thumbnails
+$vtp->addSession( $handle, 'summary' );
+$vtp->setVar( $handle, 'summary.indent', '' );
+$vtp->setVar( $handle, 'summary.link',
+ add_session_id( $link_start.'thumbnail' ) );
+$vtp->setVar( $handle, 'summary.name', $lang['menu_thumbnails'] );
+$vtp->closeSession( $handle, 'summary' );
+// history
+$vtp->addSession( $handle, 'summary' );
+$vtp->setVar( $handle, 'summary.indent', '' );
+$vtp->setVar( $handle, 'summary.link',
+ add_session_id( $link_start.'historique' ) );
+$vtp->setVar( $handle, 'summary.name', $lang['menu_history'] );
+$vtp->closeSession( $handle, 'summary' );
+// instructions
+$vtp->addSession( $handle, 'summary' );
+$vtp->setVar( $handle, 'summary.indent', '' );
+$vtp->setVar( $handle, 'summary.link',
+ add_session_id( $link_start.'manuel' ) );
+$vtp->setVar( $handle, 'summary.name', $lang['menu_instructions'] );
+$vtp->closeSession( $handle, 'summary' );
+// back to thumbnails page
+$vtp->addSession( $handle, 'summary' );
+$vtp->setVar( $handle, 'summary.indent', '' );
+$vtp->setVar( $handle, 'summary.link', add_session_id( '../category.php' ) );
+$vtp->setVar( $handle, 'summary.name', $lang['menu_back'] );
+$vtp->closeSession( $handle, 'summary' );
+//------------------------------------------------------------- content display
+if ( $page_valide )
+{
+ include ( $_GET['page'].'.php' );
+}
+else
+{
+ $vtp->setVar( $handle, 'sub',
+ '
'.
+ $lang['default_message'].
+ '
' );
+}
+//----------------------------------------------------------- html code display
+$code = $vtp->Display( $handle, 0 );
+echo $code;
+?>
\ No newline at end of file
diff --git a/admin/ajout.php b/admin/ajout.php
new file mode 100644
index 000000000..3ae1fa2f8
--- /dev/null
+++ b/admin/ajout.php
@@ -0,0 +1,326 @@
+".$lang['user_err_modify']."";
+ $absent = true;
+ }
+ if ( $HTTP_GET_VARS['mode'] == "modif" )
+ {
+ if ( $pseudo == "" )
+ {
+ echo"".$lang['user_err_unknown']."
";
+ $absent = true;
+ }
+ }
+ if ( !$absent )
+ {
+ if ( $HTTP_GET_VARS['valider'] == 1 )
+ {
+ $i = 0;
+ // le pseudo ne doit pas
+ // 1. être vide
+ // 2. commencer ou se terminer par un espace
+ // 3. comporter les caractères ' ou "
+ // 4. être déjà utilisé
+ // Notes sur le pseudo du webmaster :
+ // - lorsque l'on trouve plusieurs occurences consécutives du caractère espace, on réduit à une seule occurence
+ if ( $HTTP_GET_VARS['mode'] != "modif" )
+ {
+ if ( $HTTP_POST_VARS['pseudo'] == "" )
+ {
+ $error[$i++] = $lang['reg_err_login1'];
+ }
+ $pseudo = ereg_replace( "[ ]{2,}", " ", $HTTP_POST_VARS['pseudo'] );
+ if ( ereg( "^.* $", $pseudo) )
+ {
+ $error[$i++] = $lang['reg_err_login2'];
+ }
+ if ( ereg( "^ .*$", $pseudo) )
+ {
+ $error[$i++] = $lang['reg_err_login3'];
+ }
+ if ( ereg( "'",$pseudo ) || ereg( "\"",$pseudo ) )
+ {
+ $error[$i++] = $lang['reg_err_login4'];
+ }
+ else
+ {
+ $query = "select id from $prefixeTable"."users where pseudo = '$pseudo';";
+ $result = mysql_query( $query );
+ if ( mysql_num_rows( $result ) > 0 )
+ {
+ $error[$i++] = "".$lang['reg_err_login5']." ";
+ }
+ }
+ }
+ // le mail doit être conforme à qqch du type : nom@serveur.com
+ if( $HTTP_POST_VARS['mail_address'] != "" && !ereg( "([_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+)", $HTTP_POST_VARS['mail_address'] ) )
+ {
+ $error[$i++] = $lang['reg_err_mail_address'];
+ }
+ // mis à jour des variables pour ne pas afficher celles issue de la BD
+ $pseudo = $HTTP_POST_VARS['pseudo'];
+ $password = $HTTP_POST_VARS['password'];
+ $status = $HTTP_POST_VARS['status'];
+ $mail_address = $HTTP_POST_VARS['mail_address'];
+ // on met à jour les paramètres de l'applicaiton dans le cas où il n'y aucune erreur
+ if ( sizeof( $error ) == 0 && $HTTP_GET_VARS['mode'] != "modif" )
+ {
+ // 1.récupération des valeurs par défaut de l'application pour nombre_image_ligne,nombre_ligne_page,couleur,language
+ $row = mysql_fetch_array( mysql_query( "select nombre_image_ligne,nombre_ligne_page,theme,language from $prefixeTable"."users where pseudo = 'visiteur';" ) );
+ // 2.ajout du nouvel utilisateur
+ $query = "insert into $prefixeTable"."users (pseudo,password,mail_address,nombre_image_ligne,nombre_ligne_page,theme,language,status) values ('$pseudo','".md5( $HTTP_POST_VARS['password'] )."',";
+ if ( $HTTP_POST_VARS['mail_address'] != "" )
+ {
+ $query.= "'".$HTTP_POST_VARS['mail_address']."'";
+ }
+ else
+ {
+ $query.= "NULL";
+ }
+ $query.= ",'".$row['nombre_image_ligne']."','".$row['nombre_ligne_page']."','".$row['theme']."','".$row['language']."','".$HTTP_POST_VARS['status']."');";
+ mysql_query( $query );
+ // 3. récupérer l'identifiant de l'utilisateur nouvellement créé
+ $row = mysql_fetch_array( mysql_query( "select id from $prefixeTable"."users where pseudo = '$pseudo';" ) );
+ $user_id = $row['id'];
+ // 4.ajouter les restrictions au nouvel utilisateur, les mêmes que celles de l'utilisateur par défaut
+ $query = "select cat_id ";
+ $query.= "from $prefixeTable"."restrictions as r,$prefixeTable"."users as u ";
+ $query.= "where u.id = r.user_id ";
+ $query.= "and u.pseudo = 'visiteur';";
+ $result = mysql_query( $query );
+ while( $row = mysql_fetch_array( $result ) )
+ {
+ mysql_query ( "insert into $prefixeTable"."restrictions (user_id,cat_id) values ('$user_id','".$row['cat_id']."');" );
+ }
+ }
+ if ( sizeof( $error ) == 0 && $HTTP_GET_VARS['mode'] == "modif" )
+ {
+ $query = "update $prefixeTable"."users";
+ $query.= " set status = '".$HTTP_POST_VARS['status']."'";
+ if ( $HTTP_POST_VARS['use_new_pwd'] == 1 )
+ {
+ $query.= ", password = '".md5( $HTTP_POST_VARS['password'] )."'";
+ }
+ $query.= ", mail_address = ";
+ if ( $HTTP_POST_VARS['mail_address'] != "" )
+ {
+ $query.= "'".$HTTP_POST_VARS['mail_address']."'";
+ }
+ else
+ {
+ $query.= "NULL";
+ }
+ $query.= " where id = '".$HTTP_GET_VARS['user_id']."';";
+ mysql_query( $query );
+ }
+ }
+ if ( sizeof( $error ) > 0 )
+ {
+ echo "".$lang['adduser_err_message'].sizeof( $error )." :";
+ echo "
";
+ for ( $i = 0; $i < sizeof( $error ); $i++ )
+ {
+ echo "".$error[$i]." ";
+ }
+ echo " ";
+ echo "
";
+ }
+ if ( sizeof( $error ) == 0 && $HTTP_GET_VARS['valider'] == 1 )
+ {
+ echo"".$lang['adduser_info_message']."\"$pseudo\" ";
+ if ( $HTTP_POST_VARS['use_new_pwd'] == 1 )
+ {
+ echo $lang['adduser_info_password_updated']." ";
+ }
+ echo"[
".$lang['adduser_info_back']." ]
";
+ }
+ if ( $HTTP_GET_VARS['valider'] != 1 || $HTTP_GET_VARS['mode'] != "modif" || sizeof( $error ) > 0 )
+ {
+ if ( $HTTP_GET_VARS['mode'] != "modif" && sizeof( $error ) == 0 )
+ {
+ unset( $pseudo, $password, $status, $mail_address );
+ }
+ if ( !isset( $HTTP_POST_VARS['use_new_pwd'] ) || $HTTP_POST_VARS['use_new_pwd'] != 1 )
+ {
+ unset( $password );
+ }
+ $action = "./admin.php?page=ajout&valider=1";
+ if ( $HTTP_GET_VARS['mode'] == "modif" )
+ {
+ $action.= "&mode=modif&user_id=".$HTTP_GET_VARS['user_id'];
+ }
+ echo"";
+ if ( $HTTP_GET_VARS['mode'] == "modif" )
+ {
+ echo "";
+ }
+ }
+ }
+?>
\ No newline at end of file
diff --git a/admin/cat.php b/admin/cat.php
new file mode 100644
index 000000000..2033d667d
--- /dev/null
+++ b/admin/cat.php
@@ -0,0 +1,282 @@
+Open( '../template/'.$user['template'].'/admin/cat.vtp' );
+// language
+$vtp->setGlobalVar( $sub, 'cat_edit', $lang['cat_edit'] );
+$vtp->setGlobalVar( $sub, 'cat_up', $lang['cat_up'] );
+$vtp->setGlobalVar( $sub, 'cat_down', $lang['cat_down'] );
+$vtp->setGlobalVar( $sub, 'cat_image_info', $lang['cat_image_info'] );
+$vtp->setGlobalVar( $sub, 'cat_permission', $lang['cat_permission'] );
+$vtp->setGlobalVar( $sub, 'cat_update', $lang['cat_update'] );
+//--------------------------------------------------------------- rank updates
+if ( isset( $_GET['up'] ) && is_numeric( $_GET['up'] ) )
+{
+ // 1. searching level (id_uppercat)
+ // and rank of the category to move
+ $query = 'select id_uppercat,rank';
+ $query.= ' from '.$prefixeTable.'categories';
+ $query.= ' where id = '.$_GET['up'];
+ $query.= ';';
+ $row = mysql_fetch_array( mysql_query( $query ) );
+ $level = $row['id_uppercat'];
+ $rank = $row['rank'];
+ // 2. searching the id and the rank of the category
+ // just above at the same level
+ $query = 'select id,rank';
+ $query.= ' from '.$prefixeTable.'categories';
+ $query.= ' where rank < '.$rank;
+ if ( $level == '' )
+ {
+ $query.= ' and id_uppercat is null';
+ }
+ else
+ {
+ $query.= ' and id_uppercat = '.$level;
+ }
+ $query.= ' order by rank desc';
+ $query.= ' limit 0,1';
+ $query.= ';';
+ $row = mysql_fetch_array( mysql_query( $query ) );
+ $new_rank = $row['rank'];
+ $replaced_cat = $row['id'];
+ // 3. exchanging ranks between the two categories
+ $query = 'update '.$prefixeTable.'categories';
+ $query.= ' set rank = '.$new_rank;
+ $query.= ' where id = '.$_GET['up'];
+ $query.= ';';
+ mysql_query( $query );
+ $query = 'update '.$prefixeTable.'categories';
+ $query.= ' set rank = '.$rank;
+ $query.= ' where id = '.$replaced_cat;
+ $query.= ';';
+ mysql_query( $query );
+}
+if ( isset( $_GET['down'] ) && is_numeric( $_GET['down'] ) )
+{
+ // 1. searching level (id_uppercat)
+ // and rank of the category to move
+ $query = 'select id_uppercat,rank';
+ $query.= ' from '.$prefixeTable.'categories';
+ $query.= ' where id = '.$_GET['down'];
+ $query.= ';';
+ $row = mysql_fetch_array( mysql_query( $query ) );
+ $level = $row['id_uppercat'];
+ $rank = $row['rank'];
+ // 2. searching the id and the rank of the category
+ // just below at the same level
+ $query = 'select id,rank';
+ $query.= ' from '.$prefixeTable.'categories';
+ $query.= ' where rank > '.$rank;
+ if ( $level == '' )
+ {
+ $query.= ' and id_uppercat is null';
+ }
+ else
+ {
+ $query.= ' and id_uppercat = '.$level;
+ }
+ $query.= ' order by rank asc';
+ $query.= ' limit 0,1';
+ $query.= ';';
+ $row = mysql_fetch_array( mysql_query( $query ) );
+ $new_rank = $row['rank'];
+ $replaced_cat = $row['id'];
+ // 3. exchanging ranks between the two categories
+ $query = 'update '.$prefixeTable.'categories';
+ $query.= ' set rank = '.$new_rank;
+ $query.= ' where id = '.$_GET['down'];
+ $query.= ';';
+ mysql_query( $query );
+ $query = 'update '.$prefixeTable.'categories';
+ $query.= ' set rank = '.$rank;
+ $query.= ' where id = '.$replaced_cat;
+ $query.= ';';
+ mysql_query( $query );
+}
+//------------------------------------------------------------------ reordering
+function ordering( $id_uppercat )
+{
+ global $prefixeTable;
+
+ $rank = 1;
+
+ $query = 'select id';
+ $query.= ' from '.$prefixeTable.'categories';
+ if ( !is_numeric( $id_uppercat ) )
+ {
+ $query.= ' where id_uppercat is NULL';
+ }
+ else
+ {
+ $query.= ' where id_uppercat = '.$id_uppercat;
+ }
+ $query.= ' order by rank asc, dir asc';
+ $query.= ';';
+ $result = mysql_query( $query );
+ while ( $row = mysql_fetch_array( $result ) )
+ {
+ $query = 'update '.$prefixeTable.'categories';
+ $query.= ' set rank = '.$rank;
+ $query.= ' where id = '.$row['id'];
+ $query.= ';';
+ mysql_query( $query );
+ $rank++;
+ ordering( $row['id'] );
+ }
+}
+
+ordering( 'NULL' );
+//----------------------------------------------------affichage de la page
+function display_cat_manager( $id_uppercat, $indent,
+ $uppercat_visible, $level )
+{
+ global $prefixeTable,$lang,$conf,$sub,$vtp;
+
+ // searching the min_rank and the max_rank of the category
+ $query = 'select min(rank) as min, max(rank) as max';
+ $query.= ' from '.$prefixeTable.'categories';
+ if ( !is_numeric( $id_uppercat ) )
+ {
+ $query.= ' where id_uppercat is NULL';
+ }
+ else
+ {
+ $query.= ' where id_uppercat = '.$id_uppercat;
+ }
+ $query.= ';';
+ $result = mysql_query( $query );
+ $row = mysql_fetch_array( $result );
+ $min_rank = $row['min'];
+ $max_rank = $row['max'];
+
+ // will we use or lines ?
+ $td = 'td';
+ $class = '';
+ if ( $level > 0 )
+ {
+ $class = 'row'.$level;
+ }
+ else
+ {
+ $td = 'th';
+ }
+
+ $query = 'select id,name,dir,nb_images,status,rank,site_id';
+ $query.= ' from '.$prefixeTable.'categories';
+ if ( !is_numeric( $id_uppercat ) )
+ {
+ $query.= ' where id_uppercat is NULL';
+ }
+ else
+ {
+ $query.= ' where id_uppercat = '.$id_uppercat;
+ }
+ $query.= ' order by rank asc';
+ $query.= ';';
+ $result = mysql_query( $query );
+ while ( $row = mysql_fetch_array( $result ) )
+ {
+ $subcat_visible = true;
+
+ $vtp->addSession( $sub, 'cat' );
+ $vtp->setVar( $sub, 'cat.td', $td );
+ $vtp->setVar( $sub, 'cat.class', $class );
+ $vtp->setVar( $sub, 'cat.indent', $indent );
+ if ( $row['name'] == '' )
+ {
+ $name = str_replace( '_', ' ', $row['dir'] );
+ }
+ else
+ {
+ $name = $row['name'];
+ }
+ $vtp->setVar( $sub, 'cat.name', $name );
+ $vtp->setVar( $sub, 'cat.dir', $row['dir'] );
+ if ( $row['status'] == 'invisible' || !$uppercat_visible )
+ {
+ $subcat_visible = false;
+ $vtp->setVar( $sub, 'cat.invisible', $lang['cat_invisible'] );
+ }
+ $vtp->setVar( $sub, 'cat.nb_picture', $row['nb_images'] );
+ $url = add_session_id( './admin.php?page=edit_cat&cat='.$row['id'] );
+ $vtp->setVar( $sub, 'cat.edit_url', $url );
+ if ( $row['rank'] != $min_rank )
+ {
+ $vtp->addSession( $sub, 'up' );
+ $url = add_session_id( './admin.php?page=cat&up='.$row['id'] );
+ $vtp->setVar( $sub, 'up.up_url', $url );
+ $vtp->closeSession( $sub, 'up' );
+ }
+ else
+ {
+ $vtp->addSession( $sub, 'no_up' );
+ $vtp->closeSession( $sub, 'no_up' );
+ }
+ if ( $row['rank'] != $max_rank )
+ {
+ $vtp->addSession( $sub, 'down' );
+ $url = add_session_id( './admin.php?page=cat&down='.$row['id'] );
+ $vtp->setVar( $sub, 'down.down_url', $url );
+ $vtp->closeSession( $sub, 'down' );
+ }
+ else
+ {
+ $vtp->addSession( $sub, 'no_down' );
+ $vtp->closeSession( $sub, 'no_down' );
+ }
+ if ( $row['nb_images'] > 0 )
+ {
+ $vtp->addSession( $sub, 'image_info' );
+ $url = add_session_id( './admin.php?page=infos_images&cat_id='
+ .$row['id'] );
+ $vtp->setVar( $sub, 'image_info.image_info_url', $url );
+ $vtp->closeSession( $sub, 'image_info' );
+ }
+ else
+ {
+ $vtp->addSession( $sub, 'no_image_info' );
+ $vtp->closeSession( $sub, 'no_image_info' );
+ }
+ $url = add_session_id( './admin.php?page=perm&cat_id='.$row['id'] );
+ $vtp->setVar( $sub, 'cat.permission_url', $url );
+ if ( $row['site_id'] == 1 )
+ {
+ $vtp->addSession( $sub, 'update' );
+ $url = add_session_id('./admin.php?page=update&update='.$row['id']);
+ $vtp->setVar( $sub, 'update.update_url', $url );
+ $vtp->closeSession( $sub, 'update' );
+ }
+ else
+ {
+ $vtp->addSession( $sub, 'no_update' );
+ $vtp->closeSession( $sub, 'no_update' );
+ }
+
+ $vtp->closeSession( $sub, 'cat' );
+
+ display_cat_manager( $row['id'], $indent.str_repeat( ' ', 4 ),
+ $subcat_visible, $level + 1 );
+ }
+}
+display_cat_manager( 'NULL', str_repeat( ' ', 4 ), true, 0 );
+//----------------------------------------------------------- sending html code
+$vtp->Parse( $handle , 'sub', $sub );
+?>
\ No newline at end of file
diff --git a/admin/configuration.php b/admin/configuration.php
new file mode 100644
index 000000000..6f1726f06
--- /dev/null
+++ b/admin/configuration.php
@@ -0,0 +1,912 @@
+
+/***************************************************************************
+ * configuration.php is a part of PhpWebGallery *
+ * ------------------- *
+ * last update : Tuesday, July 16, 2002 *
+ * email : pierrick@z0rglub.com *
+ * *
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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; *
+ * *
+ ***************************************************************************/
+
+include_once( './include/isadmin.inc.php' );
+
+$Caracs = array("¥" => "Y", "µ" => "u", "À" => "A", "Á" => "A",
+ "Â" => "A", "Ã" => "A", "Ä" => "A", "Å" => "A",
+ "Æ" => "A", "Ç" => "C", "È" => "E", "É" => "E",
+ "Ê" => "E", "Ë" => "E", "Ì" => "I", "Í" => "I",
+ "Î" => "I", "Ï" => "I", "Ð" => "D", "Ñ" => "N",
+ "Ò" => "O", "Ó" => "O", "Ô" => "O", "Õ" => "O",
+ "Ö" => "O", "Ø" => "O", "Ù" => "U", "Ú" => "U",
+ "Û" => "U", "Ü" => "U", "Ý" => "Y", "ß" => "s",
+ "à" => "a", "á" => "a", "â" => "a", "ã" => "a",
+ "ä" => "a", "å" => "a", "æ" => "a", "ç" => "c",
+ "è" => "e", "é" => "e", "ê" => "e", "ë" => "e",
+ "ì" => "i", "í" => "i", "î" => "i", "ï" => "i",
+ "ð" => "o", "ñ" => "n", "ò" => "o", "ó" => "o",
+ "ô" => "o", "õ" => "o", "ö" => "o", "ø" => "o",
+ "ù" => "u", "ú" => "u", "û" => "u", "ü" => "u",
+ "ý" => "y", "ÿ" => "y");
+//------------------------------ verification and registration of modifications
+$conf_infos = array( 'prefixe_thumbnail', 'webmaster', 'mail_webmaster',
+ 'acces', 'session_id_size', 'session_time',
+ 'session_keyword', 'max_user_listbox', 'show_comments',
+ 'nb_comment_page', 'upload_available',
+ 'upload_maxfilesize', 'upload_maxwidth',
+ 'upload_maxheight', 'upload_maxwidth_thumbnail',
+ 'upload_maxheight_thumbnail' );
+$default_user_infos = array( 'nb_image_line', 'nb_line_page', 'theme',
+ 'language', 'maxwidth', 'maxheight', 'expand',
+ 'show_nb_comments', 'short_period', 'long_period',
+ 'template' );
+$error = array();
+$i = 0;
+if ( $_GET['valider'] == 1 )
+{
+ //purge de la table des session si demandé
+ if ( $_POST['empty_session_table'] == 1 )
+ {
+ $query = 'delete from '.$prefixeTable.'sessions';
+ $query.= ' where expiration < '.time().';';
+ mysql_query( $query );
+ }
+ // deletion of site as asked
+ $query = 'select id';
+ $query.= ' from '.$prefixeTable.'sites';
+ $query.= " where galleries_url <> './galleries/';";
+ $result = mysql_query( $query );
+ while ( $row = mysql_fetch_array( $result ) )
+ {
+ $site = 'delete_site_'.$row['id'];
+ if ( $_POST[$site] == 1 )
+ {
+ delete_site( $row['id'] );
+ }
+ }
+ // le préfixe des thumbnails ne doit pas comporter d'accent
+ $ancien_prefixe = $_POST['prefixe_thumbnail'];
+ $prefixe = strtr( $_POST['prefixe_thumbnail'], $Caracs );
+ if ( $ancien_prefixe != $prefixe )
+ {
+ $error[$i++] = $lang['conf_err_prefixe'];
+ }
+ // le mail doit être conforme à qqch du type : nom@serveur.com
+ if ( !ereg( "([_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+)",
+ $_POST['mail_webmaster'] ) )
+ {
+ $error[$i++] = $lang['conf_err_mail'];
+ }
+ // les période doivent être des entiers, il représentent des nombres de jours
+ if ( !ereg( "^[0-9]*$", $_POST['short_period'] )
+ || !ereg("^[0-9]*$", $_POST['long_period'] ) )
+ {
+ $error[$i++] = $lang['err_periods'];
+ }
+ else
+ {
+ // la période longue doit être supérieure à la période courte
+ if ( $_POST['long_period'] <= $_POST['short_period']
+ || $_POST['short_period'] <= 0 )
+ {
+ $error[$i++] = $lang['err_periods_2'];
+ }
+ }
+ //la taille de l'id de session doit être un entier entre 4 et 50
+ if ( !ereg( "^[1-9][0-9]*$", $_POST['session_id_size'] )
+ || $_POST['session_id_size'] < 4
+ || $_POST['session_id_size'] > 50 )
+ {
+ $error[$i++] = $lang['conf_err_sid_size'];
+ }
+ // la durée de la session doit être un entier
+ // supérieur à 5 et inférieur à 60 minutes
+ if ( !ereg( "^[1-9][0-9]?$", $_POST['session_time'] )
+ || $_POST['session_time'] < 5
+ || $_POST['session_time'] > 60 )
+ {
+ $error[$i++] = $lang['conf_err_sid_time'];
+ }
+ // max_user_listbox doit être un entier compris entre 0 et 255 inclus
+ if ( !ereg( "^[0-9]{0,3}$", $_POST['max_user_listbox'] )
+ || $_POST['max_user_listbox'] < 0
+ || $_POST['max_user_listbox'] > 255 )
+ {
+ $error[$i++] = $lang['conf_err_max_user_listbox'];
+ }
+ // le nombre de commentaires par page doit être compris entre 5 en 50 inclus
+ if ( !ereg( "^[1-9][0-9]?$", $_POST['nb_comment_page'] )
+ || $_POST['nb_comment_page'] < 5
+ || $_POST['nb_comment_page'] > 50 )
+ {
+ $error[$i++] = $lang['conf_err_comment_number'];
+ }
+ // le poids maximum des fichiers uploadé doit être un entier,
+ // compris entre 10 et 1000
+ if ( !ereg( "^[1-9][0-9]*$", $_POST['upload_maxfilesize'] )
+ || $_POST['upload_maxfilesize'] < 10
+ || $_POST['upload_maxfilesize'] > 1000 )
+ {
+ $error[$i++] = $lang['conf_err_upload_maxfilesize'];
+ }
+ // la largeur maximum des images uploadées doit être un entier,
+ // supérieur à 10
+ if ( !ereg( "^[1-9][0-9]*$", $_POST['upload_maxwidth'] )
+ || $_POST['upload_maxwidth'] < 10 )
+ {
+ $error[$i++] = $lang['conf_err_upload_maxwidth'];
+ }
+ // la hauteur maximum des images uploadées doit être un entier,
+ // supérieur à 10
+ if ( !ereg( "^[1-9][0-9]*$", $_POST['upload_maxheight'] )
+ || $_POST['upload_maxheight'] < 10 )
+ {
+ $error[$i++] = $lang['conf_err_upload_maxheight'];
+ }
+ // la largeur maximum des miniatures uploadées doit être un entier,
+ // supérieur à 10
+ if ( !ereg( "^[1-9][0-9]*$", $_POST['upload_maxwidth_thumbnail'] )
+ || $_POST['upload_maxwidth_thumbnail'] < 10 )
+ {
+ $error[$i++] = $lang['conf_err_upload_maxwidth_thumbnail'];
+ }
+ // la hauteur maximum des miniatures uploadées doit être un entier,
+ // supérieur à 10
+ if ( !ereg( "^[1-9][0-9]*$", $_POST['upload_maxheight_thumbnail'] )
+ || $_POST['upload_maxheight_thumbnail'] < 10 )
+ {
+ $error[$i++] = $lang['conf_err_upload_maxheight_thumbnail'];
+ }
+ if ( $_POST['maxwidth'] != '' )
+ {
+ if ( !ereg( "^[0-9]{2,}$", $_POST['maxwidth'] )
+ || $_POST['maxwidth'] < 50 )
+ {
+ $error[$i++] = $lang['err_maxwidth'];
+ }
+ }
+ if ( $_POST['maxheight'] != '' )
+ {
+ if ( !ereg( "^[0-9]{2,}$", $_POST['maxheight'] )
+ || $_POST['maxheight'] < 50 )
+ {
+ $error[$i++] = $lang['err_maxheight'];
+ }
+ }
+ // on met à jour les paramètres de l'application
+ // dans le cas où il n'y aucune erreurs
+ if ( sizeof( $error ) == 0 )
+ {
+ mysql_query( 'delete from '.$prefixeTable.'config;' );
+ $query = 'insert into '.$prefixeTable.'config';
+ $query.= ' (';
+ for ( $i = 0; $i < sizeof( $conf_infos ); $i++ )
+ {
+ if ( $i > 0 )
+ {
+ $query.= ',';
+ }
+ $query.= $conf_infos[$i];
+ }
+ $query.= ')';
+ $query.= ' values';
+ $query.= ' (';
+ for ( $i = 0; $i < sizeof( $conf_infos ); $i++ )
+ {
+ if ( $i > 0 )
+ {
+ $query.= ',';
+ }
+ if ( $_POST[$conf_infos[$i]] == '' )
+ {
+ $query.= 'NULL';
+ }
+ else
+ {
+ $query.= "'".$_POST[$conf_infos[$i]]."'";
+ }
+ }
+ $query.= ')';
+ $query.= ';';
+ echo $query;
+ mysql_query( $query );
+
+ $tab_theme = explode( ' - ', $_POST['theme'] );
+ $_POST['theme'] = $tab_theme[0].'/'.$tab_theme[1];
+
+ $query = 'update '.$prefixeTable.'users';
+ $query.= ' set';
+ for ( $i = 0; $i < sizeof( $default_user_infos ); $i++ )
+ {
+ if ( $i > 0 )
+ {
+ $query.= ',';
+ }
+ else
+ {
+ $query.= ' ';
+ }
+ $query.= $default_user_infos[$i];
+ $query.= ' = ';
+ if ( $_POST[$default_user_infos[$i]] == '' )
+ {
+ $query.= 'NULL';
+ }
+ else
+ {
+ $query.= "'".$_POST[$default_user_infos[$i]]."'";
+ }
+ }
+ $query.= " where pseudo = 'visiteur';";
+ mysql_query( $query );
+ }
+//--------------------------------------------------------- data initialization
+ for ( $i = 0; $i < sizeof( $conf_infos ); $i++ )
+ {
+ $$conf_infos[$i] = $_POST[$conf_infos[$i]];
+ }
+ for ( $i = 0; $i < sizeof( $default_user_infos ); $i++ )
+ {
+ $$default_user_infos[$i] = $_POST[$default_user_infos[$i]];
+ }
+}
+else
+{
+//--------------------------------------------------------- data initialization
+ $query = 'select';
+ for ( $i = 0; $i < sizeof( $conf_infos ); $i++ )
+ {
+ if ( $i > 0 )
+ {
+ $query.= ',';
+ }
+ else
+ {
+ $query.= ' ';
+ }
+ $query.= $conf_infos[$i];
+ }
+ $query .= ' from '.$prefixeTable.'config;';
+
+ $row = mysql_fetch_array( mysql_query( $query ) );
+
+ for ( $i = 0; $i < sizeof( $conf_infos ); $i++ )
+ {
+ $$conf_infos[$i] = $row[$conf_infos[$i]];
+ }
+ $query = 'select';
+ for ( $i = 0; $i < sizeof( $default_user_infos ); $i++ )
+ {
+ if ( $i > 0 )
+ {
+ $query.= ',';
+ }
+ else
+ {
+ $query.= ' ';
+ }
+ $query.= $default_user_infos[$i];
+ }
+ $query .= ' from '.$prefixeTable.'users';
+ $query.= " where pseudo ='visiteur';";
+
+ $row = mysql_fetch_array( mysql_query( $query ) );
+
+ for ( $i = 0; $i < sizeof( $default_user_infos ); $i++ )
+ {
+ $$default_user_infos[$i] = $row[$default_user_infos[$i]];
+ }
+}
+//----------------------------------------------------- template initialization
+$sub = $vtp->Open( '../template/'.$user['template'].
+ '/admin/configuration.vtp' );
+// language
+$vtp->setGlobalVar( $sub, 'conf_confirmation', $lang['conf_confirmation'] );
+$vtp->setGlobalVar( $sub, 'conf_remote_site_title',
+ $lang['conf_remote_site_title'] );
+$vtp->setGlobalVar( $sub, 'delete', $lang['delete'] );
+$vtp->setGlobalVar( $sub, 'conf_remote_site_delete_info',
+ $lang['conf_remote_site_delete_info'] );
+$vtp->setGlobalVar( $sub, 'submit', $lang['submit'] );
+//-------------------------------------------------------------- errors display
+if ( sizeof( $error ) != 0 )
+{
+ $vtp->addSession( $sub, 'errors' );
+ for ( $i = 0; $i < sizeof( $error ); $i++ )
+ {
+ $vtp->addSession( $sub, 'li' );
+ $vtp->setVar( $sub, 'li.li', $error[$i] );
+ $vtp->closeSession( $sub, 'li' );
+ }
+ $vtp->closeSession( $sub, 'errors' );
+}
+//-------------------------------------------------------- confirmation display
+if ( sizeof( $error ) == 0 && $_GET['valider'] == 1 )
+{
+ $vtp->addSession( $sub, 'confirmation' );
+ $vtp->closeSession( $sub, 'confirmation' );
+}
+//----------------------------------------------------------------- form action
+$form_action = add_session_id( './admin.php?page=configuration&valider=1' );
+$vtp->setVar( $sub, 'form_action', $form_action );
+//------------------------------------------------------- general configuration
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'title_line' );
+$vtp->setVar( $sub, 'title_line.title', $lang['conf_general_title'] );
+$vtp->closeSession( $sub, 'title_line' );
+$vtp->closeSession( $sub, 'line' );
+
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'line' );
+// webmaster name
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['conf_general_webmaster'] );
+$vtp->addSession( $sub, 'hidden' );
+$vtp->setVar( $sub, 'hidden.text', $webmaster );
+$vtp->setVar( $sub, 'hidden.name', 'webmaster' );
+$vtp->setVar( $sub, 'hidden.value', $webmaster );
+$vtp->closeSession( $sub, 'hidden' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_general_webmaster_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// webmaster mail address
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['conf_general_mail'] );
+$vtp->addSession( $sub, 'text' );
+$vtp->setVar( $sub, 'text.name', 'mail_webmaster' );
+$vtp->setVar( $sub, 'text.value', $mail_webmaster );
+$vtp->closeSession( $sub, 'text' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_general_mail_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// prefix for thumbnails
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['conf_general_prefix'] );
+$vtp->addSession( $sub, 'text' );
+$vtp->setVar( $sub, 'text.name', 'prefixe_thumbnail' );
+$vtp->setVar( $sub, 'text.value', $prefixe_thumbnail );
+$vtp->closeSession( $sub, 'text' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_general_prefix_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// access type
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['conf_general_access'] );
+$vtp->addSession( $sub, 'group' );
+$vtp->addSession( $sub, 'radio' );
+$vtp->setVar( $sub, 'radio.name', 'acces' );
+$vtp->setVar( $sub, 'radio.value', 'libre' );
+$vtp->setVar( $sub, 'radio.option', $lang['conf_general_access_1'] );
+$checked = '';
+if ( $acces == 'libre' )
+{
+ $checked = ' checked="checked"';
+}
+$vtp->setVar( $sub, 'radio.checked', $checked );
+$vtp->closeSession( $sub, 'radio' );
+$vtp->addSession( $sub, 'radio' );
+$vtp->setVar( $sub, 'radio.name', 'acces' );
+$vtp->setVar( $sub, 'radio.value', 'restreint' );
+$vtp->setVar( $sub, 'radio.option', $lang['conf_general_access_2'] );
+$checked = '';
+if ( $acces == 'restreint' )
+{
+ $checked = ' checked="checked"';
+}
+$vtp->setVar( $sub, 'radio.checked', $checked );
+$vtp->closeSession( $sub, 'radio' );
+$vtp->closeSession( $sub, 'group' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_general_access_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// maximum user number to display in the listbox of identification page
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name',
+ $lang['conf_general_max_user_listbox'] );
+$vtp->addSession( $sub, 'text' );
+$vtp->setVar( $sub, 'text.name', 'max_user_listbox' );
+$vtp->setVar( $sub, 'text.value', $max_user_listbox );
+$vtp->closeSession( $sub, 'text' );
+$vtp->setVar( $sub, 'param_line.def',
+ $lang['conf_general_max_user_listbox_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'line' );
+//------------------------------------------------------ comments configuration
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'title_line' );
+$vtp->setVar( $sub, 'title_line.title', $lang['conf_comments_title'] );
+$vtp->closeSession( $sub, 'title_line' );
+$vtp->closeSession( $sub, 'line' );
+
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'line' );
+// show comments ?
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['conf_comments_show_comments'] );
+$vtp->addSession( $sub, 'group' );
+$vtp->addSession( $sub, 'radio' );
+$vtp->setVar( $sub, 'radio.name', 'show_comments' );
+$vtp->setVar( $sub, 'radio.value', 'true' );
+$vtp->setVar( $sub, 'radio.option', $lang['yes'] );
+$checked = '';
+if ( $show_comments == 'true' )
+{
+ $checked = ' checked="checked"';
+}
+$vtp->setVar( $sub, 'radio.checked', $checked );
+$vtp->closeSession( $sub, 'radio' );
+$vtp->addSession( $sub, 'radio' );
+$vtp->setVar( $sub, 'radio.name', 'show_comments' );
+$vtp->setVar( $sub, 'radio.value', 'false' );
+$vtp->setVar( $sub, 'radio.option', $lang['no'] );
+$checked = '';
+if ( $show_comments == 'false' )
+{
+ $checked = ' checked="checked"';
+}
+$vtp->setVar( $sub, 'radio.checked', $checked );
+$vtp->closeSession( $sub, 'radio' );
+$vtp->closeSession( $sub, 'group' );
+$vtp->setVar( $sub, 'param_line.def',
+ $lang['conf_comments_show_comments_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// number of comments per page
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name',
+ $lang['conf_comments_comments_number'] );
+$vtp->addSession( $sub, 'text' );
+$vtp->setVar( $sub, 'text.name', 'nb_comment_page' );
+$vtp->setVar( $sub, 'text.value', $nb_comment_page );
+$vtp->closeSession( $sub, 'text' );
+$vtp->setVar( $sub, 'param_line.def',
+ $lang['conf_comments_comments_number_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'line' );
+//-------------------------------------------------- default user configuration
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'title_line' );
+$vtp->setVar( $sub, 'title_line.title', $lang['conf_default_title'] );
+$vtp->closeSession( $sub, 'title_line' );
+$vtp->closeSession( $sub, 'line' );
+
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'line' );
+// default language
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['customize_language'] );
+$vtp->addSession( $sub, 'select' );
+$vtp->setVar( $sub, 'select.name', 'language' );
+$option = get_languages( '../language/' );
+for ( $i = 0; $i < sizeof( $option ); $i++ )
+{
+ $vtp->addSession( $sub, 'option' );
+ $vtp->setVar( $sub, 'option.option', $option[$i] );
+ if ( $option[$i] == $language )
+ {
+ $vtp->setVar( $sub, 'option.selected', ' selected="selected"' );
+ }
+ $vtp->closeSession( $sub, 'option' );
+}
+$vtp->closeSession( $sub, 'select' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_language_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// number of image per row
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['customize_nb_image_per_row'] );
+$vtp->addSession( $sub, 'select' );
+$vtp->setVar( $sub, 'select.name', 'nb_image_line' );
+for ( $i = 0; $i < sizeof( $conf['nb_image_row'] ); $i++ )
+{
+ $vtp->addSession( $sub, 'option' );
+ $vtp->setVar( $sub, 'option.option', $conf['nb_image_row'][$i] );
+ if ( $conf['nb_image_row'][$i] == $nb_image_line )
+ {
+ $vtp->setVar( $sub, 'option.selected', ' selected="selected"' );
+ }
+ $vtp->closeSession( $sub, 'option' );
+}
+$vtp->closeSession( $sub, 'select' );
+$vtp->setVar( $sub, 'param_line.def',
+ $lang['conf_default_nb_image_per_row_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// number of row per page
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['customize_nb_row_per_page'] );
+$vtp->addSession( $sub, 'select' );
+$vtp->setVar( $sub, 'select.name', 'nb_line_page' );
+for ( $i = 0; $i < sizeof( $conf['nb_row_page'] ); $i++ )
+{
+ $vtp->addSession( $sub, 'option' );
+ $vtp->setVar( $sub, 'option.option', $conf['nb_row_page'][$i] );
+ if ( $conf['nb_row_page'][$i] == $nb_line_page )
+ {
+ $vtp->setVar( $sub, 'option.selected', ' selected="selected"' );
+ }
+ $vtp->closeSession( $sub, 'option' );
+}
+$vtp->closeSession( $sub, 'select' );
+$vtp->setVar( $sub, 'param_line.def',
+ $lang['conf_default_nb_row_per_page_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// template
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['customize_template'] );
+$vtp->addSession( $sub, 'select' );
+$vtp->setVar( $sub, 'select.name', 'template' );
+$option = get_dirs( '../template/' );
+for ( $i = 0; $i < sizeof( $option ); $i++ )
+{
+ $vtp->addSession( $sub, 'option' );
+ $vtp->setVar( $sub, 'option.option', $option[$i] );
+ if ( $option[$i] == $template )
+ {
+ $vtp->setVar( $sub, 'option.selected', ' selected="selected"' );
+ }
+ $vtp->closeSession( $sub, 'option' );
+}
+$vtp->closeSession( $sub, 'select' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_template_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// theme
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['customize_theme'] );
+$vtp->addSession( $sub, 'select' );
+$vtp->setVar( $sub, 'select.name', 'theme' );
+$option = get_themes( '../theme/' );
+for ( $i = 0; $i < sizeof( $option ); $i++ )
+{
+ $vtp->addSession( $sub, 'option' );
+ $vtp->setVar( $sub, 'option.option', $option[$i] );
+ if ( $option[$i] == str_replace( "/", " - ", $theme ) )
+ {
+ $vtp->setVar( $sub, 'option.selected', ' selected="selected"' );
+ }
+ $vtp->closeSession( $sub, 'option' );
+}
+$vtp->closeSession( $sub, 'select' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_theme_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// short period time
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['customize_short_period'] );
+$vtp->addSession( $sub, 'text' );
+$vtp->setVar( $sub, 'text.name', 'short_period' );
+$vtp->setVar( $sub, 'text.value', $short_period );
+$vtp->closeSession( $sub, 'text' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_short_period_info']);
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// long period time
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['customize_long_period'] );
+$vtp->addSession( $sub, 'text' );
+$vtp->setVar( $sub, 'text.name', 'long_period' );
+$vtp->setVar( $sub, 'text.value', $long_period );
+$vtp->closeSession( $sub, 'text' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_long_period_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// max displayed width
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['maxwidth'] );
+$vtp->addSession( $sub, 'text' );
+$vtp->setVar( $sub, 'text.name', 'maxwidth' );
+$vtp->setVar( $sub, 'text.value', $maxwidth );
+$vtp->closeSession( $sub, 'text' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_maxwidth_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// max displayed height
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['maxheight'] );
+$vtp->addSession( $sub, 'text' );
+$vtp->setVar( $sub, 'text.name', 'maxheight' );
+$vtp->setVar( $sub, 'text.value', $maxheight );
+$vtp->closeSession( $sub, 'text' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_maxheight_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// expand all categories ?
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['customize_expand'] );
+$vtp->addSession( $sub, 'group' );
+$vtp->addSession( $sub, 'radio' );
+$vtp->setVar( $sub, 'radio.name', 'expand' );
+
+$vtp->setVar( $sub, 'radio.value', 'true' );
+$checked = '';
+if ( $expand == 'true' )
+{
+ $checked = ' checked="checked"';
+}
+$vtp->setVar( $sub, 'radio.checked', $checked );
+$vtp->setVar( $sub, 'radio.option', $lang['yes'] );
+$vtp->closeSession( $sub, 'radio' );
+$vtp->addSession( $sub, 'radio' );
+$vtp->setVar( $sub, 'radio.name', 'expand' );
+$vtp->setVar( $sub, 'radio.value', 'false' );
+$checked = '';
+if ( $expand == 'false' )
+{
+ $checked = ' checked="checked"';
+}
+$vtp->setVar( $sub, 'radio.checked', $checked );
+$vtp->setVar( $sub, 'radio.option', $lang['no'] );
+$vtp->closeSession( $sub, 'radio' );
+$vtp->closeSession( $sub, 'group' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_expand_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// show number of comments on thumbnails page
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['customize_show_nb_comments'] );
+$vtp->addSession( $sub, 'group' );
+$vtp->addSession( $sub, 'radio' );
+$vtp->setVar( $sub, 'radio.name', 'show_nb_comments' );
+$vtp->setVar( $sub, 'radio.value', 'true' );
+$checked = '';
+if ( $show_nb_comments == 'true' )
+{
+ $checked = ' checked="checked"';
+}
+$vtp->setVar( $sub, 'radio.checked', $checked );
+$vtp->setVar( $sub, 'radio.option', $lang['yes'] );
+$vtp->closeSession( $sub, 'radio' );
+$vtp->addSession( $sub, 'radio' );
+$vtp->setVar( $sub, 'radio.name', 'show_nb_comments' );
+$vtp->setVar( $sub, 'radio.value', 'false' );
+$checked = '';
+if ( $show_nb_comments == 'false' )
+{
+ $checked = ' checked="checked"';
+}
+$vtp->setVar( $sub, 'radio.checked', $checked );
+$vtp->setVar( $sub, 'radio.option', $lang['no'] );
+$vtp->closeSession( $sub, 'radio' );
+$vtp->closeSession( $sub, 'group' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_show_nb_comments_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'line' );
+//-------------------------------------------------------- upload configuration
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'title_line' );
+$vtp->setVar( $sub, 'title_line.title', $lang['conf_upload_title'] );
+$vtp->closeSession( $sub, 'title_line' );
+$vtp->closeSession( $sub, 'line' );
+
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'line' );
+// is upload available ?
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_available'] );
+$vtp->addSession( $sub, 'group' );
+$vtp->addSession( $sub, 'radio' );
+$vtp->setVar( $sub, 'radio.name', 'upload_available' );
+$vtp->setVar( $sub, 'radio.value', 'true' );
+$checked = '';
+if ( $upload_available == 'true' )
+{
+ $checked = ' checked="checked"';
+}
+$vtp->setVar( $sub, 'radio.checked', $checked );
+$vtp->setVar( $sub, 'radio.option', $lang['yes'] );
+$vtp->closeSession( $sub, 'radio' );
+$vtp->addSession( $sub, 'radio' );
+$vtp->setVar( $sub, 'radio.name', 'upload_available' );
+$vtp->setVar( $sub, 'radio.value', 'false' );
+$checked = '';
+if ( $upload_available == 'false' )
+{
+ $checked = ' checked="checked"';
+}
+$vtp->setVar( $sub, 'radio.checked', $checked );
+$vtp->setVar( $sub, 'radio.option', $lang['no'] );
+$vtp->closeSession( $sub, 'radio' );
+$vtp->closeSession( $sub, 'group' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_available_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// max filesize uploadable
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxfilesize'] );
+$vtp->addSession( $sub, 'text' );
+$vtp->setVar( $sub, 'text.name', 'upload_maxfilesize' );
+$vtp->setVar( $sub, 'text.value', $upload_maxfilesize );
+$vtp->closeSession( $sub, 'text' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxfilesize_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// maxwidth uploadable
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxwidth'] );
+$vtp->addSession( $sub, 'text' );
+$vtp->setVar( $sub, 'text.name', 'upload_maxwidth' );
+$vtp->setVar( $sub, 'text.value', $upload_maxwidth );
+$vtp->closeSession( $sub, 'text' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxwidth_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// maxheight uploadable
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxheight'] );
+$vtp->addSession( $sub, 'text' );
+$vtp->setVar( $sub, 'text.name', 'upload_maxheight' );
+$vtp->setVar( $sub, 'text.value', $upload_maxheight );
+$vtp->closeSession( $sub, 'text' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxheight_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// maxwidth for thumbnail
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxwidth_thumbnail'] );
+$vtp->addSession( $sub, 'text' );
+$vtp->setVar( $sub, 'text.name', 'upload_maxwidth_thumbnail' );
+$vtp->setVar( $sub, 'text.value', $upload_maxwidth_thumbnail );
+$vtp->closeSession( $sub, 'text' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxwidth_thumbnail_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// maxheight for thumbnail
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxheight_thumbnail'] );
+$vtp->addSession( $sub, 'text' );
+$vtp->setVar( $sub, 'text.name', 'upload_maxheight_thumbnail' );
+$vtp->setVar( $sub, 'text.value', $upload_maxheight_thumbnail );
+$vtp->closeSession( $sub, 'text' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxheight_thumbnail_info']);
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'line' );
+//------------------------------------------------------ sessions configuration
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'title_line' );
+$vtp->setVar( $sub, 'title_line.title', $lang['conf_session_title'] );
+$vtp->closeSession( $sub, 'title_line' );
+$vtp->closeSession( $sub, 'line' );
+
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'line' );
+// session size
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['conf_session_size'] );
+$vtp->addSession( $sub, 'text' );
+$vtp->setVar( $sub, 'text.name', 'session_id_size' );
+$vtp->setVar( $sub, 'text.value', $session_id_size );
+$vtp->closeSession( $sub, 'text' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_session_size_info']);
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// session length
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['conf_session_time'] );
+$vtp->addSession( $sub, 'text' );
+$vtp->setVar( $sub, 'text.name', 'session_time' );
+$vtp->setVar( $sub, 'text.value', $session_time );
+$vtp->closeSession( $sub, 'text' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_session_time_info']);
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// session keyword
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['conf_session_key'] );
+$vtp->addSession( $sub, 'text' );
+$vtp->setVar( $sub, 'text.name', 'session_keyword' );
+$vtp->setVar( $sub, 'text.value', $session_keyword );
+$vtp->closeSession( $sub, 'text' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_session_key_info']);
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+// session deletion
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'param_line' );
+$vtp->setVar( $sub, 'param_line.name', $lang['conf_session_delete'] );
+$vtp->addSession( $sub, 'check' );
+$vtp->addSession( $sub, 'box' );
+$vtp->setVar( $sub, 'box.name', 'empty_session_table' );
+$vtp->setVar( $sub, 'box.value', '1' );
+$vtp->setVar( $sub, 'box.checked', ' checked="checked"' );
+$vtp->closeSession( $sub, 'box' );
+$vtp->closeSession( $sub, 'check' );
+$vtp->setVar( $sub, 'param_line.def', $lang['conf_session_delete_info'] );
+$vtp->closeSession( $sub, 'param_line' );
+$vtp->closeSession( $sub, 'line' );
+
+$vtp->addSession( $sub, 'line' );
+$vtp->addSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'space_line' );
+$vtp->closeSession( $sub, 'line' );
+//------------------------------------------------ remote sites administration
+$query = 'select id,galleries_url';
+$query.= ' from '.$prefixeTable.'sites';
+$query.= " where galleries_url <> './galleries/';";
+$result = mysql_query( $query );
+if ( mysql_num_rows( $result ) > 0 )
+{
+ $vtp->addSession( $sub, 'remote_sites' );
+ $i = 0;
+ while ( $row = mysql_fetch_array( $result ) )
+ {
+ $vtp->addSession( $sub, 'site' );
+ $vtp->setVar( $sub, 'site.url', $row['galleries_url'] );
+ $vtp->setVar( $sub, 'site.id', $row['id'] );
+ if ( $i == 0 )
+ {
+ $vtp->addSession( $sub, 'rowspan' );
+ $vtp->setVar( $sub, 'rowspan.nb_sites', mysql_num_rows( $result ) );
+ $vtp->closeSession( $sub, 'rowspan' );
+ }
+ $vtp->closeSession( $sub, 'site' );
+ $i++;
+ }
+ $vtp->closeSession( $sub, 'remote_sites' );
+}
+//----------------------------------------------------------- sending html code
+$vtp->Parse( $handle , 'sub', $sub );
+?>
\ No newline at end of file
diff --git a/admin/create_listing_file.php b/admin/create_listing_file.php
new file mode 100644
index 000000000..9b94486ef
--- /dev/null
+++ b/admin/create_listing_file.php
@@ -0,0 +1,128 @@
+$url";
+
+ // get_dirs retourne un tableau contenant tous les sous-répertoires d'un répertoire
+ function get_dirs( $rep, $indent, $level )
+ {
+ $sub_rep = array();
+ $i = 0;
+ $dirs = "";
+ if ( $opendir = opendir ( $rep ) )
+ {
+ while ( $file = readdir ( $opendir ) )
+ {
+ if ( $file != "." && $file != ".." && is_dir ( $rep."/".$file ) && $file != "thumbnail" )
+ {
+ $sub_rep[$i++] = $file;
+ }
+ }
+ }
+ // write of the dirs
+ for ( $i = 0; $i < sizeof( $sub_rep ); $i++ )
+ {
+ $dirs.= "\n".$indent."";
+ $dirs.= "\n".$indent."\t".$sub_rep[$i]." ";
+ $dirs.= get_pictures( $rep."/".$sub_rep[$i], $indent."\t" );
+ $dirs.= get_dirs( $rep."/".$sub_rep[$i], $indent."\t", $level + 1 );
+ $dirs.= "\n".$indent." ";
+ }
+ return $dirs;
+ }
+
+ function is_image ( $filename )
+ {
+ global $tab_ext;
+ if ( in_array ( substr ( strrchr($filename,"."), 1, strlen ( $filename ) ), $tab_ext ) )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ function TN_exist ( $dir, $file )
+ {
+ global $tab_ext, $prefixe_thumbnail;
+
+ $titre = substr ( $file, 0, -4 );
+ for ( $i = 0; $i < sizeof ( $tab_ext ); $i++ )
+ {
+ $test = $dir."/thumbnail/".$prefixe_thumbnail.$titre.".".$tab_ext[$i];
+ if ( is_file ( $test ) )
+ {
+ return $tab_ext[$i];
+ }
+ }
+ return false;
+ }
+
+ function get_pictures( $rep, $indent )
+ {
+ $pictures = array();
+ $i = 0;
+ $tn_ext = "";
+ $root = "";
+ if ( $opendir = opendir ( $rep ) )
+ {
+ while ( $file = readdir ( $opendir ) )
+ {
+ if ( is_image( $file ) && $tn_ext = TN_exist( $rep, $file ) )
+ {
+ $pictures[$i] = array();
+ $pictures[$i]['file'] = $file;
+ $pictures[$i]['tn_ext'] = $tn_ext;
+ $pictures[$i]['date'] = date( "Y-m-d", filemtime ( $rep."/".$file ) );
+ $pictures[$i]['filesize'] = floor ( filesize( $rep."/".$file ) / 1024 );
+ $image_size = @getimagesize( $rep."/".$file );
+ $pictures[$i]['width'] = $image_size[0];
+ $pictures[$i]['height'] = $image_size[1];
+ $i++;
+ }
+ }
+ }
+ // write of the node with all the pictures at the root of the directory
+ $root.= "\n".$indent."";
+ if ( sizeof( $pictures ) > 0 )
+ {
+ for( $i = 0; $i < sizeof( $pictures ); $i++ )
+ {
+ $root.= "\n".$indent."\t";
+ $root.= "\n".$indent."\t\t".$pictures[$i]['file']." ";
+ $root.= "\n".$indent."\t\t".$pictures[$i]['tn_ext']." ";
+ $root.= "\n".$indent."\t\t".$pictures[$i]['date']." ";
+ $root.= "\n".$indent."\t\t".$pictures[$i]['filesize']." ";
+ $root.= "\n".$indent."\t\t".$pictures[$i]['width']." ";
+ $root.= "\n".$indent."\t\t".$pictures[$i]['height']." ";
+ $root.= "\n".$indent."\t ";
+ }
+ }
+ $root.= "\n".$indent." ";
+ return $root;
+ }
+
+ $listing.= get_dirs( ".", "", 0 );
+
+ if ( $fp = @fopen("./listing.xml","w") )
+ {
+ fwrite( $fp, $listing );
+ fclose( $fp );
+ }
+ else
+ {
+ echo "impossible de créer ou d'écrire dans le fichier listing.xml";
+ }
+
+ //echo str_replace( "\t", " ", nl2br( htmlspecialchars( $listing, ENT_QUOTES ) ) );
+ echo "listing.xml created";
+?>
\ No newline at end of file
diff --git a/admin/edit_cat.php b/admin/edit_cat.php
new file mode 100644
index 000000000..ae93521c0
--- /dev/null
+++ b/admin/edit_cat.php
@@ -0,0 +1,116 @@
+".$lang['editcat_confirm']." [ ".$lang['editcat_back']." ]";
+ }
+
+ echo "
+ ";
+?>
\ No newline at end of file
diff --git a/admin/historique.php b/admin/historique.php
new file mode 100644
index 000000000..2aca5bfc1
--- /dev/null
+++ b/admin/historique.php
@@ -0,0 +1,102 @@
+ '$date_ref' order by date desc;");
+ echo"";
+ echo"";
+ // affichage de la date du jour
+ echo $tJours[date("w")] ." ";
+ echo date("j").(date("j") == 1 ? "er " : " ");
+ echo $tMois[date("n")-1]." ".date("Y")." ";
+ echo " à ".date("G")."h".date("i");
+ echo"
";
+?>
+
+
+ date
+ login
+ IP
+ page
+ categorie
+ image
+
+
+
+
+
+ $fin = time();
+ $debut = mktime ( 23,59,59,date("n"),date("j")-1,date("Y") );
+ for ( $i = 0; $i < NB_JOUR_HISTO; $i++ )
+ {
+ // 1. affichage du nom du jour
+ echo"
+ ";
+ echo" ";
+ echo $tJours[date("w",$fin)] ." ";
+ echo date("j",$fin).(date("j",$fin) == 1 ? "er " : " ");
+ echo $tMois[date("n",$fin)-1]." ".date("Y",$fin)." ";
+ echo"
+
+
+
+
+
+ ";
+ // 2. affichage de tous les évènements pour le jour donné
+ // entre la veille à 23h59m59s et le jour même 23h59m59s
+ $result = mysql_query("select date,login,IP,categorie,page,titre,commentaire from $prefixeTable"."history where date > '$debut' and date < '$fin' order by date desc;");
+ $fin = $debut;
+ // on recule le début d'une journée complète
+ $debut = $debut - 24*60*60;
+ while($row=mysql_fetch_array($result))
+ {
+ $date = date("G\hi s", $row[date]);
+ $date = str_replace ( " ","min ", $date );
+ $date .= " sec";
+ // on réduit la taille du commentaire à ses premiers caractères
+ $affichage_commentaire = "";
+ if($row[commentaire] != '')
+ {
+ $affichage_commentaire = substr($row[commentaire],0,10);
+ $affichage_commentaire .= "...";
+ }
+ echo"
+ |- $date
+ $row[login]
+ $row[IP]
+ $row[page]
+ $row[categorie]
+ $row[titre]
+ ";
+ }
+ }
+ echo"
+ ";
+?>
\ No newline at end of file
diff --git a/admin/images/admin.png b/admin/images/admin.png
new file mode 100644
index 000000000..ff8dc0160
Binary files /dev/null and b/admin/images/admin.png differ
diff --git a/admin/images/arrow_up.gif b/admin/images/arrow_up.gif
new file mode 100644
index 000000000..90da978cd
Binary files /dev/null and b/admin/images/arrow_up.gif differ
diff --git a/admin/images/index.htm b/admin/images/index.htm
new file mode 100644
index 000000000..960cd928d
--- /dev/null
+++ b/admin/images/index.htm
@@ -0,0 +1,8 @@
+
+
+ PhpWebGallery
+
+
+ No access authorized
+
+
\ No newline at end of file
diff --git a/admin/images/moins.gif b/admin/images/moins.gif
new file mode 100644
index 000000000..74fa8736f
Binary files /dev/null and b/admin/images/moins.gif differ
diff --git a/admin/images/plus.gif b/admin/images/plus.gif
new file mode 100644
index 000000000..2fa7116c1
Binary files /dev/null and b/admin/images/plus.gif differ
diff --git a/admin/images/puce.gif b/admin/images/puce.gif
new file mode 100644
index 000000000..b8494bb77
Binary files /dev/null and b/admin/images/puce.gif differ
diff --git a/admin/include/functions.php b/admin/include/functions.php
new file mode 100644
index 000000000..1aee2d94d
--- /dev/null
+++ b/admin/include/functions.php
@@ -0,0 +1,194 @@
+
\ No newline at end of file
diff --git a/admin/include/index.htm b/admin/include/index.htm
new file mode 100644
index 000000000..960cd928d
--- /dev/null
+++ b/admin/include/index.htm
@@ -0,0 +1,8 @@
+
+
+ PhpWebGallery
+
+
+ No access authorized
+
+
\ No newline at end of file
diff --git a/admin/include/isadmin.inc.php b/admin/include/isadmin.inc.php
new file mode 100644
index 000000000..64a77e9f3
--- /dev/null
+++ b/admin/include/isadmin.inc.php
@@ -0,0 +1,34 @@
+ *
+ * *
+ ***************************************************************************
+
+ ***************************************************************************
+ * *
+ * 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; *
+ * *
+ ***************************************************************************/
+define( PREFIXE_INCLUDE, '.' );
+
+include_once( '../include/config.inc.php' );
+include_once( '../include/user.inc.php' );
+include( './include/functions.php' );
+
+$conf['lien_puce'] = $conf['repertoire_image'].'puce.gif';
+
+$isadmin = true;
+include_once( '../language/'.$user['language'].'.php' );
+
+if ( $user['status'] != 'admin' )
+{
+ echo '';
+ exit();
+}
+?>
\ No newline at end of file
diff --git a/admin/index.htm b/admin/index.htm
new file mode 100644
index 000000000..960cd928d
--- /dev/null
+++ b/admin/index.htm
@@ -0,0 +1,8 @@
+
+
+ PhpWebGallery
+
+
+ No access authorized
+
+
\ No newline at end of file
diff --git a/admin/infos_images.php b/admin/infos_images.php
new file mode 100644
index 000000000..a5c1b75a4
--- /dev/null
+++ b/admin/infos_images.php
@@ -0,0 +1,248 @@
+= 0 )
+ {
+ $page['start'] = floor( $HTTP_GET_VARS['num'] / $page['nb_image_page'] ) * $page['nb_image_page'];
+ }
+ // retrieving category information
+ $result = get_cat_info( $page['cat'] );
+ $cat['local_dir'] = $result['local_dir'];
+ $cat['dir'] = $result['dir'];
+ $cat['name'] = $result['name'];
+ $cat['site_id'] = $result['site_id'];
+ $cat['nb_images'] = $result['nb_images'];
+
+ $url = "./admin.php?page=infos_images&cat_id=".$page['cat'];
+ $page['navigation_bar'] = create_navigation_bar( $url, $cat['nb_images'], $page['start'], $page['nb_image_page'], "" );
+ echo"
+
+ ";
+ echo"
+
+
+ ".$lang['infoimage_detailed']."
+
+
+ ".$page['navigation_bar']."
+
+
+ ".$lang['thumbnail']."
+ ".$lang['infoimage_title']."
+ ".$lang['author']."
+ ".$lang['infoimage_comment']."
+ ".$lang['infoimage_creation_date']."
+ ";
+ $query = "select id,file,comment,author,tn_ext,name,date_creation";
+ $query.= " from $prefixeTable"."images";
+ $query.= " where cat_id = ".$page['cat'];
+ $query.= $conf['order_by'];
+ $query.= " limit ".$page['start'].",".$page['nb_image_page'];
+ $query.= ";";
+ $result = mysql_query( $query );
+ $i = 1;
+ while ( $row = mysql_fetch_array( $result ) )
+ {
+ echo"
+ ";
+ // création des liens vers la miniature
+ $file = substr ( $row['file'], 0, strrpos ( $row['file'], ".") );
+ if ( $cat['site_id'] == 1 )
+ {
+ $lien_thumbnail = "../galleries/".$cat['local_dir']."/";
+ }
+ else
+ {
+ $lien_thumbnail = $cat['dir'];
+ }
+ $lien_thumbnail.= "thumbnail/".$conf['prefixe_thumbnail'].$file.".".$row['tn_ext'];
+ // création du "style" de la ligne
+ $style = "style=\"text-align:center;\"";
+ if ( $i%2 == 0 )
+ {
+ $style.= " class=\"row2\"";
+ }
+ echo"
+
+ $file
+
+ ".$row['comment']."
+ ";
+ echo"
+ ";
+ $i++;
+ }
+ echo"
+
+
+
+
+ ";
+ }
+?>
\ No newline at end of file
diff --git a/admin/install.php b/admin/install.php
new file mode 100644
index 000000000..c87a63bbd
--- /dev/null
+++ b/admin/install.php
@@ -0,0 +1,599 @@
+
+
+ PhpWebGallery 1.2
+
+
+
+
+
+
+ PhpWebGallery 1.2
+
+
+ ";
+ return $output;
+ }
+
+ function footer_install()
+ {
+ $output = "
+
+
+
+
+
+
+
+