This commit is contained in:
modus75
2017-09-25 21:44:13 +02:00
18 changed files with 234 additions and 190 deletions
+6 -4
View File
@@ -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);
+5 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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,
+6
View File
@@ -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']))
{
+1 -1
View File
@@ -90,7 +90,7 @@ div.stat-box {
{if $NB_PHOTOS > 1}
<a class="stat-box" href="{$U_ADD_PHOTOS}">
<i class="icon-picture"></i>
<span class="number">{$NB_PHOTOS}</span><span class="caption">{'Photos'|translate}</span>
<span class="number">{$NB_PHOTOS|number_format}</span><span class="caption">{'Photos'|translate}</span>
</a>
{/if}
+2 -1
View File
@@ -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');
?>
+8
View File
@@ -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
+8 -8
View File
@@ -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";
}
+20 -2
View File
@@ -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) )
{
+2
View File
@@ -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');
}
?>
+1
View File
@@ -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())
+2 -2
View File
@@ -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)
+2
View File
@@ -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,
+2 -2
View File
@@ -102,9 +102,9 @@
{if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
{if isset($comments)}
{if isset($COMMENT_LIST)}
<div id="comments">
{include file='comment_list.tpl' comment_derivative_params=$derivative_params}
{$COMMENT_LIST}
</div>
{/if}
+1 -1
View File
@@ -1,4 +1,4 @@
<dt>{'Related tags'|@translate}</dt>
<dt>{if $IS_RELATED}{'Related tags'|@translate}{else}{'Tags'|@translate}{/if}</dt>
<dd>
<div id="menuTagCloud">
{foreach from=$block->data item=tag}
+1 -1
View File
@@ -380,7 +380,7 @@ function setPrivacyLevel(id, level){
{if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
</div>
{/if}
{include file='comment_list.tpl'}
{$COMMENT_LIST}
</div>
{/if}
<div style="clear:both"></div>
+1 -1
View File
@@ -26,7 +26,7 @@
if (menubar.length == 1 && p_main_menu!="disabled") {
menuswitcher.html('<div class="switchArrow">&nbsp;</div>');
if (session_storage['page-menu'] == undefined && p_main_menu == 'off') {
if (session_storage['page-menu'] === undefined && p_main_menu == 'off') {
session_storage['page-menu'] = 'hidden';
}
+165 -165
View File
@@ -1,172 +1,172 @@
(function() {
var session_storage = window.sessionStorage || {};
var menubar=jQuery("#menubar"),
menuswitcher,
content=jQuery("#the_page > .content"),
pcontent=jQuery("#content"),
imageInfos=jQuery("#imageInfos"),
infoswitcher,
theImage=jQuery("#theImage"),
comments=jQuery("#thePicturePage #comments"),
comments_button,
commentsswitcher,
comments_add,
comments_top_offset = 0;
function hideMenu(delay) {
menubar.hide(delay);
menuswitcher.addClass("menuhidden").removeClass("menushown");
content.addClass("menuhidden").removeClass("menushown");
pcontent.addClass("menuhidden").removeClass("menushown");
session_storage['picture-menu'] = 'hidden';
}
function showMenu(delay) {
menubar.show(delay);
menuswitcher.addClass("menushown").removeClass("menuhidden");
content.addClass("menushown").removeClass("menuhidden");
pcontent.addClass("menushown").removeClass("menuhidden");
session_storage['picture-menu'] = 'visible';
}
function hideInfo(delay) {
imageInfos.hide(delay);
infoswitcher.addClass("infohidden").removeClass("infoshown");
theImage.addClass("infohidden").removeClass("infoshown");
session_storage['side-info'] = 'hidden';
}
function showInfo(delay) {
imageInfos.show(delay);
infoswitcher.addClass("infoshown").removeClass("infohidden");
theImage.addClass("infoshown").removeClass("infohidden");
session_storage['side-info'] = 'visible';
}
function commentsToggle() {
if (comments.hasClass("commentshidden")) {
comments.removeClass("commentshidden").addClass("commentsshown");
comments_button.addClass("comments_toggle_off").removeClass("comments_toggle_on");;
session_storage['comments'] = 'visible';
comments_top_offset = comments_add.offset().top - parseFloat(comments_add.css('marginTop').replace(/auto/, 0));
}
else {
comments.addClass("commentshidden").removeClass("commentsshown");
comments_button.addClass("comments_toggle_on").removeClass("comments_toggle_off");;
(function() {
var session_storage = window.sessionStorage || {};
var menubar=jQuery("#menubar"),
menuswitcher,
content=jQuery("#the_page > .content"),
pcontent=jQuery("#content"),
imageInfos=jQuery("#imageInfos"),
infoswitcher,
theImage=jQuery("#theImage"),
comments=jQuery("#thePicturePage #comments"),
comments_button,
commentsswitcher,
comments_add,
comments_top_offset = 0;
function hideMenu(delay) {
menubar.hide(delay);
menuswitcher.addClass("menuhidden").removeClass("menushown");
content.addClass("menuhidden").removeClass("menushown");
pcontent.addClass("menuhidden").removeClass("menushown");
session_storage['picture-menu'] = 'hidden';
}
function showMenu(delay) {
menubar.show(delay);
menuswitcher.addClass("menushown").removeClass("menuhidden");
content.addClass("menushown").removeClass("menuhidden");
pcontent.addClass("menushown").removeClass("menuhidden");
session_storage['picture-menu'] = 'visible';
}
function hideInfo(delay) {
imageInfos.hide(delay);
infoswitcher.addClass("infohidden").removeClass("infoshown");
theImage.addClass("infohidden").removeClass("infoshown");
session_storage['side-info'] = 'hidden';
}
function showInfo(delay) {
imageInfos.show(delay);
infoswitcher.addClass("infoshown").removeClass("infohidden");
theImage.addClass("infoshown").removeClass("infohidden");
session_storage['side-info'] = 'visible';
}
function commentsToggle() {
if (comments.hasClass("commentshidden")) {
comments.removeClass("commentshidden").addClass("commentsshown");
comments_button.addClass("comments_toggle_off").removeClass("comments_toggle_on");
session_storage['comments'] = 'visible';
comments_top_offset = comments_add.offset().top - parseFloat(comments_add.css('marginTop').replace(/auto/, 0));
}
else {
comments.addClass("commentshidden").removeClass("commentsshown");
comments_button.addClass("comments_toggle_on").removeClass("comments_toggle_off");
session_storage['comments'] = 'hidden';
comments_top_offset = 0;
}
}
jQuery(function(){
// side-menu show/hide
if (menubar.length == 1 && p_main_menu!="disabled") {
menuswitcher=jQuery("#menuSwitcher");
menuswitcher.html('<div class="switchArrow">&nbsp;</div>');
if (session_storage['picture-menu'] == undefined && p_main_menu == 'off') {
session_storage['picture-menu'] = 'hidden';
}
if (session_storage['picture-menu'] == 'hidden') {
hideMenu(0);
}
else {
showMenu(0);
}
menuswitcher.click(function(e){
if (menubar.is(":hidden")) {
showMenu(0);
}
else {
hideMenu(0);
}
e.preventDefault();
});
}
// info show/hide
if (imageInfos.length == 1 && p_pict_descr!="disabled") {
infoswitcher=jQuery("#infoSwitcher");
infoswitcher.html('<div class="switchArrow">&nbsp;</div>');
if (session_storage['side-info'] == undefined && p_pict_descr == 'off') {
session_storage['side-info'] = 'hidden';
}
if (session_storage['side-info'] == 'hidden') {
hideInfo(0);
}
else {
showInfo(0);
}
infoswitcher.click(function(e){
if (imageInfos.is(":hidden")) {
showInfo(0);
}
else {
hideInfo(0);
}
e.preventDefault();
});
}
// comments show/hide
if (comments.length == 1 && p_pict_comment!="disabled") {
commentsswitcher=jQuery("#commentsSwitcher");
comments_button=jQuery("#comments h3");
comments_add=jQuery('#commentAdd');
commentsswitcher.html('<div class="switchArrow">&nbsp;</div>');
if (comments_button.length == 0) {
jQuery("#addComment").before("<h3>Comments</h3>");
comments_button=jQuery("#comments h3");
}
if (session_storage['comments'] == undefined && p_pict_comment == 'off') {
session_storage['comments'] = 'hidden';
}
if (session_storage['comments'] == 'hidden') {
comments.addClass("commentshidden");
comments_button.addClass("comments_toggle comments_toggle_on");
}
else {
comments.addClass("commentsshown");
comments_button.addClass("comments_toggle comments_toggle_off");
}
comments_button.click(commentsToggle);
commentsswitcher.click(commentsToggle);
jQuery(window).scroll(function (event) {
if (comments_top_offset==0) return;
var y = jQuery(this).scrollTop();
if (y >= comments_top_offset) {
comments_top_offset = 0;
}
}
jQuery(function(){
// side-menu show/hide
if (menubar.length == 1 && p_main_menu!="disabled") {
menuswitcher=jQuery("#menuSwitcher");
menuswitcher.html('<div class="switchArrow">&nbsp;</div>');
if (session_storage['picture-menu'] === undefined && p_main_menu == 'off') {
session_storage['picture-menu'] = 'hidden';
}
if (session_storage['picture-menu'] == 'hidden') {
hideMenu(0);
}
else {
showMenu(0);
}
menuswitcher.click(function(e){
if (menubar.is(":hidden")) {
showMenu(0);
}
else {
hideMenu(0);
}
e.preventDefault();
});
}
// info show/hide
if (imageInfos.length == 1 && p_pict_descr!="disabled") {
infoswitcher=jQuery("#infoSwitcher");
infoswitcher.html('<div class="switchArrow">&nbsp;</div>');
if (session_storage['side-info'] === undefined && p_pict_descr == 'off') {
session_storage['side-info'] = 'hidden';
}
if (session_storage['side-info'] == 'hidden') {
hideInfo(0);
}
else {
showInfo(0);
}
infoswitcher.click(function(e){
if (imageInfos.is(":hidden")) {
showInfo(0);
}
else {
hideInfo(0);
}
e.preventDefault();
});
}
// comments show/hide
if (comments.length == 1 && p_pict_comment!="disabled") {
commentsswitcher=jQuery("#commentsSwitcher");
comments_button=jQuery("#comments h3");
comments_add=jQuery('#commentAdd');
commentsswitcher.html('<div class="switchArrow">&nbsp;</div>');
if (comments_button.length == 0) {
jQuery("#addComment").before("<h3>Comments</h3>");
comments_button=jQuery("#comments h3");
}
if (session_storage['comments'] === undefined && p_pict_comment == 'off') {
session_storage['comments'] = 'hidden';
}
if (session_storage['comments'] == 'hidden') {
comments.addClass("commentshidden");
comments_button.addClass("comments_toggle comments_toggle_on");
}
else {
comments.addClass("commentsshown");
comments_button.addClass("comments_toggle comments_toggle_off");
}
comments_button.click(commentsToggle);
commentsswitcher.click(commentsToggle);
jQuery(window).scroll(function (event) {
if (comments_top_offset==0) return;
var y = jQuery(this).scrollTop();
if (y >= comments_top_offset) {
comments_add.css({
'position': 'absolute',
'top': y-comments.offset().top+10
});
}
else {
});
}
else {
comments_add.css({
'position': 'static',
'top': 0
});
}
});
if (comments_add.is(":visible")) {
comments_top_offset = comments_add.offset().top - parseFloat(comments_add.css('marginTop').replace(/auto/, 0));
}
}
});
}());
});
}
});
if (comments_add.is(":visible")) {
comments_top_offset = comments_add.offset().top - parseFloat(comments_add.css('marginTop').replace(/auto/, 0));
}
}
});
}());