diff --git a/admin.php b/admin.php index bb9b91274..af6937881 100644 --- a/admin.php +++ b/admin.php @@ -58,12 +58,14 @@ if (isset($_GET['plugins_new_order'])) if (isset($_GET['change_theme'])) { $admin_themes = array('roma', 'clear'); + $admin_theme_array = array($conf['admin_theme']); + $result = array_diff( + $admin_themes, + $admin_theme_array + ); $new_admin_theme = array_pop( - array_diff( - $admin_themes, - array($conf['admin_theme']) - ) + $result ); conf_update_param('admin_theme', $new_admin_theme); diff --git a/admin/include/functions_metadata.php b/admin/include/functions_metadata.php index 01b453816..794722c93 100644 --- a/admin/include/functions_metadata.php +++ b/admin/include/functions_metadata.php @@ -98,6 +98,10 @@ function get_sync_exif_data($file) if (preg_match('/^(\d{4}).(\d{2}).(\d{2}) (\d{2}).(\d{2}).(\d{2})/', $value, $matches)) { $exif[$pwg_key] = $matches[1].'-'.$matches[2].'-'.$matches[3].' '.$matches[4].':'.$matches[5].':'.$matches[6]; + if ($exif[$pwg_key] == '0000-00-00 00:00:00') + { + $exif[$pwg_key] = Null; + } } elseif (preg_match('/^(\d{4}).(\d{2}).(\d{2})/', $value, $matches)) { @@ -274,7 +278,7 @@ SELECT id, path, representative_ext } $data['date_metadata_update'] = CURRENT_DATE; - + $datas[] = $data; } diff --git a/admin/intro.php b/admin/intro.php index 5f2d00080..23a5a4f5e 100644 --- a/admin/intro.php +++ b/admin/intro.php @@ -206,7 +206,7 @@ if ($du_gb > 100) $template->assign( array( - 'NB_PHOTOS' => number_format($nb_photos, 0, '.', ','), + 'NB_PHOTOS' => $nb_photos, 'NB_ALBUMS' => $nb_categories, 'NB_TAGS' => $nb_tags, 'NB_IMAGE_TAG' => $nb_image_tag, diff --git a/admin/picture_modify.php b/admin/picture_modify.php index 24cdc22d4..0e0aed520 100644 --- a/admin/picture_modify.php +++ b/admin/picture_modify.php @@ -209,6 +209,12 @@ SELECT $tag_selection = get_taglist($query); $row = $page['image']; + +if (isset($data['date_creation'])) +{ + $row['date_creation'] = $data['date_creation']; +} + $storage_category_id = null; if (!empty($row['storage_category_id'])) { diff --git a/admin/themes/default/template/intro.tpl b/admin/themes/default/template/intro.tpl index 8f1187093..0aa0721bd 100644 --- a/admin/themes/default/template/intro.tpl +++ b/admin/themes/default/template/intro.tpl @@ -90,7 +90,7 @@ div.stat-box { {if $NB_PHOTOS > 1} -{$NB_PHOTOS}{'Photos'|translate} +{$NB_PHOTOS|number_format}{'Photos'|translate} {/if} diff --git a/comments.php b/comments.php index d7f0fd3c4..ebd89a987 100644 --- a/comments.php +++ b/comments.php @@ -299,7 +299,7 @@ if (isset($action)) $title= l10n('User comments'); $page['body_id'] = 'theCommentsPage'; -$template->set_filenames(array('comments'=>'comments.tpl')); +$template->set_filenames(array('comments'=>'comments.tpl', 'comment_list'=>'comment_list.tpl')); $template->assign( array( 'F_ACTION'=>PHPWG_ROOT_PATH.'comments.php', @@ -559,6 +559,7 @@ if (!isset($themeconf['hide_menu_on']) OR !in_array('theCommentsPage', $themecon include(PHPWG_ROOT_PATH.'include/page_header.php'); trigger_notify('loc_end_comments'); flush_page_messages(); +if (count($comments) > 0) $template->assign_var_from_handle('COMMENT_LIST', 'comment_list'); $template->pparse('comments'); include(PHPWG_ROOT_PATH.'include/page_tail.php'); ?> \ No newline at end of file diff --git a/include/config_default.inc.php b/include/config_default.inc.php index 5bc8691d3..5bf61d70d 100644 --- a/include/config_default.inc.php +++ b/include/config_default.inc.php @@ -635,6 +635,14 @@ $conf['full_tag_cloud_items_number'] = 200; // cloud in the menubar. Only the most represented tags will be shown $conf['menubar_tag_cloud_items_number'] = 20; +// menubar_tag_cloud_content: 'always_all', 'current_only' or 'all_or_current' +// For the tag cloud in the menubar. +// 'always_all': tag cloud always displays all tags available to the user +// 'current_only': tag cloud always displays the tags from the current pictures +// 'all_or_current': when pictures are displayed, tag cloud shows their tags, but +// when none are displayed, all the tags available to the user are shown. +$conf['menubar_tag_cloud_content'] = 'all_or_current'; + // content_tag_cloud_items_number: number of related tags to show in the tag // cloud on the content page, when the current section is not a set of // tags. Only the most represented tags will be shown diff --git a/include/feedcreator.class.php b/include/feedcreator.class.php index 62ba6c06b..d3cbaeb7f 100644 --- a/include/feedcreator.class.php +++ b/include/feedcreator.class.php @@ -288,7 +288,7 @@ class FeedHtmlField { * Creates a new instance of FeedHtmlField. * @param $string: if given, sets the rawFieldContent property */ - function FeedHtmlField($parFieldContent) { + function __construct($parFieldContent) { if ($parFieldContent) { $this->rawFieldContent = $parFieldContent; } @@ -708,7 +708,7 @@ class FeedDate { * Accepts RFC 822, ISO 8601 date formats as well as unix time stamps. * @param mixed $dateString optional the date this FeedDate will represent. If not specified, the current date and time is used. */ - function FeedDate($dateString="") { + function __construct($dateString="") { if ($dateString=="") $dateString = date("r"); if (is_integer($dateString)) { @@ -884,7 +884,7 @@ class RSSCreator091 extends FeedCreator { */ var $RSSVersion; - function RSSCreator091() { + function __construct() { $this->_setRSSVersion("0.91"); $this->contentType = "application/rss+xml"; } @@ -1016,7 +1016,7 @@ class RSSCreator091 extends FeedCreator { */ class RSSCreator20 extends RSSCreator091 { - function RSSCreator20() { + function __construct() { parent::_setRSSVersion("2.0"); } @@ -1033,7 +1033,7 @@ class RSSCreator20 extends RSSCreator091 { */ class PIECreator01 extends FeedCreator { - function PIECreator01() { + function __construct() { $this->encoding = "utf-8"; } @@ -1091,7 +1091,7 @@ class PIECreator01 extends FeedCreator { */ class AtomCreator03 extends FeedCreator { - function AtomCreator03() { + function __construct() { $this->contentType = "application/atom+xml"; $this->encoding = "utf-8"; } @@ -1159,7 +1159,7 @@ class AtomCreator03 extends FeedCreator { */ class MBOXCreator extends FeedCreator { - function MBOXCreator() { + function __construct() { $this->contentType = "text/plain"; $this->encoding = "ISO-8859-15"; } @@ -1246,7 +1246,7 @@ class MBOXCreator extends FeedCreator { */ class OPMLCreator extends FeedCreator { - function OPMLCreator() { + function __construct() { $this->encoding = "utf-8"; } diff --git a/include/menubar.inc.php b/include/menubar.inc.php index 9fe2ceaab..6b9a183f2 100644 --- a/include/menubar.inc.php +++ b/include/menubar.inc.php @@ -118,7 +118,7 @@ function initialize_menu() //------------------------------------------------------------------------ tags $block = $menu->get_block('mbTags'); - if ( $block!=null and !empty($page['items']) and 'picture' != script_basename() ) + if ( $block!=null and 'picture' != script_basename() ) { if ('tags'==@$page['section']) { @@ -147,9 +147,26 @@ function initialize_menu() ) ); } + $template->assign( 'IS_RELATED', false); } - else + //displays all tags available for the current user + else if ($conf['menubar_tag_cloud_content'] == 'always_all' or ($conf['menubar_tag_cloud_content'] == 'all_or_current' and empty($page['items'])) ) { + $tags = get_available_tags(); + foreach ($tags as $tag) + { + $block->data[] = array_merge( + $tag, + array( + 'URL' => make_index_url( array( 'tags' => array($tag) ) ), + ) + ); + } + $template->assign( 'IS_RELATED', false); + } + //displays only the tags available from the current thumbnails displayed + else if ( !empty($page['items']) and ($conf['menubar_tag_cloud_content'] == 'current_only' or $conf['menubar_tag_cloud_content'] == 'all_or_current') ) + { $selection = array_slice( $page['items'], $page['start'], $page['nb_image_page'] ); $tags = add_level_to_tags( get_common_tags($selection, $conf['content_tag_cloud_items_number']) ); foreach ($tags as $tag) @@ -161,6 +178,7 @@ function initialize_menu() ) ); } + $template->assign( 'IS_RELATED', true); } if ( !empty($block->data) ) { diff --git a/include/picture_comment.inc.php b/include/picture_comment.inc.php index 20a72e5ca..e8735ad08 100644 --- a/include/picture_comment.inc.php +++ b/include/picture_comment.inc.php @@ -274,6 +274,8 @@ SELECT } $template->assign('comment_add', $tpl_var); } + $template->set_filenames( array('comment_list' => 'comment_list.tpl')); + $template->assign_var_from_handle('COMMENT_LIST', 'comment_list'); } ?> \ No newline at end of file diff --git a/include/section_init.inc.php b/include/section_init.inc.php index e2e0c0712..a5be2844d 100644 --- a/include/section_init.inc.php +++ b/include/section_init.inc.php @@ -625,6 +625,7 @@ if ( 'categories'==$page['section'] and isset($page['category']) ) if ($need_redirect) { + check_restrictions($page['category']['id']); $redirect_url = script_basename()=='picture' ? duplicate_picture_url() : duplicate_index_url(); if (!headers_sent()) diff --git a/include/ws_functions/pwg.permissions.php b/include/ws_functions/pwg.permissions.php index 292ecc6af..1a1006f8a 100644 --- a/include/ws_functions/pwg.permissions.php +++ b/include/ws_functions/pwg.permissions.php @@ -101,7 +101,7 @@ SELECT group_id, cat_id // filter by group and user foreach ($perms as $cat_id => &$cat) { - if (isset($filters['group_id'])) + if (isset($params['group_id'])) { if (empty($cat['groups']) or count(array_intersect($cat['groups'], $params['group_id'])) == 0) { @@ -109,7 +109,7 @@ SELECT group_id, cat_id continue; } } - if (isset($filters['user_id'])) + if (isset($params['user_id'])) { if ( (empty($cat['users_indirect']) or count(array_intersect($cat['users_indirect'], $params['user_id'])) == 0) diff --git a/install/piwigo_structure-mysql.sql b/install/piwigo_structure-mysql.sql index c7b33b9f7..8715b2235 100644 --- a/install/piwigo_structure-mysql.sql +++ b/install/piwigo_structure-mysql.sql @@ -168,6 +168,7 @@ CREATE TABLE `piwigo_image_category` ( -- Table structure for table `piwigo_image_format` -- +DROP TABLE IF EXISTS `piwigo_image_format`; CREATE TABLE `piwigo_image_format` ( `format_id` int(11) unsigned NOT NULL auto_increment, `image_id` mediumint(8) unsigned NOT NULL DEFAULT '0', @@ -370,6 +371,7 @@ CREATE TABLE `piwigo_user_access` ( -- Table structure for table `piwigo_user_auth_keys` -- +DROP TABLE IF EXISTS `piwigo_user_auth_keys`; CREATE TABLE `piwigo_user_auth_keys` ( `auth_key_id` int(11) unsigned NOT NULL AUTO_INCREMENT, `auth_key` varchar(255) NOT NULL, diff --git a/themes/default/template/comments.tpl b/themes/default/template/comments.tpl index 96f42b09b..6a38dcf99 100644 --- a/themes/default/template/comments.tpl +++ b/themes/default/template/comments.tpl @@ -102,9 +102,9 @@ {if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if} -{if isset($comments)} +{if isset($COMMENT_LIST)}