From 7eae7595909a49d4355453c73638151097a53f20 Mon Sep 17 00:00:00 2001 From: plegall Date: Sat, 3 Sep 2005 16:36:05 +0000 Subject: - modification : less configuration parameters in administration screen. These parameters are move to include/config_default.inc.php. - new : ability to add a single picture to caddie from picture.php - new : contextual help, only a few pages are available. - new : ability to delete users from admin/user_list - modification : reorganization of configuration file - new : configuration parameter use_exif_mapping - improvement : MOD hidemail added to standard git-svn-id: http://piwigo.org/svn/trunk@858 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin.php | 3 - admin/configuration.php | 210 ++++--------- admin/include/functions.php | 2 +- admin/include/functions_metadata.php | 43 ++- admin/infos_images.php | 351 ---------------------- admin/maintenance.php | 1 + admin/remote_site.php | 3 + admin/update.php | 6 + admin/user_list.php | 208 +++++++------ category.php | 1 - doc/ChangeLog | 18 ++ include/config_default.inc.php | 262 ++++++++++------ include/functions_metadata.inc.php | 42 +++ include/page_tail.php | 21 +- include/scripts.js | 12 +- include/template.php | 3 +- install/config.sql | 7 - install/phpwebgallery_structure.sql | 18 +- language/en_UK.iso-8859-1/help/configuration.html | 87 ++++++ language/en_UK.iso-8859-1/help/maintenance.html | 38 +++ language/en_UK.iso-8859-1/help/remote_site.html | 51 ++++ language/en_UK.iso-8859-1/help/synchronize.html | 1 + picture.php | 30 +- popuphelp.php | 64 ++++ search.php | 1 - template/cclear/admin.tpl | 3 - template/cclear/admin/configuration.tpl | 298 +++++++----------- template/cclear/admin/element_set_global.tpl | 4 +- template/cclear/admin/maintenance.tpl | 7 +- template/cclear/admin/remote_site.tpl | 7 +- template/cclear/admin/update.tpl | 7 +- template/cclear/comments.tpl | 2 +- template/cclear/content.css | 1 + template/cclear/default-colors.css | 42 ++- template/cclear/default-layout.css | 24 +- template/cclear/footer.tpl | 9 +- template/cclear/menubar.css | 1 - template/cclear/picture.tpl | 6 + template/cclear/popuphelp.css | 34 +++ template/cclear/popuphelp.tpl | 5 + template/cclear/theme/exit.png | Bin 0 -> 1431 bytes template/cclear/theme/help.png | Bin 0 -> 1993 bytes 42 files changed, 977 insertions(+), 956 deletions(-) delete mode 100644 admin/infos_images.php create mode 100644 language/en_UK.iso-8859-1/help/configuration.html create mode 100644 language/en_UK.iso-8859-1/help/maintenance.html create mode 100644 language/en_UK.iso-8859-1/help/remote_site.html create mode 100644 language/en_UK.iso-8859-1/help/synchronize.html create mode 100644 popuphelp.php create mode 100644 template/cclear/popuphelp.css create mode 100644 template/cclear/popuphelp.tpl create mode 100644 template/cclear/theme/exit.png create mode 100644 template/cclear/theme/help.png diff --git a/admin.php b/admin.php index b2113b22a..cb92cb5d5 100644 --- a/admin.php +++ b/admin.php @@ -72,9 +72,6 @@ $template->assign_vars( 'U_CONFIG_GENERAL'=>add_session_id($conf_link.'general' ), 'U_CONFIG_COMMENTS'=>add_session_id($conf_link.'comments' ), 'U_CONFIG_DISPLAY'=>add_session_id($conf_link.'default' ), - 'U_CONFIG_UPLOAD'=>add_session_id($conf_link.'upload' ), - 'U_CONFIG_SESSION'=>add_session_id($conf_link.'session' ), - 'U_CONFIG_METADATA'=>add_session_id($conf_link.'metadata' ), 'U_CATEGORIES'=>add_session_id($link_start.'cat_list' ), 'U_CAT_UPLOAD'=>add_session_id($opt_link.'upload'), 'U_CAT_COMMENTS'=>add_session_id($opt_link.'comments'), diff --git a/admin/configuration.php b/admin/configuration.php index 8829c0822..9da9c56d3 100644 --- a/admin/configuration.php +++ b/admin/configuration.php @@ -60,17 +60,6 @@ if (isset($_POST['submit'])) { case 'general' : { - // thumbnail prefix must only contain simple ASCII characters - if (!preg_match('/^[\w-]*$/', $_POST['prefix_thumbnail'])) - { - array_push($page['errors'], $lang['conf_prefix_thumbnail_error']); - } - // mail must be formatted as follows : name@server.com - $pattern = '/^[\w-]+(\.[\w-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/'; - if (!preg_match($pattern, $_POST['mail_webmaster'])) - { - array_push($page['errors'], $lang['conf_mail_webmaster_error']); - } break; } case 'comments' : @@ -95,30 +84,6 @@ if (isset($_POST['submit'])) } break; } - case 'upload' : - { - // the maximum upload filesize must be an integer between 10 and 1000 - if (!preg_match($int_pattern, $_POST['upload_maxfilesize']) - or $_POST['upload_maxfilesize'] < 10 - or $_POST['upload_maxfilesize'] > 1000) - { - array_push($page['errors'], $lang['conf_upload_maxfilesize_error']); - } - - foreach (array('upload_maxwidth', - 'upload_maxheight', - 'upload_maxwidth_thumbnail', - 'upload_maxheight_thumbnail') - as $field) - { - if (!preg_match($int_pattern, $_POST[$field]) - or $_POST[$field] < 10) - { - array_push($page['errors'], $lang['conf_'.$field.'_error']); - } - } - break; - } } // updating configuration if no error found @@ -154,6 +119,8 @@ $template->assign_vars( 'L_NO'=>$lang['no'], 'L_SUBMIT'=>$lang['submit'], 'L_RESET'=>$lang['reset'], + + 'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=configuration', 'F_ACTION'=>add_session_id($action) )); @@ -170,18 +137,6 @@ switch ($page['section']) $template->assign_block_vars( 'general', array( - 'L_CONF_TITLE'=>$lang['conf_general_title'], - 'L_CONF_MAIL'=>$lang['conf_mail_webmaster'], - 'L_CONF_MAIL_INFO'=>$lang['conf_mail_webmaster_info'], - 'L_CONF_TN_PREFIX'=>$lang['conf_prefix'], - 'L_CONF_TN_PREFIX_INFO'=>$lang['conf_prefix_info'], - 'L_CONF_HISTORY'=>$lang['history'], - 'L_CONF_HISTORY_INFO'=>$lang['conf_log_info'], - 'L_CONF_GALLERY_LOCKED'=>$lang['conf_gallery_locked'], - 'L_CONF_GALLERY_LOCKED_INFO'=>$lang['conf_gallery_locked_info'], - - 'ADMIN_MAIL'=>$conf['mail_webmaster'], - 'THUMBNAIL_PREFIX'=>$conf['prefix_thumbnail'], 'HISTORY_YES'=>$history_yes, 'HISTORY_NO'=>$history_no, 'GALLERY_LOCKED_YES'=>$lock_yes, @@ -199,14 +154,6 @@ switch ($page['section']) $template->assign_block_vars( 'comments', array( - 'L_CONF_TITLE'=>$lang['conf_comments_title'], - 'L_CONF_COMMENTS_ALL'=>$lang['conf_comments_forall'], - 'L_CONF_COMMENTS_ALL_INFO'=>$lang['conf_comments_forall_info'], - 'L_CONF_NB_COMMENTS_PAGE'=>$lang['conf_nb_comment_page'], - 'L_CONF_NB_COMMENTS_PAGE_INFO'=>$lang['conf_nb_comment_page'], - 'L_CONF_VALIDATE'=>$lang['conf_comments_validation'], - 'L_CONF_VALIDATE_INFO'=>$lang['conf_comments_validation_info'], - 'NB_COMMENTS_PAGE'=>$conf['nb_comment_page'], 'COMMENTS_ALL_YES'=>$all_yes, 'COMMENTS_ALL_NO'=>$all_no, @@ -225,28 +172,8 @@ switch ($page['section']) $template->assign_block_vars( 'default', array( - 'L_CONF_TITLE'=>$lang['conf_default_title'], - 'L_CONF_LANG'=>$lang['language'], - 'L_CONF_LANG_INFO'=>$lang['conf_default_language_info'], - 'L_NB_IMAGE_LINE'=>$lang['nb_image_per_row'], - 'L_NB_IMAGE_LINE_INFO'=>$lang['conf_nb_image_line_info'], - 'L_NB_ROW_PAGE'=>$lang['nb_row_per_page'], - 'L_NB_ROW_PAGE_INFO'=>$lang['conf_nb_line_page_info'], - 'L_CONF_STYLE'=>$lang['theme'], - 'L_CONF_STYLE_INFO'=>$lang['conf_default_theme_info'], - 'L_CONF_RECENT'=>$lang['recent_period'], - 'L_CONF_RECENT_INFO'=>$lang['conf_recent_period_info'], - 'L_CONF_EXPAND'=>$lang['auto_expand'], - 'L_CONF_EXPAND_INFO'=>$lang['conf_default_expand_info'], - 'L_NB_COMMENTS'=>$lang['show_nb_comments'], - 'L_NB_COMMENTS_INFO'=>$lang['conf_show_nb_comments_info'], - 'L_MAXWIDTH'=>$lang['maxwidth'], - 'L_MAXHEIGHT'=>$lang['maxheight'], - - 'CONF_LANG_SELECT'=>language_select($conf['default_language'], 'default_language'), 'NB_IMAGE_LINE'=>$conf['nb_image_line'], 'NB_ROW_PAGE'=>$conf['nb_line_page'], - 'CONF_STYLE_SELECT'=>style_select($conf['default_template'], 'default_template'), 'CONF_RECENT'=>$conf['recent_period'], 'NB_COMMENTS_PAGE'=>$conf['nb_comment_page'], 'EXPAND_YES'=>$expand_yes, @@ -254,86 +181,65 @@ switch ($page['section']) 'SHOW_COMMENTS_YES'=>$show_yes, 'SHOW_COMMENTS_NO'=>$show_no )); - break; - } - case 'upload' : - { - $template->assign_block_vars( - 'upload', - array( - 'L_CONF_TITLE'=>$lang['conf_upload_title'], - 'L_CONF_MAXSIZE'=>$lang['conf_upload_maxfilesize'], - 'L_CONF_MAXSIZE_INFO'=>$lang['conf_upload_maxfilesize_info'], - 'L_CONF_MAXWIDTH'=>$lang['conf_upload_maxwidth'], - 'L_CONF_MAXWIDTH_INFO'=>$lang['conf_upload_maxwidth_info'], - 'L_CONF_MAXHEIGHT'=>$lang['conf_upload_maxheight'], - 'L_CONF_MAXHEIGHT_INFO'=>$lang['conf_upload_maxheight_info'], - 'L_CONF_TN_MAXWIDTH'=>$lang['conf_upload_tn_maxwidth'], - 'L_CONF_TN_MAXWIDTH_INFO'=>$lang['conf_upload_tn_maxwidth_info'], - 'L_CONF_TN_MAXHEIGHT'=>$lang['conf_upload_tn_maxheight'], - 'L_CONF_TN_MAXHEIGHT_INFO'=>$lang['conf_upload_tn_maxheight_info'], - - 'UPLOAD_MAXSIZE'=>$conf['upload_maxfilesize'], - 'UPLOAD_MAXWIDTH'=>$conf['upload_maxwidth'], - 'UPLOAD_MAXHEIGHT'=>$conf['upload_maxheight'], - 'TN_UPLOAD_MAXWIDTH'=>$conf['upload_maxwidth_thumbnail'], - 'TN_UPLOAD_MAXHEIGHT'=>$conf['upload_maxheight_thumbnail'], - )); - break; - } - case 'session' : - { - $authorize_remembering_yes = - ($conf['authorize_remembering']=='true')?'checked="checked"':''; - $authorize_remembering_no = - ($conf['authorize_remembering']=='false')?'checked="checked"':''; + + $blockname = 'default.language_option'; + + foreach (get_languages() as $language_code => $language_name) + { + if (isset($_POST['submit'])) + { + $selected = + $_POST['default_language'] == $language_code + ? 'selected="selected"' : ''; + } + else if ($conf['default_language'] == $language_code) + { + $selected = 'selected="selected"'; + } + else + { + $selected = ''; + } - $template->assign_block_vars( - 'session', - array( - 'L_CONF_TITLE'=>$lang['conf_session_title'], - 'L_CONF_AUTHORIZE_REMEMBERING'=>$lang['conf_authorize_remembering'], - 'L_CONF_AUTHORIZE_REMEMBERING_INFO' => - $lang['conf_authorize_remembering_info'], + $template->assign_block_vars( + $blockname, + array( + 'VALUE'=> $language_code, + 'CONTENT' => $language_name, + 'SELECTED' => $selected + )); + } - 'AUTHORIZE_REMEMBERING_YES'=>$authorize_remembering_yes, - 'AUTHORIZE_REMEMBERING_NO'=>$authorize_remembering_no - )); - break; - } - case 'metadata' : - { - $exif_yes = ($conf['use_exif']=='true')?'checked="checked"':''; - $exif_no = ($conf['use_exif']=='false')?'checked="checked"':''; - $iptc_yes = ($conf['use_iptc']=='true')?'checked="checked"':''; - $iptc_no = ($conf['use_iptc']=='false')?'checked="checked"':''; - $show_exif_yes = ($conf['show_exif']=='true')?'checked="checked"':''; - $show_exif_no = ($conf['show_exif']=='false')?'checked="checked"':''; - $show_iptc_yes = ($conf['show_iptc']=='true')?'checked="checked"':''; - $show_iptc_no = ($conf['show_iptc']=='false')?'checked="checked"':''; + $blockname = 'default.template_option'; + + foreach (get_templates() as $pwg_template) + { + if (isset($_POST['submit'])) + { + $selected = + $_POST['default_template'] == $pwg_template + ? 'selected="selected"' : ''; + } + else if ($conf['default_template'] == $pwg_template) + { + $selected = 'selected="selected"'; + } + else + { + $selected = ''; + } - $template->assign_block_vars( - 'metadata', - array( - 'L_CONF_TITLE'=>$lang['conf_metadata_title'], - 'L_CONF_EXIF'=>$lang['conf_use_exif'], - 'L_CONF_EXIF_INFO'=>$lang['conf_use_exif_info'], - 'L_CONF_IPTC'=>$lang['conf_use_iptc'], - 'L_CONF_IPTC_INFO'=>$lang['conf_use_iptc_info'], - 'L_CONF_SHOW_EXIF'=>$lang['conf_show_exif'], - 'L_CONF_SHOW_EXIF_INFO'=>$lang['conf_show_exif_info'], - 'L_CONF_SHOW_IPTC'=>$lang['conf_show_iptc'], - 'L_CONF_SHOW_IPTC_INFO'=>$lang['conf_show_iptc_info'], - - 'USE_EXIF_YES'=>$exif_yes, - 'USE_EXIF_NO'=>$exif_no, - 'USE_IPTC_YES'=>$iptc_yes, - 'USE_IPTC_NO'=>$iptc_no, - 'SHOW_EXIF_YES'=>$show_exif_yes, - 'SHOW_EXIF_NO'=>$show_exif_no, - 'SHOW_IPTC_YES'=>$show_iptc_yes, - 'SHOW_IPTC_NO'=>$show_iptc_no - )); + $template->assign_block_vars( + $blockname, + array( + 'VALUE'=> $pwg_template, + 'CONTENT' => $pwg_template, + 'SELECTED' => $selected + ) + ); + } + + break; } } diff --git a/admin/include/functions.php b/admin/include/functions.php index 2b7a9a5cc..78ec15a09 100644 --- a/admin/include/functions.php +++ b/admin/include/functions.php @@ -364,7 +364,7 @@ DELETE FROM '.SESSIONS_TABLE.' // deletion of calculated permissions linked to the user $query = ' -DELETE FROM '.USER_FORBIDDEN_TABLE.' +DELETE FROM '.USER_CACHE_TABLE.' WHERE user_id = '.$user_id.' ;'; pwg_query($query); diff --git a/admin/include/functions_metadata.php b/admin/include/functions_metadata.php index 23b04833c..4836f85a3 100644 --- a/admin/include/functions_metadata.php +++ b/admin/include/functions_metadata.php @@ -27,18 +27,19 @@ include_once(PHPWG_ROOT_PATH.'/include/functions_metadata.inc.php'); +$page['datefields'] = array('date_creation', 'date_available'); + function get_sync_iptc_data($file) { - global $conf; + global $conf, $page; $map = $conf['use_iptc_mapping']; - $datefields = array('date_creation', 'date_available'); $iptc = get_iptc_data($file, $map); foreach ($iptc as $pwg_key => $value) { - if (in_array($pwg_key, $datefields)) + if (in_array($pwg_key, $page['datefields'])) { if (preg_match('/(\d{4})(\d{2})(\d{2})/', $value, $matches)) { @@ -59,6 +60,26 @@ function get_sync_iptc_data($file) return $iptc; } +function get_sync_exif_data($file) +{ + global $conf, $page; + + $exif = get_exif_data($file, $conf['use_exif_mapping']); + + foreach ($exif as $pwg_key => $value) + { + if (in_array($pwg_key, $page['datefields'])) + { + if (preg_match('/^(\d{4}).(\d{2}).(\d{2})/', $value, $matches)) + { + $exif[$pwg_key] = $matches[1].'-'.$matches[2].'-'.$matches[3]; + } + } + } + + return $exif; +} + function update_metadata($files) { global $conf; @@ -84,17 +105,13 @@ function update_metadata($files) if ($conf['use_exif']) { - if (!function_exists('read_exif_data')) - { - die('Exif extension not available, admin should disable exif use'); - } - - if ($exif = @read_exif_data($file)) + $exif = get_sync_exif_data($file); + + if (count($exif) > 0) { - if (isset($exif['DateTime'])) + foreach (array_keys($exif) as $key) { - preg_match('/^(\d{4}).(\d{2}).(\d{2})/',$exif['DateTime'],$matches); - $data['date_creation'] = $matches[1].'-'.$matches[2].'-'.$matches[3]; + $data[$key] = addslashes($exif[$key]); } } } @@ -128,7 +145,7 @@ function update_metadata($files) $update_fields = array_merge($update_fields, array_keys($conf['use_iptc_mapping'])); } - + $fields = array('primary' => array('id'), 'update' => array_unique($update_fields)); mass_updates(IMAGES_TABLE, $fields, $datas); diff --git a/admin/infos_images.php b/admin/infos_images.php deleted file mode 100644 index b8db86ec9..000000000 --- a/admin/infos_images.php +++ /dev/null @@ -1,351 +0,0 @@ - 0) $query.= ','; - $query.= $keyword; - } - $query.= '"'; - } - $query.= ' WHERE id = '.$row['id']; - $query.= ';'; - pwg_query($query); - } - } - } -// +-----------------------------------------------------------------------+ -// | form initialization | -// +-----------------------------------------------------------------------+ - if (!isset($_GET['start']) - or !is_numeric($_GET['start']) - or (is_numeric($_GET['start']) and $_GET['start'] < 0)) - { - $page['start'] = 0; - } - else - { - $page['start'] = $_GET['start']; - } - - if (isset($_GET['num']) and is_numeric($_GET['num']) and $_GET['num'] >= 0) - { - $max = $conf['info_nb_elements_page']; - $page['start'] = floor($_GET['num'] / $max) * $max; - } - // Navigation path - $current_category = get_cat_info($_GET['cat_id']); - $url = PHPWG_ROOT_PATH.'admin.php?page=infos_images&cat_id='; - $category_path = get_cat_display_name($current_category['name'], $url); - - $form_action = PHPWG_ROOT_PATH.'admin.php'; - $form_action.= '?page=infos_images&cat_id='.$_GET['cat_id']; - if($page['start']) - { - $form_action.= '&start='.$_GET['start']; - } - - $nav_bar = create_navigation_bar($form_action, - $current_category['nb_images'], - $page['start'], - $conf['info_nb_elements_page'], - ''); -// +-----------------------------------------------------------------------+ -// | template initialization | -// +-----------------------------------------------------------------------+ - $template->set_filenames(array('infos_images'=>'admin/infos_images.tpl')); - $template->assign_vars( - array( - 'CATEGORY'=>$category_path, - 'NAV_BAR'=>$nav_bar, - - 'L_INFOS_TITLE'=>$lang['infoimage_general'], - 'L_AUTHOR'=>$lang['author'], - 'L_INFOS_OVERALL_USE'=>$lang['infoimage_useforall'], - 'L_INFOS_CREATION_DATE'=>$lang['infoimage_creation_date'], - 'L_KEYWORD'=>$lang['keywords'], - 'L_KEYWORD_SEPARATION'=>$lang['infoimage_keyword_separation'], - 'L_INFOS_ADDTOALL'=>$lang['infoimage_addtoall'], - 'L_INFOS_REMOVEFROMALL'=>$lang['infoimage_removefromall'], - 'L_INFOS_DETAIL'=>$lang['infoimage_detailed'], - 'L_THUMBNAIL'=>$lang['thumbnail'], - 'L_INFOS_IMG'=>$lang['infoimage_title'], - 'L_INFOS_COMMENT'=>$lang['description'], - 'L_INFOS_ASSOCIATE'=>$lang['infoimage_associate'], - 'L_SUBMIT'=>$lang['submit'], - - 'F_ACTION'=>add_session_id($form_action) - )); -// +-----------------------------------------------------------------------+ -// | errors display | -// +-----------------------------------------------------------------------+ - if (count($errors) != 0) - { - $template->assign_block_vars('errors',array()); - foreach ($errors as $error) - { - $template->assign_block_vars('errors.error',array('ERROR'=>$error)); - } - } -// +-----------------------------------------------------------------------+ -// | form | -// +-----------------------------------------------------------------------+ - $array_cat_directories = array(); - - $pic_mod_base_url = PHPWG_ROOT_PATH.'admin.php'; - $pic_mod_base_url = '?page=picture_modify&image_id='; - - $query = ' -SELECT * - FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id - WHERE category_id = '.$page['cat'].' - '.$conf['order_by'].' - LIMIT '.$page['start'].','.$conf['info_nb_elements_page'].' -;'; - $result = pwg_query($query); - while ($row = mysql_fetch_array($result)) - { - $thumbnail_url = get_thumbnail_src($row['path'], @$row['tn_ext']); - - $template->assign_block_vars( - 'picture', - array( - 'ID_IMG'=>$row['id'], - 'URL_IMG'=>add_session_id($pic_mod_base_url.$row['id']), - 'TN_URL_IMG'=>$thumbnail_url, - 'FILENAME_IMG'=>$row['file'], - 'DEFAULTNAME_IMG'=>get_filename_wo_extension($row['file']), - 'NAME_IMG'=>@$row['name'], - 'DATE_IMG'=>date_convert_back(@$row['date_creation']), - 'AUTHOR_IMG'=>@$row['author'], - 'KEYWORDS_IMG'=>@$row['keywords'], - 'COMMENT_IMG'=>@$row['comment'] - )); - } - - // Virtualy associate a picture to a category - $query = ' -SELECT id,name,uppercats,global_rank - FROM '.CATEGORIES_TABLE.' -;'; - display_select_cat_wrapper($query, - array(), - 'associate_option', - true); -} -//----------------------------------------------------------- sending html code -$template->assign_var_from_handle('ADMIN_CONTENT', 'infos_images'); -?> diff --git a/admin/maintenance.php b/admin/maintenance.php index 935e42f0a..ec45196db 100644 --- a/admin/maintenance.php +++ b/admin/maintenance.php @@ -103,6 +103,7 @@ $template->assign_vars( 'U_MAINT_HISTORY' => add_session_id($start_url.'history'), 'U_MAINT_SESSIONS' => add_session_id($start_url.'sessions'), 'U_MAINT_FEEDS' => add_session_id($start_url.'feeds'), + 'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=maintenance', ) ); diff --git a/admin/remote_site.php b/admin/remote_site.php index 774358ddf..5044bd45a 100644 --- a/admin/remote_site.php +++ b/admin/remote_site.php @@ -512,10 +512,13 @@ $template->assign_vars( 'L_REMOTE_SITE_LOCAL_FOUND'=>$lang['remote_site_local_found'], 'L_REMOTE_SITE_LOCAL_NEW'=>$lang['remote_site_local_new'], 'L_REMOTE_SITE_LOCAL_UPDATE'=>$lang['remote_site_local_update'], + + 'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=remote_site', 'F_ACTION'=>add_session_id(PHPWG_ROOT_PATH.'admin.php?page=remote_site') ) ); + // +-----------------------------------------------------------------------+ // | new site creation form | // +-----------------------------------------------------------------------+ diff --git a/admin/update.php b/admin/update.php index b0e26a3f7..e4283a824 100644 --- a/admin/update.php +++ b/admin/update.php @@ -573,6 +573,12 @@ $template->assign_vars( 'L_USED_METADATA'=>$lang['update_used_metadata'], 'METADATA_LIST' => $used_metadata )); + +$template->assign_vars( + array( + 'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=synchronize' + ) + ); // +-----------------------------------------------------------------------+ // | introduction : choices | // +-----------------------------------------------------------------------+ diff --git a/admin/user_list.php b/admin/user_list.php index e4a4c6d7e..0671dabc3 100644 --- a/admin/user_list.php +++ b/admin/user_list.php @@ -49,10 +49,10 @@ if (isset($_POST['submit_add'])) } // +-----------------------------------------------------------------------+ -// | preferences form submission | +// | selected users | // +-----------------------------------------------------------------------+ -if (isset($_POST['pref_submit'])) +if (isset($_POST['delete']) or isset($_POST['pref_submit'])) { $collection = array(); @@ -78,116 +78,154 @@ SELECT id } } - if (count($collection) > 0) + if (count($collection) == 0) + { + array_push($page['errors'], l10n('Select at least one user')); + } +} + +// +-----------------------------------------------------------------------+ +// | delete users | +// +-----------------------------------------------------------------------+ + +if (isset($_POST['delete']) and count($collection) > 0) +{ + if (in_array($conf['webmaster_id'], $collection)) + { + array_push($page['errors'], l10n('Webmaster cannot be deleted')); + } + else { - if (-1 != $_POST['associate']) + if (isset($_POST['confirm_deletion']) and 1 == $_POST['confirm_deletion']) + { + foreach ($collection as $user_id) + { + delete_user($user_id); + } + array_push( + $page['infos'], + sprintf( + l10n('%d users deleted'), + count($collection) + ) + ); + } + else { - $datas = array(); + array_push($page['errors'], l10n('You need to confirm deletion')); + } + } +} - $query = ' +// +-----------------------------------------------------------------------+ +// | preferences form submission | +// +-----------------------------------------------------------------------+ + +if (isset($_POST['pref_submit']) and count($collection) > 0) +{ + if (-1 != $_POST['associate']) + { + $datas = array(); + + $query = ' SELECT user_id FROM '.USER_GROUP_TABLE.' WHERE group_id = '.$_POST['associate'].' ;'; - $associated = array_from_query($query, 'user_id'); - - $associable = array_diff($collection, $associated); - - if (count($associable) > 0) + $associated = array_from_query($query, 'user_id'); + + $associable = array_diff($collection, $associated); + + if (count($associable) > 0) + { + foreach ($associable as $item) { - foreach ($associable as $item) - { - array_push($datas, - array('group_id'=>$_POST['associate'], - 'user_id'=>$item)); - } - - mass_inserts(USER_GROUP_TABLE, - array('group_id', 'user_id'), - $datas); + array_push($datas, + array('group_id'=>$_POST['associate'], + 'user_id'=>$item)); } + + mass_inserts(USER_GROUP_TABLE, + array('group_id', 'user_id'), + $datas); } - - if (-1 != $_POST['dissociate']) - { - $query = ' + } + + if (-1 != $_POST['dissociate']) + { + $query = ' DELETE FROM '.USER_GROUP_TABLE.' WHERE group_id = '.$_POST['dissociate'].' AND user_id IN ('.implode(',', $collection).') '; - pwg_query($query); + pwg_query($query); + } + + // properties to set for the collection (a user list) + $datas = array(); + $dbfields = array('primary' => array('user_id'), 'update' => array()); + + $formfields = + array('nb_image_line', 'nb_line_page', 'template', 'language', + 'recent_period', 'maxwidth', 'expand', 'show_nb_comments', + 'maxheight', 'status'); + + $true_false_fields = array('expand', 'show_nb_comments'); + + foreach ($formfields as $formfield) + { + // special for true/false fields + if (in_array($formfield, $true_false_fields)) + { + $test = $formfield; + } + else + { + $test = $formfield.'_action'; } - - // properties to set for the collection (a user list) - $datas = array(); - $dbfields = array('primary' => array('user_id'), 'update' => array()); - - $formfields = - array('nb_image_line', 'nb_line_page', 'template', 'language', - 'recent_period', 'maxwidth', 'expand', 'show_nb_comments', - 'maxheight', 'status'); - - $true_false_fields = array('expand', 'show_nb_comments'); - foreach ($formfields as $formfield) + if ($_POST[$test] != 'leave') { - // special for true/false fields - if (in_array($formfield, $true_false_fields)) - { - $test = $formfield; - } - else - { - $test = $formfield.'_action'; - } - - if ($_POST[$test] != 'leave') - { - array_push($dbfields['update'], $formfield); - } + array_push($dbfields['update'], $formfield); } - - // updating elements is useful only if needed... - if (count($dbfields['update']) > 0) + } + + // updating elements is useful only if needed... + if (count($dbfields['update']) > 0) + { + $datas = array(); + + foreach ($collection as $user_id) { - $datas = array(); + $data = array(); + $data['user_id'] = $user_id; - foreach ($collection as $user_id) + // TODO : verify if submited values are semanticaly correct + foreach ($dbfields['update'] as $dbfield) { - $data = array(); - $data['user_id'] = $user_id; - - // TODO : verify if submited values are semanticaly correct - foreach ($dbfields['update'] as $dbfield) - { - // if the action is 'unset', the key won't be in row and - // mass_updates function will set this field to NULL - if (in_array($dbfield, $true_false_fields) - or 'set' == $_POST[$dbfield.'_action']) - { - $data[$dbfield] = $_POST[$dbfield]; - } - } - - // Webmaster (user_id = 1) status must not be changed - if (1 == $user_id and isset($data['status'])) + // if the action is 'unset', the key won't be in row and + // mass_updates function will set this field to NULL + if (in_array($dbfield, $true_false_fields) + or 'set' == $_POST[$dbfield.'_action']) { - $data['status'] = 'admin'; + $data[$dbfield] = $_POST[$dbfield]; } - - array_push($datas, $data); } - + + // Webmaster status must not be changed + if ($conf['webmaster_id'] == $user_id and isset($data['status'])) + { + $data['status'] = 'admin'; + } + + array_push($datas, $data); + } + // echo '
';
 //       print_r($datas);
 //       echo '
