mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-26 11:19:55 +03:00
merge r6368,6410 from branch-2.1 to trunk
- merged the linkroot integration with the existing gallery_url (unique $conf['gallery_url'] used for RSS, mail homepage root in the browse path) - added an option $conf['debug_mail'] - if set all outgoing mails are saved into local_data_dir git-svn-id: http://piwigo.org/svn/trunk@6411 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
ef50e468d4
commit
722c4a3a97
10 changed files with 55 additions and 67 deletions
|
@ -114,10 +114,6 @@ if (isset($_POST['submit']) and !is_adviser())
|
||||||
{
|
{
|
||||||
case 'main' :
|
case 'main' :
|
||||||
{
|
{
|
||||||
if ( !url_is_remote($_POST['gallery_url']) )
|
|
||||||
{
|
|
||||||
array_push($page['errors'], l10n('The gallery URL is not valid.'));
|
|
||||||
}
|
|
||||||
foreach( $main_checkboxes as $checkbox)
|
foreach( $main_checkboxes as $checkbox)
|
||||||
{
|
{
|
||||||
$_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true';
|
$_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true';
|
||||||
|
|
|
@ -93,7 +93,7 @@ function quote_check_key_list($check_key_list = array())
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Execute all main queries to get list of user
|
* Execute all main queries to get list of user
|
||||||
*
|
*
|
||||||
* Type are the type of list 'subscribe', 'send'
|
* Type are the type of list 'subscribe', 'send'
|
||||||
*
|
*
|
||||||
|
@ -110,7 +110,7 @@ function get_user_notifications($action, $check_key_list = array(), $enabled_fil
|
||||||
$quoted_check_key_list = quote_check_key_list($check_key_list);
|
$quoted_check_key_list = quote_check_key_list($check_key_list);
|
||||||
if (count($quoted_check_key_list) != 0 )
|
if (count($quoted_check_key_list) != 0 )
|
||||||
{
|
{
|
||||||
$query_and_check_key = ' and
|
$query_and_check_key = ' and
|
||||||
check_key in ('.implode(",", $quoted_check_key_list).') ';
|
check_key in ('.implode(",", $quoted_check_key_list).') ';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -131,7 +131,7 @@ from
|
||||||
'.USERS_TABLE.' as U
|
'.USERS_TABLE.' as U
|
||||||
where
|
where
|
||||||
N.user_id = U.'.$conf['user_fields']['id'];
|
N.user_id = U.'.$conf['user_fields']['id'];
|
||||||
|
|
||||||
if ($action == 'send')
|
if ($action == 'send')
|
||||||
{
|
{
|
||||||
// No mail empty and all users enabled
|
// No mail empty and all users enabled
|
||||||
|
@ -418,7 +418,7 @@ function do_subscribe_unsubscribe_notification_by_mail($is_admin_request, $is_su
|
||||||
(
|
(
|
||||||
$section_action_by => true,
|
$section_action_by => true,
|
||||||
'GOTO_GALLERY_TITLE' => $conf['gallery_title'],
|
'GOTO_GALLERY_TITLE' => $conf['gallery_title'],
|
||||||
'GOTO_GALLERY_URL' => $conf['gallery_url'],
|
'GOTO_GALLERY_URL' => get_gallery_home_url(),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -523,4 +523,4 @@ function subscribe_notification_by_mail($is_admin_request, $check_key_list = arr
|
||||||
return do_subscribe_unsubscribe_notification_by_mail($is_admin_request, true, $check_key_list);
|
return do_subscribe_unsubscribe_notification_by_mail($is_admin_request, true, $check_key_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -381,7 +381,7 @@ function do_action_send_mail_notification($action = 'list_to_send', $check_key_l
|
||||||
array
|
array
|
||||||
(
|
(
|
||||||
'GOTO_GALLERY_TITLE' => $conf['gallery_title'],
|
'GOTO_GALLERY_TITLE' => $conf['gallery_title'],
|
||||||
'GOTO_GALLERY_URL' => $conf['gallery_url'],
|
'GOTO_GALLERY_URL' => get_gallery_home_url(),
|
||||||
'SEND_AS_NAME' => $env_nbm['send_as_name'],
|
'SEND_AS_NAME' => $env_nbm['send_as_name'],
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
4
feed.php
4
feed.php
|
@ -110,7 +110,7 @@ $rss->encoding=get_pwg_charset();
|
||||||
$rss->title = $conf['gallery_title'];
|
$rss->title = $conf['gallery_title'];
|
||||||
$rss->title.= ' (as '.stripslashes($user['username']).')';
|
$rss->title.= ' (as '.stripslashes($user['username']).')';
|
||||||
|
|
||||||
$rss->link = $conf['gallery_url'];
|
$rss->link = get_gallery_home_url();
|
||||||
|
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | Feed creation |
|
// | Feed creation |
|
||||||
|
@ -125,7 +125,7 @@ if (!$image_only)
|
||||||
{
|
{
|
||||||
$item = new FeedItem();
|
$item = new FeedItem();
|
||||||
$item->title = sprintf(l10n('New on %s'), format_date($dbnow) );
|
$item->title = sprintf(l10n('New on %s'), format_date($dbnow) );
|
||||||
$item->link = $conf['gallery_url'];
|
$item->link = get_gallery_home_url();
|
||||||
|
|
||||||
// content creation
|
// content creation
|
||||||
$item->description = '<ul>';
|
$item->description = '<ul>';
|
||||||
|
|
|
@ -328,19 +328,13 @@ $conf['double_password_type_in_admin'] = false;
|
||||||
// Define if logins must be case sentitive or not at users registration. ie :
|
// Define if logins must be case sentitive or not at users registration. ie :
|
||||||
// If set true, the login "user" will equal "User" or "USER" or "user",
|
// If set true, the login "user" will equal "User" or "USER" or "user",
|
||||||
// etc. ... And it will be impossible to use such login variation to create a
|
// etc. ... And it will be impossible to use such login variation to create a
|
||||||
// new user account.
|
// new user account.
|
||||||
$conf['insensitive_case_logon'] = false;
|
$conf['insensitive_case_logon'] = false;
|
||||||
|
|
||||||
// how should we check for unicity when adding a photo. Can be 'md5sum' or
|
// how should we check for unicity when adding a photo. Can be 'md5sum' or
|
||||||
// 'filename'
|
// 'filename'
|
||||||
$conf['uniqueness_mode'] = 'md5sum';
|
$conf['uniqueness_mode'] = 'md5sum';
|
||||||
|
|
||||||
// home_page : relative url of the homepage. Empty by default.
|
|
||||||
// It points to the index of the gallery.
|
|
||||||
// This parameter is used if home page is not index.php of the gallery.
|
|
||||||
// We suggest avoid the names "index.htm" or "index.html" if you set $conf['php_extension_in_urls'] to false.
|
|
||||||
$conf['home_page'] = '';
|
|
||||||
|
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | metadata |
|
// | metadata |
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
|
@ -464,6 +458,9 @@ $conf['debug_l10n'] = false;
|
||||||
// activate template debugging - a new window will appear
|
// activate template debugging - a new window will appear
|
||||||
$conf['debug_template'] = false;
|
$conf['debug_template'] = false;
|
||||||
|
|
||||||
|
// save copies of sent mails into local data dir
|
||||||
|
$conf['debug_mail'] = false;
|
||||||
|
|
||||||
// die_on_sql_error: if an SQL query fails, should everything stop?
|
// die_on_sql_error: if an SQL query fails, should everything stop?
|
||||||
$conf['die_on_sql_error'] = true;
|
$conf['die_on_sql_error'] = true;
|
||||||
|
|
||||||
|
|
|
@ -150,38 +150,6 @@ function get_strict_email_list($email_list)
|
||||||
return implode(',', $result);
|
return implode(',', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an completed array template/theme
|
|
||||||
* completed with get_default_theme()
|
|
||||||
*
|
|
||||||
* @params:
|
|
||||||
* - args: incompleted array of template/theme
|
|
||||||
* o template: template to use [default get_default_theme()]
|
|
||||||
* o theme: template to use [default get_default_theme()]
|
|
||||||
*/
|
|
||||||
function get_array_template_theme($args = array())
|
|
||||||
{
|
|
||||||
global $conf;
|
|
||||||
|
|
||||||
$res = array();
|
|
||||||
|
|
||||||
if (empty($args['template']) or empty($args['theme']))
|
|
||||||
{
|
|
||||||
list($res['template'], $res['theme']) = explode('/', get_default_theme());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($args['template']))
|
|
||||||
{
|
|
||||||
$res['template'] = $args['template'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($args['theme']))
|
|
||||||
{
|
|
||||||
$res['theme'] = $args['theme'];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $res;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an new mail template
|
* Return an new mail template
|
||||||
|
@ -641,9 +609,7 @@ function pwg_mail($to, $args = array())
|
||||||
'CONTENT_ENCODING' => get_pwg_charset(),
|
'CONTENT_ENCODING' => get_pwg_charset(),
|
||||||
|
|
||||||
// Footer
|
// Footer
|
||||||
'GALLERY_URL' =>
|
'GALLERY_URL' => get_gallery_home_url(),
|
||||||
isset($page['gallery_url']) ?
|
|
||||||
$page['gallery_url'] : $conf['gallery_url'],
|
|
||||||
'GALLERY_TITLE' =>
|
'GALLERY_TITLE' =>
|
||||||
isset($page['gallery_title']) ?
|
isset($page['gallery_title']) ?
|
||||||
$page['gallery_title'] : $conf['gallery_title'],
|
$page['gallery_title'] : $conf['gallery_title'],
|
||||||
|
@ -828,13 +794,13 @@ function move_ccs_rules_to_body($content)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Testing block*/
|
/*Testing block*/
|
||||||
/*function pwg_send_mail_test($result, $to, $subject, $content, $headers, $args)
|
function pwg_send_mail_test($result, $to, $subject, $content, $headers, $args)
|
||||||
{
|
{
|
||||||
global $conf, $user, $lang_info;
|
global $conf, $user, $lang_info;
|
||||||
$dir = $conf['local_data_dir'].'/tmp';
|
$dir = $conf['local_data_dir'].'/tmp';
|
||||||
if ( mkgetdir( $dir, MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR) )
|
if ( mkgetdir( $dir, MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR) )
|
||||||
{
|
{
|
||||||
$filename = $dir.'/mail.'.stripslashes($user['username']).'.'.$lang_info['code'].'.'.$args['template'].'.'.$args['theme'];
|
$filename = $dir.'/mail.'.stripslashes($user['username']).'.'.$lang_info['code'].'.'.$args['theme'].'-'.date('YmdHis');
|
||||||
if ($args['content_format'] == 'text/plain')
|
if ($args['content_format'] == 'text/plain')
|
||||||
{
|
{
|
||||||
$filename .= '.txt';
|
$filename .= '.txt';
|
||||||
|
@ -852,7 +818,8 @@ function move_ccs_rules_to_body($content)
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
add_event_handler('send_mail', 'pwg_send_mail_test', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 6);*/
|
if ($conf['debug_mail'])
|
||||||
|
add_event_handler('send_mail', 'pwg_send_mail_test', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 6);
|
||||||
|
|
||||||
|
|
||||||
add_event_handler('send_mail', 'pwg_send_mail', EVENT_HANDLER_PRIORITY_NEUTRAL, 5);
|
add_event_handler('send_mail', 'pwg_send_mail', EVENT_HANDLER_PRIORITY_NEUTRAL, 5);
|
||||||
|
|
|
@ -58,7 +58,7 @@ function get_absolute_root_url($with_scheme=true)
|
||||||
$url = '';
|
$url = '';
|
||||||
if ($with_scheme)
|
if ($with_scheme)
|
||||||
{
|
{
|
||||||
if (isset($_SERVER['HTTPS']) &&
|
if (isset($_SERVER['HTTPS']) &&
|
||||||
((strtolower($_SERVER['HTTPS']) == 'on') or ($_SERVER['HTTPS'] == 1)))
|
((strtolower($_SERVER['HTTPS']) == 'on') or ($_SERVER['HTTPS'] == 1)))
|
||||||
{
|
{
|
||||||
$url .= 'https://';
|
$url .= 'https://';
|
||||||
|
@ -727,4 +727,23 @@ function embellish_url($url)
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the 'home page' of this gallery
|
||||||
|
*/
|
||||||
|
function get_gallery_home_url()
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
if (!empty($conf['gallery_url']))
|
||||||
|
{
|
||||||
|
if (url_is_remote($conf['gallery_url']) or strncmp($conf['gallery_url'], '/', 1)==0)
|
||||||
|
{
|
||||||
|
return $conf['gallery_url'];
|
||||||
|
}
|
||||||
|
return get_root_url().$conf['gallery_url'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return make_index_url();
|
||||||
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
|
@ -219,8 +219,6 @@ $forbidden = get_sql_condition_FandF(
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
if ('categories' == $page['section'])
|
if ('categories' == $page['section'])
|
||||||
{
|
{
|
||||||
$page['title'] = '<a href="'.get_absolute_root_url().$conf['home_page'].'">'.l10n('Home').'</a>';
|
|
||||||
|
|
||||||
if (isset($page['category']))
|
if (isset($page['category']))
|
||||||
{
|
{
|
||||||
$page = array_merge(
|
$page = array_merge(
|
||||||
|
@ -232,11 +230,12 @@ if ('categories' == $page['section'])
|
||||||
$page['category']['comment'],
|
$page['category']['comment'],
|
||||||
'main_page_category_description'
|
'main_page_category_description'
|
||||||
),
|
),
|
||||||
'title' =>
|
'title' => get_cat_display_name($page['category']['upper_names'], '', false),
|
||||||
$page['title'].$conf['level_separator'].get_cat_display_name($page['category']['upper_names'], '', false),
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
$page['title'] = ''; // will be set later
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
|
@ -373,8 +372,8 @@ SELECT DISTINCT image_id'.get_extra_fields($conf['order_by']).'
|
||||||
$page = array_merge(
|
$page = array_merge(
|
||||||
$page,
|
$page,
|
||||||
array(
|
array(
|
||||||
'title' => l10n('Favorites')
|
'title' => l10n('Favorites')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!empty($_GET['action']) && ($_GET['action'] == 'remove_all_from_favorites'))
|
if (!empty($_GET['action']) && ($_GET['action'] == 'remove_all_from_favorites'))
|
||||||
|
@ -558,6 +557,16 @@ if (isset($page['chronology_field']))
|
||||||
initialize_calendar();
|
initialize_calendar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// title update
|
||||||
|
if (isset($page['title']))
|
||||||
|
{
|
||||||
|
if (!empty($page['title']))
|
||||||
|
{
|
||||||
|
$page['title'] = $conf['level_separator'].$page['title'];
|
||||||
|
}
|
||||||
|
$page['title'] = '<a href="'.get_gallery_home_url().'">'.l10n('Home').'</a>'.$page['title'];
|
||||||
|
}
|
||||||
|
|
||||||
// add meta robots noindex, nofollow to avoid unnecesary robot crawls
|
// add meta robots noindex, nofollow to avoid unnecesary robot crawls
|
||||||
$page['meta_robots']=array();
|
$page['meta_robots']=array();
|
||||||
if ( isset($page['chronology_field'])
|
if ( isset($page['chronology_field'])
|
||||||
|
|
|
@ -10,7 +10,7 @@ INSERT INTO piwigo_config (param,value,comment) VALUES ('email_admin_on_comment_
|
||||||
INSERT INTO piwigo_config (param,value,comment) VALUES ('email_admin_on_comment_deletion','false','Send an email to the administrators when a comment is deleted');
|
INSERT INTO piwigo_config (param,value,comment) VALUES ('email_admin_on_comment_deletion','false','Send an email to the administrators when a comment is deleted');
|
||||||
INSERT INTO piwigo_config (param,value,comment) VALUES ('gallery_locked','false','Lock your gallery temporary for non admin users');
|
INSERT INTO piwigo_config (param,value,comment) VALUES ('gallery_locked','false','Lock your gallery temporary for non admin users');
|
||||||
INSERT INTO piwigo_config (param,value,comment) VALUES ('gallery_title','Piwigo demonstration site','Title at top of each page and for RSS feed');
|
INSERT INTO piwigo_config (param,value,comment) VALUES ('gallery_title','Piwigo demonstration site','Title at top of each page and for RSS feed');
|
||||||
INSERT INTO piwigo_config (param,value,comment) VALUES ('gallery_url','http://piwigo.org/demo','URL given in RSS feed');
|
INSERT INTO piwigo_config (param,value,comment) VALUES ('gallery_url','','Optional alternate homepage for the gallery');
|
||||||
INSERT INTO piwigo_config (param,value,comment) VALUES ('rate','true','Rating pictures feature is enabled');
|
INSERT INTO piwigo_config (param,value,comment) VALUES ('rate','true','Rating pictures feature is enabled');
|
||||||
INSERT INTO piwigo_config (param,value,comment) VALUES ('rate_anonymous','true','Rating pictures feature is also enabled for visitors');
|
INSERT INTO piwigo_config (param,value,comment) VALUES ('rate_anonymous','true','Rating pictures feature is also enabled for visitors');
|
||||||
INSERT INTO piwigo_config (param,value,comment) VALUES ('page_banner','<h1>Piwigo demonstration site</h1><p>My photos web site</p>','html displayed on the top each page of your gallery');
|
INSERT INTO piwigo_config (param,value,comment) VALUES ('page_banner','<h1>Piwigo demonstration site</h1><p>My photos web site</p>','html displayed on the top each page of your gallery');
|
||||||
|
|
|
@ -318,8 +318,8 @@ foreach ($queries as $query)
|
||||||
//
|
//
|
||||||
$params = array(
|
$params = array(
|
||||||
'gallery_url' => array(
|
'gallery_url' => array(
|
||||||
'http://piwigo.org/demo',
|
'',
|
||||||
'URL given in RSS feed'
|
'Optional alternate homepage for the gallery'
|
||||||
),
|
),
|
||||||
'rate' => array(
|
'rate' => array(
|
||||||
'true',
|
'true',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue