2004-02-11 23:20:38 +00:00
< ? php
// +-----------------------------------------------------------------------+
2011-01-18 00:02:52 +00:00
// | Piwigo - a PHP based photo gallery |
2008-04-04 22:57:23 +00:00
// +-----------------------------------------------------------------------+
2011-01-18 00:02:52 +00:00
// | Copyright(C) 2008-2011 Piwigo Team http://piwigo.org |
2008-04-04 22:57:23 +00:00
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
2004-02-11 23:20:38 +00:00
// | 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. |
// +-----------------------------------------------------------------------+
2003-07-01 09:27:20 +00:00
2004-09-19 22:26:41 +00:00
if ( ! defined ( " PHPWG_ROOT_PATH " ) )
2004-03-20 00:52:37 +00:00
{
2006-03-09 22:46:28 +00:00
die ( " Hacking attempt! " );
2004-03-20 00:52:37 +00:00
}
2004-09-19 22:26:41 +00:00
2006-03-09 22:46:28 +00:00
include_once ( PHPWG_ROOT_PATH . 'admin/include/functions.php' );
2008-02-28 23:41:47 +00:00
include_once ( PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php' );
2006-03-09 22:46:28 +00:00
// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok |
// +-----------------------------------------------------------------------+
check_status ( ACCESS_ADMINISTRATOR );
- in admin/configuration, add new step with "sections" (general, comments,
default, upload, metadata, sessions)
- admin/configuration.php and its template have been higly simplificated by
making things more generic : for example, for each configuration
parameter, its name must correspond to the name we find in the config
table and belongs to a section, in the lang array we find :
- $lang['conf_<section>_<param>']
- $lang['conf_<section>_<param>_info']
- $lang['conf_<section>_<param>_error'] optionnaly
- more described message when connection to database server is impossible
- redefinitions of get_languages and get_templates functions
- deletion of configuration parameters : webmaster, session_keyword
- rename of configuration parameters :
- default_lang => default_language
- default_style => default_template
git-svn-id: http://piwigo.org/svn/trunk@512 68402e56-0260-453c-a942-63ccdbb3a9ee
2004-09-03 15:01:05 +00:00
//-------------------------------------------------------- sections definitions
if ( ! isset ( $_GET [ 'section' ]))
{
2007-03-11 23:02:13 +00:00
$page [ 'section' ] = 'main' ;
- in admin/configuration, add new step with "sections" (general, comments,
default, upload, metadata, sessions)
- admin/configuration.php and its template have been higly simplificated by
making things more generic : for example, for each configuration
parameter, its name must correspond to the name we find in the config
table and belongs to a section, in the lang array we find :
- $lang['conf_<section>_<param>']
- $lang['conf_<section>_<param>_info']
- $lang['conf_<section>_<param>_error'] optionnaly
- more described message when connection to database server is impossible
- redefinitions of get_languages and get_templates functions
- deletion of configuration parameters : webmaster, session_keyword
- rename of configuration parameters :
- default_lang => default_language
- default_style => default_template
git-svn-id: http://piwigo.org/svn/trunk@512 68402e56-0260-453c-a942-63ccdbb3a9ee
2004-09-03 15:01:05 +00:00
}
else
{
$page [ 'section' ] = $_GET [ 'section' ];
}
2006-11-22 04:41:25 +00:00
2007-03-11 23:02:13 +00:00
$main_checkboxes = array (
2008-03-05 01:50:08 +00:00
'gallery_locked' ,
2007-06-10 22:01:18 +00:00
'allow_user_registration' ,
'obligatory_user_mail_address' ,
2007-03-26 19:15:52 +00:00
'rate' ,
'rate_anonymous' ,
2006-12-13 01:05:38 +00:00
'email_admin_on_new_user' ,
2010-03-24 23:24:01 +00:00
'allow_user_customization' ,
2006-11-22 04:41:25 +00:00
);
2007-03-09 22:52:22 +00:00
$history_checkboxes = array (
'log' ,
'history_admin' ,
'history_guest'
);
2006-11-22 04:41:25 +00:00
$comments_checkboxes = array (
'comments_forall' ,
'comments_validation' ,
'email_admin_on_comment' ,
'email_admin_on_comment_validation' ,
2009-06-23 13:44:58 +00:00
'user_can_delete_comment' ,
'user_can_edit_comment' ,
'email_admin_on_comment_edition' ,
'email_admin_on_comment_deletion'
2006-11-22 04:41:25 +00:00
);
2010-03-23 21:19:55 +00:00
$display_checkboxes = array (
'menubar_filter_icon' ,
'index_sort_order_input' ,
'index_flat_icon' ,
'index_posted_date_icon' ,
'index_created_date_icon' ,
'index_slideshow_icon' ,
2011-06-09 20:34:48 +00:00
'index_new_icon' ,
2010-03-23 21:19:55 +00:00
'picture_metadata_icon' ,
'picture_slideshow_icon' ,
'picture_favorite_icon' ,
2010-04-03 21:49:41 +00:00
'picture_download_icon' ,
2010-03-23 21:19:55 +00:00
'picture_navigation_icons' ,
'picture_navigation_thumb' ,
2011-05-07 15:55:10 +00:00
'picture_menu' ,
2010-03-23 21:19:55 +00:00
);
2010-03-24 00:39:34 +00:00
$display_info_checkboxes = array (
'author' ,
'created_on' ,
'posted_on' ,
'dimensions' ,
'file' ,
'filesize' ,
'tags' ,
'categories' ,
'visits' ,
2011-08-02 19:20:50 +00:00
'rating_score' ,
2010-04-08 20:21:17 +00:00
'privacy_level' ,
2010-03-24 00:39:34 +00:00
);
2011-06-09 14:32:20 +00:00
2011-07-01 13:19:35 +00:00
// image order management
$sort_fields = array (
'' => '' ,
'rank' => l10n ( 'Rank' ),
'file' => l10n ( 'File name' ),
'date_creation' => l10n ( 'Creation date' ),
'date_available' => l10n ( 'Post date' ),
2011-08-02 19:20:50 +00:00
'rating_score' => l10n ( 'Rating score' ),
2011-07-01 13:19:35 +00:00
'hit' => l10n ( 'Most visited' ),
'id' => 'Id' ,
);
$sort_directions = array (
'ASC' => l10n ( 'ascending' ),
'DESC' => l10n ( 'descending' ),
2011-06-09 14:32:20 +00:00
);
2010-03-24 00:39:34 +00:00
2003-05-09 12:42:42 +00:00
//------------------------------ verification and registration of modifications
2010-12-14 13:47:24 +00:00
if ( isset ( $_POST [ 'submit' ]))
2003-05-09 12:42:42 +00:00
{
2003-07-01 09:27:20 +00:00
$int_pattern = '/^\d+$/' ;
2007-03-28 19:57:00 +00:00
- in admin/configuration, add new step with "sections" (general, comments,
default, upload, metadata, sessions)
- admin/configuration.php and its template have been higly simplificated by
making things more generic : for example, for each configuration
parameter, its name must correspond to the name we find in the config
table and belongs to a section, in the lang array we find :
- $lang['conf_<section>_<param>']
- $lang['conf_<section>_<param>_info']
- $lang['conf_<section>_<param>_error'] optionnaly
- more described message when connection to database server is impossible
- redefinitions of get_languages and get_templates functions
- deletion of configuration parameters : webmaster, session_keyword
- rename of configuration parameters :
- default_lang => default_language
- default_style => default_template
git-svn-id: http://piwigo.org/svn/trunk@512 68402e56-0260-453c-a942-63ccdbb3a9ee
2004-09-03 15:01:05 +00:00
switch ( $page [ 'section' ])
2003-05-09 12:42:42 +00:00
{
2007-03-11 23:02:13 +00:00
case 'main' :
2011-07-01 13:19:35 +00:00
{
if ( ! isset ( $conf [ 'order_by_custom' ]) and ! isset ( $conf [ 'order_by_inside_category_custom' ]) )
2011-06-09 14:32:20 +00:00
{
2011-07-01 13:19:35 +00:00
if ( ! empty ( $_POST [ 'order_by_field' ]) )
2011-06-09 14:32:20 +00:00
{
2011-07-01 13:19:35 +00:00
$order_by = array ();
$order_by_inside_category = array ();
for ( $i = 0 ; $i < count ( $_POST [ 'order_by_field' ]); $i ++ )
{
2011-07-01 13:54:56 +00:00
if ( $i > 5 ) continue ;
2011-07-01 13:19:35 +00:00
if ( $_POST [ 'order_by_field' ][ $i ] == '' )
{
array_push ( $page [ 'errors' ], l10n ( 'No field selected' ));
}
else
{
if ( $_POST [ 'order_by_field' ][ $i ] != 'rank' )
{
$order_by [] = $_POST [ 'order_by_field' ][ $i ] . ' ' . $_POST [ 'order_by_direction' ][ $i ];
}
$order_by_inside_category [] = $_POST [ 'order_by_field' ][ $i ] . ' ' . $_POST [ 'order_by_direction' ][ $i ];
}
}
$_POST [ 'order_by' ] = 'ORDER BY ' . implode ( ', ' , $order_by );
$_POST [ 'order_by_inside_category' ] = 'ORDER BY ' . implode ( ', ' , $order_by_inside_category );
2011-06-09 14:32:20 +00:00
}
}
2011-03-05 16:14:41 +00:00
if ( empty ( $_POST [ 'gallery_locked' ]) and $conf [ 'gallery_locked' ])
{
$tpl_var = & $template -> get_template_vars ( 'header_msgs' );
$msg_key = array_search ( l10n ( 'The gallery is locked for maintenance. Please, come back later.' ), $tpl_var );
unset ( $tpl_var [ $msg_key ]);
}
elseif ( ! empty ( $_POST [ 'gallery_locked' ]) and ! $conf [ 'gallery_locked' ])
{
$template -> append ( 'header_msgs' , l10n ( 'The gallery is locked for maintenance. Please, come back later.' ));
}
2007-03-11 23:02:13 +00:00
foreach ( $main_checkboxes as $checkbox )
2006-11-22 04:41:25 +00:00
{
$_POST [ $checkbox ] = empty ( $_POST [ $checkbox ]) ? 'false' : 'true' ;
}
- in admin/configuration, add new step with "sections" (general, comments,
default, upload, metadata, sessions)
- admin/configuration.php and its template have been higly simplificated by
making things more generic : for example, for each configuration
parameter, its name must correspond to the name we find in the config
table and belongs to a section, in the lang array we find :
- $lang['conf_<section>_<param>']
- $lang['conf_<section>_<param>_info']
- $lang['conf_<section>_<param>_error'] optionnaly
- more described message when connection to database server is impossible
- redefinitions of get_languages and get_templates functions
- deletion of configuration parameters : webmaster, session_keyword
- rename of configuration parameters :
- default_lang => default_language
- default_style => default_template
git-svn-id: http://piwigo.org/svn/trunk@512 68402e56-0260-453c-a942-63ccdbb3a9ee
2004-09-03 15:01:05 +00:00
break ;
}
2007-03-09 22:52:22 +00:00
case 'history' :
{
foreach ( $history_checkboxes as $checkbox )
{
$_POST [ $checkbox ] = empty ( $_POST [ $checkbox ]) ? 'false' : 'true' ;
}
break ;
}
- in admin/configuration, add new step with "sections" (general, comments,
default, upload, metadata, sessions)
- admin/configuration.php and its template have been higly simplificated by
making things more generic : for example, for each configuration
parameter, its name must correspond to the name we find in the config
table and belongs to a section, in the lang array we find :
- $lang['conf_<section>_<param>']
- $lang['conf_<section>_<param>_info']
- $lang['conf_<section>_<param>_error'] optionnaly
- more described message when connection to database server is impossible
- redefinitions of get_languages and get_templates functions
- deletion of configuration parameters : webmaster, session_keyword
- rename of configuration parameters :
- default_lang => default_language
- default_style => default_template
git-svn-id: http://piwigo.org/svn/trunk@512 68402e56-0260-453c-a942-63ccdbb3a9ee
2004-09-03 15:01:05 +00:00
case 'comments' :
{
// the number of comments per page must be an integer between 5 and 50
// included
if ( ! preg_match ( $int_pattern , $_POST [ 'nb_comment_page' ])
or $_POST [ 'nb_comment_page' ] < 5
or $_POST [ 'nb_comment_page' ] > 50 )
{
2010-03-02 14:54:22 +00:00
array_push ( $page [ 'errors' ], l10n ( 'The number of comments a page must be between 5 and 50 included.' ));
- in admin/configuration, add new step with "sections" (general, comments,
default, upload, metadata, sessions)
- admin/configuration.php and its template have been higly simplificated by
making things more generic : for example, for each configuration
parameter, its name must correspond to the name we find in the config
table and belongs to a section, in the lang array we find :
- $lang['conf_<section>_<param>']
- $lang['conf_<section>_<param>_info']
- $lang['conf_<section>_<param>_error'] optionnaly
- more described message when connection to database server is impossible
- redefinitions of get_languages and get_templates functions
- deletion of configuration parameters : webmaster, session_keyword
- rename of configuration parameters :
- default_lang => default_language
- default_style => default_template
git-svn-id: http://piwigo.org/svn/trunk@512 68402e56-0260-453c-a942-63ccdbb3a9ee
2004-09-03 15:01:05 +00:00
}
2006-11-22 04:41:25 +00:00
foreach ( $comments_checkboxes as $checkbox )
{
$_POST [ $checkbox ] = empty ( $_POST [ $checkbox ]) ? 'false' : 'true' ;
}
- in admin/configuration, add new step with "sections" (general, comments,
default, upload, metadata, sessions)
- admin/configuration.php and its template have been higly simplificated by
making things more generic : for example, for each configuration
parameter, its name must correspond to the name we find in the config
table and belongs to a section, in the lang array we find :
- $lang['conf_<section>_<param>']
- $lang['conf_<section>_<param>_info']
- $lang['conf_<section>_<param>_error'] optionnaly
- more described message when connection to database server is impossible
- redefinitions of get_languages and get_templates functions
- deletion of configuration parameters : webmaster, session_keyword
- rename of configuration parameters :
- default_lang => default_language
- default_style => default_template
git-svn-id: http://piwigo.org/svn/trunk@512 68402e56-0260-453c-a942-63ccdbb3a9ee
2004-09-03 15:01:05 +00:00
break ;
}
case 'default' :
{
2007-03-28 19:57:00 +00:00
// Never go here
- in admin/configuration, add new step with "sections" (general, comments,
default, upload, metadata, sessions)
- admin/configuration.php and its template have been higly simplificated by
making things more generic : for example, for each configuration
parameter, its name must correspond to the name we find in the config
table and belongs to a section, in the lang array we find :
- $lang['conf_<section>_<param>']
- $lang['conf_<section>_<param>_info']
- $lang['conf_<section>_<param>_error'] optionnaly
- more described message when connection to database server is impossible
- redefinitions of get_languages and get_templates functions
- deletion of configuration parameters : webmaster, session_keyword
- rename of configuration parameters :
- default_lang => default_language
- default_style => default_template
git-svn-id: http://piwigo.org/svn/trunk@512 68402e56-0260-453c-a942-63ccdbb3a9ee
2004-09-03 15:01:05 +00:00
break ;
}
2010-03-23 21:19:55 +00:00
case 'display' :
{
foreach ( $display_checkboxes as $checkbox )
{
$_POST [ $checkbox ] = empty ( $_POST [ $checkbox ]) ? 'false' : 'true' ;
}
2010-03-24 00:39:34 +00:00
foreach ( $display_info_checkboxes as $checkbox )
{
$_POST [ 'picture_informations' ][ $checkbox ] =
empty ( $_POST [ 'picture_informations' ][ $checkbox ]) ? false : true ;
}
$_POST [ 'picture_informations' ] = addslashes ( serialize ( $_POST [ 'picture_informations' ]));
2010-03-23 21:19:55 +00:00
break ;
}
2003-05-09 12:42:42 +00:00
}
2006-03-09 01:57:13 +00:00
2004-09-20 20:08:15 +00:00
// updating configuration if no error found
2005-06-11 14:10:04 +00:00
if ( count ( $page [ 'errors' ]) == 0 )
2003-05-09 12:42:42 +00:00
{
2006-10-19 00:41:07 +00:00
//echo '<pre>'; print_r($_POST); echo '</pre>';
2007-01-23 22:03:06 +00:00
$result = pwg_query ( 'SELECT param FROM ' . CONFIG_TABLE );
2009-11-20 14:17:04 +00:00
while ( $row = pwg_db_fetch_assoc ( $result ))
- in admin/configuration, add new step with "sections" (general, comments,
default, upload, metadata, sessions)
- admin/configuration.php and its template have been higly simplificated by
making things more generic : for example, for each configuration
parameter, its name must correspond to the name we find in the config
table and belongs to a section, in the lang array we find :
- $lang['conf_<section>_<param>']
- $lang['conf_<section>_<param>_info']
- $lang['conf_<section>_<param>_error'] optionnaly
- more described message when connection to database server is impossible
- redefinitions of get_languages and get_templates functions
- deletion of configuration parameters : webmaster, session_keyword
- rename of configuration parameters :
- default_lang => default_language
- default_style => default_template
git-svn-id: http://piwigo.org/svn/trunk@512 68402e56-0260-453c-a942-63ccdbb3a9ee
2004-09-03 15:01:05 +00:00
{
if ( isset ( $_POST [ $row [ 'param' ]]))
{
2005-10-07 23:25:42 +00:00
$value = $_POST [ $row [ 'param' ]];
2006-03-09 01:57:13 +00:00
if ( 'gallery_title' == $row [ 'param' ])
2005-10-07 23:25:42 +00:00
{
if ( ! $conf [ 'allow_html_descriptions' ])
{
$value = strip_tags ( $value );
}
}
2006-03-09 01:57:13 +00:00
2004-09-20 20:08:15 +00:00
$query = '
UPDATE '.CONFIG_TABLE.'
2007-03-28 19:57:00 +00:00
SET value = \ '' . str_replace ( " \ ' " , " '' " , $value ) . ' \ '
WHERE param = \ '' . $row [ 'param' ] . ' \ '
2004-09-20 20:08:15 +00:00
; ' ;
2004-10-30 15:42:29 +00:00
pwg_query ( $query );
- in admin/configuration, add new step with "sections" (general, comments,
default, upload, metadata, sessions)
- admin/configuration.php and its template have been higly simplificated by
making things more generic : for example, for each configuration
parameter, its name must correspond to the name we find in the config
table and belongs to a section, in the lang array we find :
- $lang['conf_<section>_<param>']
- $lang['conf_<section>_<param>_info']
- $lang['conf_<section>_<param>_error'] optionnaly
- more described message when connection to database server is impossible
- redefinitions of get_languages and get_templates functions
- deletion of configuration parameters : webmaster, session_keyword
- rename of configuration parameters :
- default_lang => default_language
- default_style => default_template
git-svn-id: http://piwigo.org/svn/trunk@512 68402e56-0260-453c-a942-63ccdbb3a9ee
2004-09-03 15:01:05 +00:00
}
}
2010-03-02 14:54:22 +00:00
array_push ( $page [ 'infos' ], l10n ( 'Information data registered in database' ));
2003-05-09 12:42:42 +00:00
}
- in admin/configuration, add new step with "sections" (general, comments,
default, upload, metadata, sessions)
- admin/configuration.php and its template have been higly simplificated by
making things more generic : for example, for each configuration
parameter, its name must correspond to the name we find in the config
table and belongs to a section, in the lang array we find :
- $lang['conf_<section>_<param>']
- $lang['conf_<section>_<param>_info']
- $lang['conf_<section>_<param>_error'] optionnaly
- more described message when connection to database server is impossible
- redefinitions of get_languages and get_templates functions
- deletion of configuration parameters : webmaster, session_keyword
- rename of configuration parameters :
- default_lang => default_language
- default_style => default_template
git-svn-id: http://piwigo.org/svn/trunk@512 68402e56-0260-453c-a942-63ccdbb3a9ee
2004-09-03 15:01:05 +00:00
2007-01-23 22:03:06 +00:00
//------------------------------------------------------ $conf reinitialization
load_conf_from_db ();
2006-10-19 00:41:07 +00:00
}
2004-09-19 22:26:41 +00:00
//----------------------------------------------------- template initialization
2008-09-14 07:16:15 +00:00
$template -> set_filename ( 'config' , 'configuration.tpl' );
2007-03-08 22:14:14 +00:00
2008-02-28 23:41:47 +00:00
// TabSheet
$tabsheet = new tabsheet ();
2007-03-08 22:14:14 +00:00
// TabSheet initialization
2010-03-02 14:54:22 +00:00
$tabsheet -> add ( 'main' , l10n ( 'Main' ), $conf_link . 'main' );
2010-03-23 21:19:55 +00:00
$tabsheet -> add ( 'display' , l10n ( 'Display' ), $conf_link . 'display' );
2010-03-02 14:54:22 +00:00
$tabsheet -> add ( 'history' , l10n ( 'History' ), $conf_link . 'history' );
$tabsheet -> add ( 'comments' , l10n ( 'Comments' ), $conf_link . 'comments' );
2010-03-23 21:19:55 +00:00
$tabsheet -> add ( 'default' , l10n ( 'Guest Settings' ), $conf_link . 'default' );
2008-02-28 23:41:47 +00:00
// TabSheet selection
$tabsheet -> select ( $page [ 'section' ]);
2007-03-08 22:14:14 +00:00
// Assign tabsheet to template
2008-02-28 23:41:47 +00:00
$tabsheet -> assign ();
- in admin/configuration, add new step with "sections" (general, comments,
default, upload, metadata, sessions)
- admin/configuration.php and its template have been higly simplificated by
making things more generic : for example, for each configuration
parameter, its name must correspond to the name we find in the config
table and belongs to a section, in the lang array we find :
- $lang['conf_<section>_<param>']
- $lang['conf_<section>_<param>_info']
- $lang['conf_<section>_<param>_error'] optionnaly
- more described message when connection to database server is impossible
- redefinitions of get_languages and get_templates functions
- deletion of configuration parameters : webmaster, session_keyword
- rename of configuration parameters :
- default_lang => default_language
- default_style => default_template
git-svn-id: http://piwigo.org/svn/trunk@512 68402e56-0260-453c-a942-63ccdbb3a9ee
2004-09-03 15:01:05 +00:00
2008-03-05 01:50:08 +00:00
$action = get_root_url () . 'admin.php?page=configuration' ;
2004-09-20 20:08:15 +00:00
$action .= '&section=' . $page [ 'section' ];
2008-03-21 01:01:25 +00:00
$template -> assign (
2004-09-20 20:08:15 +00:00
array (
2010-04-18 18:59:37 +00:00
'U_HELP' => get_root_url () . 'admin/popuphelp.php?page=configuration' ,
2006-01-15 13:45:42 +00:00
'F_ACTION' => $action
2004-09-20 20:08:15 +00:00
));
2003-07-01 09:27:20 +00:00
2004-09-19 22:26:41 +00:00
switch ( $page [ 'section' ])
2004-09-20 20:08:15 +00:00
{
2007-03-11 23:02:13 +00:00
case 'main' :
2011-07-01 13:19:35 +00:00
{
function order_by_is_local ()
2011-06-09 14:32:20 +00:00
{
2011-07-01 13:19:35 +00:00
@ include ( PHPWG_ROOT_PATH . 'local/config/config.inc.php' );
if ( isset ( $conf [ 'local_dir_site' ]))
{
@ include ( PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'config/config.inc.php' );
}
return isset ( $conf [ 'order_by' ]) or isset ( $conf [ 'order_by_inside_category' ]);
2011-06-09 14:32:20 +00:00
}
2011-07-01 13:19:35 +00:00
if ( order_by_is_local ())
2011-06-09 14:32:20 +00:00
{
2011-07-01 13:19:35 +00:00
array_push ( $page [ 'warnings' ], l10n ( 'You have specified <i>$conf[\'order_by\']</i> in your local configuration file, this parameter in deprecated, please remove it or rename it into <i>$conf[\'order_by_custom\']</i> !' ));
2011-06-09 14:32:20 +00:00
}
2011-07-01 13:19:35 +00:00
if ( isset ( $conf [ 'order_by_custom' ]) or isset ( $conf [ 'order_by_inside_category_custom' ]) )
2011-06-09 14:32:20 +00:00
{
2011-07-01 13:19:35 +00:00
$order_by = array ( array (
'FIELD' => '' ,
'DIRECTION' => 'ASC' ,
));
$template -> assign ( 'ORDER_BY_IS_CUSTOM' , true );
2011-06-09 14:32:20 +00:00
}
else
{
2011-07-01 13:19:35 +00:00
$out = array ();
$order_by = trim ( $conf [ 'order_by_inside_category' ]);
$order_by = str_replace ( 'ORDER BY ' , null , $order_by );
$order_by = explode ( ', ' , $order_by );
foreach ( $order_by as $field )
{
$field = explode ( ' ' , $field );
$out [] = array (
'FIELD' => $field [ 0 ],
'DIRECTION' => $field [ 1 ],
);
}
$order_by = $out ;
2011-06-09 14:32:20 +00:00
}
2011-07-01 13:19:35 +00:00
2008-03-05 01:50:08 +00:00
$template -> assign (
2007-03-11 23:02:13 +00:00
'main' ,
2004-09-20 20:08:15 +00:00
array (
2007-05-18 23:36:55 +00:00
'CONF_GALLERY_TITLE' => htmlspecialchars ( $conf [ 'gallery_title' ]),
'CONF_PAGE_BANNER' => htmlspecialchars ( $conf [ 'page_banner' ]),
2011-01-12 13:41:55 +00:00
'week_starts_on_options' => array (
'sunday' => $lang [ 'day' ][ 0 ],
'monday' => $lang [ 'day' ][ 1 ],
),
'week_starts_on_options_selected' => $conf [ 'week_starts_on' ],
2011-07-01 13:19:35 +00:00
'order_by' => $order_by ,
'order_field_options' => $sort_fields ,
'order_direction_options' => $sort_directions ,
)
);
2006-11-22 04:41:25 +00:00
2008-05-02 21:56:21 +00:00
foreach ( $main_checkboxes as $checkbox )
2006-11-22 04:41:25 +00:00
{
2008-03-05 01:50:08 +00:00
$template -> append (
2007-03-11 23:02:13 +00:00
'main' ,
2006-11-22 04:41:25 +00:00
array (
2008-03-05 01:50:08 +00:00
$checkbox => $conf [ $checkbox ]
),
true
2006-11-22 04:41:25 +00:00
);
}
2004-09-20 20:08:15 +00:00
break ;
}
2007-03-09 22:52:22 +00:00
case 'history' :
{
//Necessary for merge_block_vars
2008-05-02 21:56:21 +00:00
foreach ( $history_checkboxes as $checkbox )
2007-03-09 22:52:22 +00:00
{
2008-03-05 01:50:08 +00:00
$template -> append (
2007-03-09 22:52:22 +00:00
'history' ,
array (
2008-03-05 01:50:08 +00:00
$checkbox => $conf [ $checkbox ]
),
true
2007-03-09 22:52:22 +00:00
);
}
break ;
}
2004-09-20 20:08:15 +00:00
case 'comments' :
{
2008-03-05 01:50:08 +00:00
$template -> assign (
2004-09-20 20:08:15 +00:00
'comments' ,
array (
'NB_COMMENTS_PAGE' => $conf [ 'nb_comment_page' ],
));
2006-11-22 04:41:25 +00:00
2008-05-02 21:56:21 +00:00
foreach ( $comments_checkboxes as $checkbox )
2006-11-22 04:41:25 +00:00
{
2008-03-05 01:50:08 +00:00
$template -> append (
2006-11-22 04:41:25 +00:00
'comments' ,
array (
2008-03-05 01:50:08 +00:00
$checkbox => $conf [ $checkbox ]
),
true
2006-11-22 04:41:25 +00:00
);
}
2004-09-20 20:08:15 +00:00
break ;
}
case 'default' :
{
2010-04-29 12:55:46 +00:00
$edit_user = build_user ( $conf [ 'guest_id' ], false );
2007-03-28 19:57:00 +00:00
include_once ( PHPWG_ROOT_PATH . 'profile.php' );
2006-03-09 01:57:13 +00:00
2007-03-28 19:57:00 +00:00
$errors = array ();
2010-12-14 13:47:24 +00:00
if ( save_profile_from_post ( $edit_user , $errors ))
2005-09-03 16:36:05 +00:00
{
2010-12-14 13:47:24 +00:00
// Reload user
$edit_user = build_user ( $conf [ 'guest_id' ], false );
array_push ( $page [ 'infos' ], l10n ( 'Information data registered in database' ));
2005-09-03 16:36:05 +00:00
}
2007-03-28 19:57:00 +00:00
$page [ 'errors' ] = array_merge ( $page [ 'errors' ], $errors );
load_profile_in_template (
$action ,
'' ,
$edit_user
);
2008-03-05 01:50:08 +00:00
$template -> assign ( 'default' , array ());
2004-09-20 20:08:15 +00:00
break ;
}
2010-03-23 21:19:55 +00:00
case 'display' :
{
foreach ( $display_checkboxes as $checkbox )
{
$template -> append (
'display' ,
array (
$checkbox => $conf [ $checkbox ]
),
true
);
}
2010-03-24 00:39:34 +00:00
$template -> append (
'display' ,
array (
'picture_informations' => unserialize ( $conf [ 'picture_informations' ])
),
true
);
2010-03-23 21:19:55 +00:00
break ;
}
2004-09-20 20:08:15 +00:00
}
2007-03-28 19:57:00 +00:00
2003-05-09 12:42:42 +00:00
//----------------------------------------------------------- sending html code
2004-03-20 00:52:37 +00:00
$template -> assign_var_from_handle ( 'ADMIN_CONTENT' , 'config' );
2004-02-11 23:20:38 +00:00
?>