'; - - mass_updates(USER_INFOS_TABLE, $dbfields, $datas); - } - } - else - { - array_push($page['errors'], l10n('Select at least one user')); + + mass_updates(USER_INFOS_TABLE, $dbfields, $datas); } } diff --git a/category.php b/category.php index 7e2a037f5..a28601e10 100644 --- a/category.php +++ b/category.php @@ -410,7 +410,6 @@ if ( isset ( $page['cat'] ) ) } //------------------------------------------------------------ log informations pwg_log( 'category', $page['title'] ); -mysql_close(); $template->parse('category'); include(PHPWG_ROOT_PATH.'include/page_tail.php'); diff --git a/doc/ChangeLog b/doc/ChangeLog index cdf5bc542..a89d8cc8b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,21 @@ +2005-09-03 Pierrick LE GALL + + * modification : less configuration parameters in administration + screen. These parameters are move to + include/config_default.inc.php. + + * new : ability to add a single picture to caddie from picture.php + + * new : contextual help, only a few pages are available. + + * new : ability to delete users from admin/user_list + + * modification : reorganization of configuration file + + * new : configuration parameter use_exif_mapping + + * improvement : MOD hidemail added to standard + 2005-08-26 Pierrick LE GALL * new : HTML BODY identifier to let CSS stylesheets manage diff --git a/include/config_default.inc.php b/include/config_default.inc.php index 62e4a2782..90d2cabf9 100644 --- a/include/config_default.inc.php +++ b/include/config_default.inc.php @@ -43,6 +43,10 @@ * table, other parameters are in config_*.inc.php */ +// +-----------------------------------------------------------------------+ +// | misc | +// +-----------------------------------------------------------------------+ + // order_by : how to change the order of display for images in a category ? // // There are several fields that can order the display : @@ -67,9 +71,6 @@ $conf['order_by'] = ' ORDER BY date_available DESC, file ASC, id ASC'; // during automated slideshow $conf['slideshow_period'] = 4; -// last_days : options for X last days to displays for comments -$conf['last_days'] = array(1,2,3,10,30,365); - // file_ext : file extensions (case sensitive) authorized $conf['file_ext'] = array('jpg','JPG','png','PNG','gif','GIF','mpg','zip', 'avi','mp3','ogg'); @@ -85,6 +86,106 @@ $conf['top_number'] = 15; // anti-flood_time : number of seconds between 2 comments : 0 to disable $conf['anti-flood_time'] = 60; +// calendar_datefield : date field of table "images" used for calendar +// catgory +$conf['calendar_datefield'] = 'date_creation'; + +// rate : enable feature for rating elements +$conf['rate'] = true; + +// newcat_default_commentable : at creation, must a category be commentable +// or not ? +$conf['newcat_default_commentable'] = 'true'; + +// newcat_default_uploadable : at creation, must a category be uploadable or +// not ? +$conf['newcat_default_uploadable'] = 'false'; + +// newcat_default_visible : at creation, must a category be visible or not ? +// Warning : if the parent category is invisible, the category is +// automatically create invisible. (invisible = locked) +$conf['newcat_default_visible'] = 'true'; + +// newcat_default_status : at creation, must a category be public or private +// ? Warning : if the parent category is private, the category is +// automatically create private. +$conf['newcat_default_status'] = 'public'; + +// level_separator : character string used for separating a category level +// to the sub level. Suggestions : ' / ', ' » ', ' → ', ' - ', +// ' >' +$conf['level_separator'] = ' / '; + +// paginate_pages_around : on paginate navigation bar, how many pages +// display before and after the current page ? +$conf['paginate_pages_around'] = 2; + +// tn_width : default width for thumbnails creation +$conf['tn_width'] = 128; + +// tn_height : default height for thumbnails creation +$conf['tn_height'] = 96; + +// show_version : shall the version of PhpWebGallery be displayed at the +// bottom of each page ? +$conf['show_version'] = true; + +// links : list of external links to add in the menu. An example is the best +// than a long explanation : +// +// $conf['links'] = array( +// 'http://phpwebgallery.net' => 'PWG website', +// 'http://forum.phpwebgallery.net' => 'PWG forum', +// 'http://phpwebgallery.net/doc' => 'PWG wiki' +// ); +// +// If the array is empty, the "Links" box won't be displayed on the main +// page. +$conf['links'] = array(); + +// show_thumbnail_caption : on thumbnails page, show thumbnail captions ? +$conf['show_thumbnail_caption'] = true; + +// show_picture_name_on_title : on picture presentation page, show picture +// name ? +$conf['show_picture_name_on_title'] = true; + +// allow_random_representative : do you wish PhpWebGallery to search among +// categories elements a new representative at each reload ? +// +// If false, an element is randomly or manually chosen to represent its +// category and remains the representative as long as an admin does not +// change it. +// +// Warning : setting this parameter to true is CPU consuming. Each time you +// change the value of this parameter from false to true, an administrator +// must update categories informations in screen [Admin > General > +// Maintenance]. +$conf['allow_random_representative'] = false; + +// allow_html_descriptions : authorize administrators to use HTML in +// category and element description. +$conf['allow_html_descriptions'] = true; + +// gallery_title : Title at top of each page and for RSS feed +$conf['gallery_title'] = 'PhpWebGallery demonstration site'; + +// gallery_description : Short description displayed with gallery title +$conf['gallery_description'] = 'My photos web site'; + +// galery_url : URL given in RSS feed +$conf['gallery_url'] = 'http://demo.phpwebgallery.net'; + +// prefix_thumbnail : string before filename +$conf['prefix_thumbnail'] = 'TN-'; + +// +-----------------------------------------------------------------------+ +// | metadata | +// +-----------------------------------------------------------------------+ + +// show_iptc: Show IPTC metadata on picture.php if asked by user +$conf['show_iptc'] = false; + // show_iptc_mapping : is used for showing IPTC metadata on picture.php // page. For each key of the array, you need to have the same key in the // $lang array. For example, if my first key is 'iptc_keywords' (associated @@ -101,6 +202,10 @@ $conf['show_iptc_mapping'] = array( 'iptc_caption' => '2#120' ); +// use_iptc: Use IPTC data during database synchronization with files +// metadata +$conf['use_iptc'] = false; + // use_iptc_mapping : in which IPTC fields will PhpWebGallery find image // information ? This setting is used during metadata synchronisation. It // associates a phpwebgallery_images column name to a IPTC key @@ -112,6 +217,10 @@ $conf['use_iptc_mapping'] = array( 'comment' => '2#120' ); +// show_exif: Show EXIF metadata on picture.php (table or line presentation +// avalaible) +$conf['show_exif'] = true; + // show_exif_fields : in EXIF fields, you can choose to display fields in // sub-arrays, for example ['COMPUTED']['ApertureFNumber']. for this, add // 'COMPUTED;ApertureFNumber' in $conf['show_exif_fields'] @@ -124,17 +233,29 @@ $conf['use_iptc_mapping'] = array( // for PHP version newer than 4.1.2 : // $conf['show_exif_fields'] = array('CameraMake','CameraModel','DateTime'); // -$conf['show_exif_fields'] = array('Make', - 'Model', - 'DateTime', - 'COMPUTED;ApertureFNumber'); +$conf['show_exif_fields'] = array( + 'Make', + 'Model', + 'DateTimeOriginal', + 'COMPUTED;ApertureFNumber' + ); -// calendar_datefield : date field of table "images" used for calendar -// catgory -$conf['calendar_datefield'] = 'date_creation'; +// use_exif: Use EXIF data during database synchronization with files +// metadata +$conf['use_exif'] = false; -// rate : enable feature for rating elements -$conf['rate'] = true; +// use_exif_mapping: same behaviour as use_iptc_mapping +$conf['use_exif_mapping'] = array( + 'date_creation' => 'DateTimeOriginal' + ); + +// +-----------------------------------------------------------------------+ +// | sessions | +// +-----------------------------------------------------------------------+ + +// authorize_remembering : permits user to stay logged for a long time. It +// creates a cookie on client side. +$conf['authorize_remembering'] = true; // remember_me_length : time of validity for "remember me" cookies, in // seconds. @@ -153,9 +274,9 @@ $conf['session_length'] = 3600; // $conf['session_id_size'] = 10; -// info_nb_elements_page : number of elements to display per page on -// admin/infos_images -$conf['info_nb_elements_page'] = 5; +// +-----------------------------------------------------------------------+ +// | debug | +// +-----------------------------------------------------------------------+ // show_queries : for debug purpose, show queries and execution times $conf['show_queries'] = false; @@ -163,75 +284,18 @@ $conf['show_queries'] = false; // show_gt : display generation time at the bottom of each page $conf['show_gt'] = true; -// newcat_default_commentable : at creation, must a category be commentable -// or not ? -$conf['newcat_default_commentable'] = 'true'; - -// newcat_default_uploadable : at creation, must a category be uploadable or -// not ? -$conf['newcat_default_uploadable'] = 'false'; - -// newcat_default_visible : at creation, must a category be visible or not ? -// Warning : if the parent category is invisible, the category is -// automatically create invisible. (invisible = locked) -$conf['newcat_default_visible'] = 'true'; - -// newcat_default_status : at creation, must a category be public or private -// ? Warning : if the parent category is private, the category is -// automatically create private. -$conf['newcat_default_status'] = 'public'; - -// level_separator : character string used for separating a category level -// to the sub level. Suggestions : ' / ', ' » ', ' → ', ' - ', -// ' >' -$conf['level_separator'] = ' / '; - -// paginate_pages_around : on paginate navigation bar, how many pages -// display before and after the current page ? -$conf['paginate_pages_around'] = 2; - -// tn_width : default width for thumbnails creation -$conf['tn_width'] = 128; - -// tn_height : default height for thumbnails creation -$conf['tn_height'] = 96; - -// show_version : shall the version of PhpWebGallery be displayed at the -// bottom of each page ? -$conf['show_version'] = true; - -// links : list of external links to add in the menu. An example is the best -// than a long explanation : -// -// $conf['links'] = array( -// 'http://phpwebgallery.net' => 'PWG website', -// 'http://forum.phpwebgallery.net' => 'PWG forum', -// 'http://phpwebgallery.net/doc' => 'PWG wiki' -// ); -// -// If the array is empty, the "Links" box won't be displayed on the main -// page. -$conf['links'] = array(); - -// feed_period : how long between two feed refresh ? Possible values are -// "hour", "half day", "day", "week", "month". -$conf['feed_period'] = 'week'; - -// show_thumbnail_caption : on thumbnails page, show thumbnail captions ? -$conf['show_thumbnail_caption'] = true; +// debug_l10n : display a warning message each time an unset language key is +// accessed +$conf['debug_l10n'] = false; -// show_picture_name_on_title : on picture presentation page, show picture -// name ? -$conf['show_picture_name_on_title'] = true; +// +-----------------------------------------------------------------------+ +// | authentication | +// +-----------------------------------------------------------------------+ // apache_authentication : use Apache authentication as reference instead of // users table ? $conf['apache_authentication'] = false; -// debug_l10n : display a warning message each time an unset language key is -// accessed -$conf['debug_l10n'] = false; - // users_table : which table is the reference for users ? Can be a different // table than PhpWebGallery table $conf['users_table'] = $prefixeTable.'users'; @@ -253,30 +317,30 @@ $conf['pass_convert'] = create_function('$s', 'return md5($s);'); // guest_id : id of the anonymous user $conf['guest_id'] = 2; -// allow_random_representative : do you wish PhpWebGallery to search among -// categories elements a new representative at each reload ? -// -// If false, an element is randomly or manually chosen to represent its -// category and remains the representative as long as an admin does not -// change it. -// -// Warning : setting this parameter to true is CPU consuming. Each time you -// change the value of this parameter from false to true, an administrator -// must update categories informations in screen [Admin > General > -// Maintenance]. -$conf['allow_random_representative'] = false; +// webmaster_id : webmaster'id. +$conf['webmaster_id'] = 1; -// allow_html_descriptions : authorize administrators to use HTML in -// category and element description. -$conf['allow_html_descriptions'] = true; +// +-----------------------------------------------------------------------+ +// | upload | +// +-----------------------------------------------------------------------+ -// gallery_title : Title at top of each page and for RSS feed -$conf['gallery_title'] = 'PhpWebGallery demonstration site'; +// upload_maxfilesize: maximum filesize for the uploaded pictures. In +// kilobytes. +$conf['upload_maxfilesize'] = 200; -// gallery_description : Short description displayed with gallery title -$conf['gallery_description'] = 'My photos web site'; +// upload_maxheight: maximum height authorized for the uploaded images. In +// pixels. +$conf['upload_maxheight'] = 800; -// galery_url : URL given in RSS feed -$conf['gallery_url'] = 'http://demo.phpwebgallery.net'; +// upload_maxwidth: maximum width authorized for the uploaded images. In +// kilobytes. +$conf['upload_maxwidth'] = 800; + +// upload_maxheight_thumbnail: maximum height authorized for the uploaded +// thumbnails +$conf['upload_maxheight_thumbnail'] = 100; +// upload_maxwidth_thumbnail: maximum width authorized for the uploaded +// thumbnails +$conf['upload_maxwidth_thumbnail'] = 150; ?> diff --git a/include/functions_metadata.inc.php b/include/functions_metadata.inc.php index 2708810f1..d03327f60 100644 --- a/include/functions_metadata.inc.php +++ b/include/functions_metadata.inc.php @@ -91,4 +91,46 @@ function clean_iptc_value($value) return $value; } + +/** + * returns informations from EXIF metadata, mapping is done at the beginning + * of the function + * + * @param string $filename + * @return array + */ +function get_exif_data($filename, $map) +{ + $result = array(); + + if (!function_exists('read_exif_data')) + { + die('Exif extension not available, admin should disable exif use'); + } + + // Read EXIF data + if ($exif = @read_exif_data($filename)) + { + foreach ($map as $key => $field) + { + if (strpos($field, ';') === false) + { + if (isset($exif[$field])) + { + $result[$key] = $exif[$field]; + } + } + else + { + $tokens = explode(';', $field); + if (isset($exif[$tokens[0]][$tokens[1]])) + { + $result[$key] = $exif[$tokens[0]][$tokens[1]]; + } + } + } + } + + return $result; +} ?> \ No newline at end of file diff --git a/include/page_tail.php b/include/page_tail.php index 5e4a977e6..33f6900cf 100644 --- a/include/page_tail.php +++ b/include/page_tail.php @@ -29,13 +29,11 @@ $template->set_filenames(array('tail'=>'footer.tpl')); $template->assign_vars( array( 'VERSION' => $conf['show_version'] ? PHPWG_VERSION : '', - 'MAIL'=>$conf['mail_webmaster'], 'L_GEN_TIME' => $lang['generation_time'], 'L_SQL_QUERIES_IN' => $lang['sql_queries_in'], 'L_SEND_MAIL' => $lang['send_mail'], 'L_TITLE_MAIL' => $lang['title_send_mail'], - 'L_WEBMASTER'=>$lang['webmaster'], 'L_POWERED_BY'=>$lang['powered_by'] )); //------------------------------------------------------------- generation time @@ -56,6 +54,25 @@ if ($conf['show_gt']) 'SQL_TIME' => number_format($page['queries_time'],3,'.',' ').' s')); } +//--------------------------------------------------------------------- contact + +if (!$user['is_the_guest']) +{ + $query = ' +SELECT '.$conf['user_fields']['email'].' + FROM '.USERS_TABLE.' + WHERE '.$conf['user_fields']['id'].' = '.$conf['webmaster_id'].' +;'; + list($email) = mysql_fetch_array(pwg_query($query)); + + $template->assign_block_vars( + 'contact', + array( + 'MAIL' => $email + ) + ); +} + // // Generate the page // diff --git a/include/scripts.js b/include/scripts.js index 43fb86644..2550233e6 100644 --- a/include/scripts.js +++ b/include/scripts.js @@ -29,4 +29,14 @@ for( i=0; iroot.'/'.$filename; } diff --git a/install/config.sql b/install/config.sql index ba7e8875d..fa27ce1e3 100644 --- a/install/config.sql +++ b/install/config.sql @@ -1,17 +1,10 @@ -- initial configuration for PhpWebGallery -INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('prefix_thumbnail','TN-','thumbnails filename prefix'); -INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('mail_webmaster','','webmaster mail'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('default_language','en_UK.iso-8859-1','Default gallery language'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('default_template','default','Default gallery style'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('default_maxwidth','','maximum width authorized for displaying images'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('default_maxheight','','maximum height authorized for the displaying images'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nb_comment_page','10','number of comments to display on each page'); -INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('upload_maxfilesize','150','maximum filesize for the uploaded pictures'); -INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('upload_maxwidth','800','maximum width authorized for the uploaded images'); -INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('upload_maxheight','600','maximum height authorized for the uploaded images'); -INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('upload_maxwidth_thumbnail','150','maximum width authorized for the uploaded thumbnails'); -INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('upload_maxheight_thumbnail','100','maximum height authorized for the uploaded thumbnails'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('log','false','keep an history of visits on your website'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('comments_validation','false','administrators validate users comments before becoming visible'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('comments_forall','false','even guest not registered can post comments'); diff --git a/install/phpwebgallery_structure.sql b/install/phpwebgallery_structure.sql index 28368df69..5d0bac12a 100644 --- a/install/phpwebgallery_structure.sql +++ b/install/phpwebgallery_structure.sql @@ -77,7 +77,7 @@ CREATE TABLE `phpwebgallery_config` ( DROP TABLE IF EXISTS `phpwebgallery_favorites`; CREATE TABLE `phpwebgallery_favorites` ( - `user_id` smallint(5) unsigned NOT NULL default '0', + `user_id` smallint(5) NOT NULL default '0', `image_id` mediumint(8) unsigned NOT NULL default '0', PRIMARY KEY (`user_id`,`image_id`) ) TYPE=MyISAM; @@ -170,7 +170,7 @@ CREATE TABLE `phpwebgallery_images` ( DROP TABLE IF EXISTS `phpwebgallery_rate`; CREATE TABLE `phpwebgallery_rate` ( - `user_id` smallint(5) unsigned NOT NULL default '0', + `user_id` smallint(5) NOT NULL default '0', `element_id` mediumint(8) unsigned NOT NULL default '0', `rate` tinyint(2) unsigned NOT NULL default '0', PRIMARY KEY (`user_id`,`element_id`) @@ -183,7 +183,7 @@ CREATE TABLE `phpwebgallery_rate` ( DROP TABLE IF EXISTS `phpwebgallery_sessions`; CREATE TABLE `phpwebgallery_sessions` ( `id` varchar(255) binary NOT NULL default '', - `user_id` smallint(5) unsigned NOT NULL default '0', + `user_id` smallint(5) NOT NULL default '0', `expiration` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) TYPE=MyISAM; @@ -206,7 +206,7 @@ CREATE TABLE `phpwebgallery_sites` ( DROP TABLE IF EXISTS `phpwebgallery_user_access`; CREATE TABLE `phpwebgallery_user_access` ( - `user_id` smallint(5) unsigned NOT NULL default '0', + `user_id` smallint(5) NOT NULL default '0', `cat_id` smallint(5) unsigned NOT NULL default '0', PRIMARY KEY (`user_id`,`cat_id`) ) TYPE=MyISAM; @@ -217,7 +217,7 @@ CREATE TABLE `phpwebgallery_user_access` ( DROP TABLE IF EXISTS `phpwebgallery_user_cache`; CREATE TABLE `phpwebgallery_user_cache` ( - `user_id` smallint(5) unsigned NOT NULL default '0', + `user_id` smallint(5) NOT NULL default '0', `need_update` enum('true','false') NOT NULL default 'true', `forbidden_categories` text, PRIMARY KEY (`user_id`) @@ -230,7 +230,7 @@ CREATE TABLE `phpwebgallery_user_cache` ( DROP TABLE IF EXISTS `phpwebgallery_user_feed`; CREATE TABLE `phpwebgallery_user_feed` ( `id` varchar(50) binary NOT NULL default '', - `user_id` smallint(5) unsigned NOT NULL default '0', + `user_id` smallint(5) NOT NULL default '0', `last_check` datetime default NULL, PRIMARY KEY (`id`) ) TYPE=MyISAM; @@ -241,7 +241,7 @@ CREATE TABLE `phpwebgallery_user_feed` ( DROP TABLE IF EXISTS `phpwebgallery_user_group`; CREATE TABLE `phpwebgallery_user_group` ( - `user_id` smallint(5) unsigned NOT NULL default '0', + `user_id` smallint(5) NOT NULL default '0', `group_id` smallint(5) unsigned NOT NULL default '0', PRIMARY KEY (`group_id`,`user_id`) ) TYPE=MyISAM; @@ -252,7 +252,7 @@ CREATE TABLE `phpwebgallery_user_group` ( DROP TABLE IF EXISTS `phpwebgallery_user_infos`; CREATE TABLE `phpwebgallery_user_infos` ( - `user_id` smallint(5) unsigned NOT NULL default '0', + `user_id` smallint(5) NOT NULL default '0', `nb_image_line` tinyint(1) unsigned NOT NULL default '5', `nb_line_page` tinyint(3) unsigned NOT NULL default '3', `status` enum('admin','guest') NOT NULL default 'guest', @@ -273,7 +273,7 @@ CREATE TABLE `phpwebgallery_user_infos` ( DROP TABLE IF EXISTS `phpwebgallery_users`; CREATE TABLE `phpwebgallery_users` ( - `id` smallint(5) unsigned NOT NULL auto_increment, + `id` smallint(5) NOT NULL auto_increment, `username` varchar(20) binary NOT NULL default '', `password` varchar(32) default NULL, `mail_address` varchar(255) default NULL, diff --git a/language/en_UK.iso-8859-1/help/configuration.html b/language/en_UK.iso-8859-1/help/configuration.html new file mode 100644 index 000000000..1ce846feb --- /dev/null +++ b/language/en_UK.iso-8859-1/help/configuration.html @@ -0,0 +1,87 @@ +

Configuration

+ +

This screen let the administrator do basic configuration. Indeed, this +screen only shows simple configuration parameters that should be enough for +the vast majority of administrators. If you want to see other numerous (and +advanced) configuration parameters, read file include/config_default.inc.php.

+ +

This screen is divided in several sections, regrouping configuration +parameters by theme.

+ +

General

+ + + + +

User comments

+ + + +

Default display

+ +

Here you can change display options used by default, when guest is not +connected. Once connected, these options are overloaded by user own options +(modifiable in profile).

+ +

It is possible to change display options for all existing users, but the +screen to consider is Administration, +Identification, Users, where you can options for a selected list of +users.

+ + diff --git a/language/en_UK.iso-8859-1/help/maintenance.html b/language/en_UK.iso-8859-1/help/maintenance.html new file mode 100644 index 000000000..85e905cc9 --- /dev/null +++ b/language/en_UK.iso-8859-1/help/maintenance.html @@ -0,0 +1,38 @@ +

Maintenance

+ +

To optimize page generation time, PhpWebGallery uses cached +information. For example, instead of counting the number of pictures +contained in each category at each page reload, this information is stored +in the database. In theory, this information should always be correct, but +sometimes an error can occur and cached information becomes wrong.

+ +

Some informations become useless with time. Deleting this useless +information from database make you save disk space.

+ + diff --git a/language/en_UK.iso-8859-1/help/remote_site.html b/language/en_UK.iso-8859-1/help/remote_site.html new file mode 100644 index 000000000..38cd8f370 --- /dev/null +++ b/language/en_UK.iso-8859-1/help/remote_site.html @@ -0,0 +1,51 @@ +

Remote site

+ +

PhpWebGallery offers the possibility to use several servers to store the +images which will compose your gallery. It can be useful if your gallery is +installed on one limited space and that you have a big quantity of images to +be shown.

+ +
    + +
  1. edit file tools/create_listing_file.php, + by modifying parameters section such as + $conf['prefix_thumbnail'] or + $conf['use_exif'].
  2. + +
  3. place file tools/create_listing_file.php + modified on your distant website, in the same directory than your category + directories (as the directory galleries of + this website) by ftp. For the example, let's say that you can access http://example.com/galleries/create_listing_file.php.
  4. + +
  5. go to administration panel, General, Remote + sites. Ask to create a new site, for example http://example.com/galleries.
  6. + +
  7. a new remote site is registered. You can perform 4 actions : + +
      + +
    1. generate listing : launches a distant request to + generate a distant file listing
    2. + +
    3. update : reads the distant listing.xml file and synchronizes with + database informations.
    4. + +
    5. clean : removes distant listing.xml file.
    6. + +
    7. delete : deletes the site (and all related + categories and elements) in the database.
    8. + +
    +
  8. +
+ +

You can do all this by hand by generating yourself the listing.xml file, moving it from your distant server +to you local PhpWebGallery root directory and opening the remote site +management screen : PhpWebGallery will propose you to use the found +listing.xml file.

+ diff --git a/language/en_UK.iso-8859-1/help/synchronize.html b/language/en_UK.iso-8859-1/help/synchronize.html new file mode 100644 index 000000000..835e0c52e --- /dev/null +++ b/language/en_UK.iso-8859-1/help/synchronize.html @@ -0,0 +1 @@ +

Synchronize

diff --git a/picture.php b/picture.php index b6995a3ca..c3b9df112 100644 --- a/picture.php +++ b/picture.php @@ -90,6 +90,20 @@ UPDATE '.CATEGORIES_TABLE.' .get_query_string_diff(array('representative')); redirect($url); } + +//-------------------------------------------------------------- caddie filling + +if (isset($_GET['caddie'])) +{ + fill_caddie(array($_GET['image_id'])); + + $url = + PHPWG_ROOT_PATH + .'picture.php' + .get_query_string_diff(array('caddie')); + redirect($url); +} + //---------------------------------------------------------- related categories $query = ' SELECT category_id,uppercats,commentable,global_rank @@ -244,6 +258,7 @@ $url_admin.= '&image_id='.$_GET['image_id']; $url_slide = $picture['current']['url']; $url_slide.= '&slideshow='.$conf['slideshow_period']; + //----------------------------------------------------------- rate registration if (isset($_GET['rate']) and $conf['rate'] @@ -555,6 +570,20 @@ if ('admin' == $user['status'] and is_numeric($page['cat'])) ) ); } + +if ('admin' == $user['status']) +{ + $template->assign_block_vars( + 'caddie', + array( + 'URL' => + add_session_id( + PHPWG_ROOT_PATH.'picture.php' + .get_query_string_diff(array('caddie')).'&caddie=1') + ) + ); +} + //------------------------------------------------------- favorite manipulation if ( !$user['is_the_guest'] ) { @@ -1034,7 +1063,6 @@ if ($page['show_comments']) } //------------------------------------------------------------ log informations pwg_log( 'picture', $title_img, $picture['current']['file'] ); -mysql_close(); $template->parse('picture'); include(PHPWG_ROOT_PATH.'include/page_tail.php'); diff --git a/popuphelp.php b/popuphelp.php new file mode 100644 index 000000000..97ae7532a --- /dev/null +++ b/popuphelp.php @@ -0,0 +1,64 @@ +set_filenames(array('help_content' => $html_file)); + +$template->set_filenames(array('popuphelp' => 'popuphelp.tpl')); + +$template->assign_var_from_handle('HELP_CONTENT', 'help_content'); + +// +-----------------------------------------------------------------------+ +// | html code display | +// +-----------------------------------------------------------------------+ + +$template->parse('popuphelp'); + +include(PHPWG_ROOT_PATH.'include/page_tail.php'); +?> \ No newline at end of file diff --git a/search.php b/search.php index e8645440c..877ca4e6b 100644 --- a/search.php +++ b/search.php @@ -214,7 +214,6 @@ if (sizeof($errors) != 0) } //------------------------------------------------------------ log informations pwg_log( 'search', $title ); -mysql_close(); $template->parse('search'); include(PHPWG_ROOT_PATH.'include/page_tail.php'); ?> diff --git a/template/cclear/admin.tpl b/template/cclear/admin.tpl index 98f555332..70c0f2042 100644 --- a/template/cclear/admin.tpl +++ b/template/cclear/admin.tpl @@ -26,9 +26,6 @@
  • {lang:general}
  • {lang:comments}
  • {lang:conf_default}
  • -
  • {lang:upload}
  • -
  • {lang:conf_cookie}
  • -
  • {lang:metadata}
  • diff --git a/template/cclear/admin/configuration.tpl b/template/cclear/admin/configuration.tpl index 591a1bbca..6129c032c 100644 --- a/template/cclear/admin/configuration.tpl +++ b/template/cclear/admin/configuration.tpl @@ -1,198 +1,118 @@ -

    {lang:title_configuration}

    +
    +
      +
    • (?)
    • +
    +

    {lang:title_configuration}

    +
    -
    - + + +
    -
    - - - - - - - - - - - - - - - - - - - - - + {lang:conf_general_title} + +
      +
    • + + {lang:Yes} + {lang:No} +
    • + +
    • + + {lang:Yes} + {lang:No} +
    • +
    + - - - - - - - - - - - - - - - - - - + {lang:conf_comments_title} + +
      +
    • + + {lang:Yes} + {lang:No} +
    • + +
    • + + +
    • + +
    • + + {lang:Yes} + {lang:No} +
    • +
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + {lang:conf_default_title} + +
      +
    • + + +
    • + +
    • + + +
    • + +
    • + + +
    • + +
    • + + +
    • + +
    • + + +
    • + +
    • + + {lang:Yes} + {lang:No} +
    • + +
    • + + {lang:Yes} + {lang:No} +
    • + +
    • + + +
    • + +
    • + + +
    • +
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {general.L_CONF_TITLE}
     
    {general.L_CONF_MAIL} :
    {general.L_CONF_MAIL_INFO}
    {general.L_CONF_TN_PREFIX} :
    {general.L_CONF_TN_PREFIX_INFO}
    {general.L_CONF_HISTORY} :
    {general.L_CONF_HISTORY_INFO}
    {L_YES}   - {L_NO}
    {general.L_CONF_GALLERY_LOCKED} :
    {general.L_CONF_GALLERY_LOCKED_INFO}
    {L_YES}   - {L_NO}
    {comments.L_CONF_TITLE}
     
    {comments.L_CONF_COMMENTS_ALL} :
    {comments.L_CONF_COMMENTS_ALL_INFO}
    {L_YES}   - {L_NO}
    {comments.L_CONF_NB_COMMENTS_PAGE} :
    {comments.L_CONF_NB_COMMENTS_PAGE_INFO}
    {comments.L_CONF_VALIDATE} :
    {comments.L_CONF_VALIDATE_INFO}
    {L_YES}   - {L_NO}
    {default.L_CONF_TITLE}
     
    {default.L_CONF_LANG} :
    {default.L_CONF_LANG_INFO}
    {default.CONF_LANG_SELECT}
    {default.L_NB_IMAGE_LINE} :
    {default.L_NB_IMAGE_LINE_INFO}
    {default.L_NB_ROW_PAGE} :
    {default.L_NB_ROW_PAGE_INFO}
    {default.L_CONF_STYLE} :
    {default.L_CONF_STYLE_INFO}
    {default.CONF_STYLE_SELECT}
    {default.L_CONF_RECENT} :
    {default.L_CONF_RECENT_INFO}
    {default.L_CONF_EXPAND} :
    {default.L_CONF_EXPAND_INFO}
    {L_YES}   - {L_NO}
    {default.L_NB_COMMENTS} :
    {default.L_NB_COMMENTS_INFO}
    {L_YES}   - {L_NO}
    {default.L_MAXWIDTH} : -
    {default.L_MAXHEIGHT} : -
    {upload.L_CONF_TITLE}
     
    {upload.L_CONF_MAXSIZE} :
    {upload.L_CONF_MAXSIZE_INFO}
    {upload.L_CONF_MAXWIDTH} :
    {upload.L_CONF_MAXWIDTH_INFO}
    {upload.L_CONF_MAXHEIGHT} :
    {upload.L_CONF_MAXHEIGHT_INFO}
    {upload.L_CONF_TN_MAXWIDTH} :
    {upload.L_CONF_TN_MAXWIDTH_INFO}
    {upload.L_CONF_TN_MAXHEIGHT} :
    {upload.L_CONF_TN_MAXHEIGHT_INFO}
    {session.L_CONF_TITLE}
     
    {session.L_CONF_AUTHORIZE_REMEMBERING} :
    {session.L_CONF_AUTHORIZE_REMEMBERING_INFO}
    {L_YES}   - {L_NO}
    {metadata.L_CONF_TITLE}
     
    - {metadata.L_CONF_EXIF} : -
    {metadata.L_CONF_EXIF_INFO} -
    - {L_YES}   - {L_NO} -
    - {metadata.L_CONF_IPTC} : -
    {metadata.L_CONF_IPTC_INFO} -
    - {L_YES}   - {L_NO} -
    - {metadata.L_CONF_SHOW_EXIF} : -
    {metadata.L_CONF_SHOW_EXIF_INFO} -
    - {L_YES}   - {L_NO} -
    - {metadata.L_CONF_SHOW_IPTC} : -
    {metadata.L_CONF_SHOW_IPTC_INFO} -
    - {L_YES}   - {L_NO} -
    - - -
    + + +

    + + +

    diff --git a/template/cclear/admin/element_set_global.tpl b/template/cclear/admin/element_set_global.tpl index 081bb808a..7cd8d1ec5 100644 --- a/template/cclear/admin/element_set_global.tpl +++ b/template/cclear/admin/element_set_global.tpl @@ -17,8 +17,8 @@