Changeset 6411


Ignore:
Timestamp:
May 28, 2010, 9:58:51 PM (15 years ago)
Author:
rvelices
Message:

merge r6368,6410 from branch-2.1 to trunk

  • merged the linkroot integration with the existing gallery_url (unique $confgallery_url used for RSS, mail homepage root in the browse path)
  • added an option $confdebug_mail - if set all outgoing mails are saved into local_data_dir
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/configuration.php

    r6365 r6411  
    115115    case 'main' :
    116116    {
    117       if ( !url_is_remote($_POST['gallery_url']) )
    118       {
    119         array_push($page['errors'], l10n('The gallery URL is not valid.'));
    120       }
    121117      foreach( $main_checkboxes as $checkbox)
    122118      {
  • trunk/admin/include/functions_notification_by_mail.inc.php

    r5559 r6411  
    9494
    9595/*
    96  * Execute all main queries to get list of user 
     96 * Execute all main queries to get list of user
    9797 *
    9898 * Type are the type of list 'subscribe', 'send'
     
    111111    if (count($quoted_check_key_list) != 0 )
    112112    {
    113       $query_and_check_key = ' and 
     113      $query_and_check_key = ' and
    114114    check_key in ('.implode(",", $quoted_check_key_list).') ';
    115115    }
     
    132132where
    133133  N.user_id =  U.'.$conf['user_fields']['id'];
    134  
     134
    135135    if ($action == 'send')
    136136    {
     
    419419            $section_action_by => true,
    420420            'GOTO_GALLERY_TITLE' => $conf['gallery_title'],
    421             'GOTO_GALLERY_URL' => $conf['gallery_url'],
     421            'GOTO_GALLERY_URL' => get_gallery_home_url(),
    422422          )
    423423        );
  • trunk/admin/notification_by_mail.php

    r6363 r6411  
    382382                (
    383383                  'GOTO_GALLERY_TITLE' => $conf['gallery_title'],
    384                   'GOTO_GALLERY_URL' => $conf['gallery_url'],
     384                  'GOTO_GALLERY_URL' => get_gallery_home_url(),
    385385                  'SEND_AS_NAME'      => $env_nbm['send_as_name'],
    386386                )
  • trunk/feed.php

    r6363 r6411  
    111111$rss->title.= ' (as '.stripslashes($user['username']).')';
    112112
    113 $rss->link = $conf['gallery_url'];
     113$rss->link = get_gallery_home_url();
    114114
    115115// +-----------------------------------------------------------------------+
     
    126126    $item = new FeedItem();
    127127    $item->title = sprintf(l10n('New on %s'), format_date($dbnow) );
    128     $item->link = $conf['gallery_url'];
     128    $item->link = get_gallery_home_url();
    129129
    130130    // content creation
  • trunk/include/config_default.inc.php

    r6365 r6411  
    329329// If set true, the login "user" will equal "User" or "USER" or "user",
    330330// etc. ... And it will be impossible to use such login variation to create a
    331 // new user account. 
     331// new user account.
    332332$conf['insensitive_case_logon'] = false;
    333333
     
    335335// 'filename'
    336336$conf['uniqueness_mode'] = 'md5sum';
    337 
    338 // home_page : relative url of the homepage. Empty by default.
    339 // It points to the index of the gallery.
    340 // This parameter is used if home page is not index.php of the gallery.
    341 // We suggest avoid the names "index.htm" or "index.html" if you set $conf['php_extension_in_urls'] to false.
    342 $conf['home_page'] = '';
    343337
    344338// +-----------------------------------------------------------------------+
     
    464458// activate template debugging - a new window will appear
    465459$conf['debug_template'] = false;
     460
     461// save copies of sent mails into local data dir
     462$conf['debug_mail'] = false;
    466463
    467464// die_on_sql_error: if an SQL query fails, should everything stop?
  • trunk/include/functions_mail.inc.php

    r6363 r6411  
    151151}
    152152
    153 /**
    154  * Returns an completed array template/theme
    155  * completed with get_default_theme()
    156  *
    157  * @params:
    158  *   - args: incompleted array of template/theme
    159  *       o template: template to use [default get_default_theme()]
    160  *       o theme: template to use [default get_default_theme()]
    161  */
    162 function get_array_template_theme($args = array())
    163 {
    164   global $conf;
    165 
    166   $res = array();
    167 
    168   if (empty($args['template']) or empty($args['theme']))
    169   {
    170     list($res['template'], $res['theme']) = explode('/', get_default_theme());
    171   }
    172 
    173   if (!empty($args['template']))
    174   {
    175     $res['template'] = $args['template'];
    176   }
    177 
    178   if (!empty($args['theme']))
    179   {
    180     $res['theme'] = $args['theme'];
    181   }
    182 
    183   return $res;
    184 }
    185153
    186154/**
     
    642610
    643611          // Footer
    644           'GALLERY_URL' =>
    645             isset($page['gallery_url']) ?
    646                   $page['gallery_url'] : $conf['gallery_url'],
     612          'GALLERY_URL' => get_gallery_home_url(),
    647613          'GALLERY_TITLE' =>
    648614            isset($page['gallery_title']) ?
     
    829795
    830796/*Testing block*/
    831 /*function pwg_send_mail_test($result, $to, $subject, $content, $headers, $args)
     797function pwg_send_mail_test($result, $to, $subject, $content, $headers, $args)
    832798{
    833799    global $conf, $user, $lang_info;
     
    835801    if ( mkgetdir( $dir,  MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR) )
    836802    {
    837       $filename = $dir.'/mail.'.stripslashes($user['username']).'.'.$lang_info['code'].'.'.$args['template'].'.'.$args['theme'];
     803      $filename = $dir.'/mail.'.stripslashes($user['username']).'.'.$lang_info['code'].'.'.$args['theme'].'-'.date('YmdHis');
    838804      if ($args['content_format'] == 'text/plain')
    839805      {
     
    853819    return $result;
    854820}
    855 add_event_handler('send_mail', 'pwg_send_mail_test', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 6);*/
     821if ($conf['debug_mail'])
     822  add_event_handler('send_mail', 'pwg_send_mail_test', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 6);
    856823
    857824
  • trunk/include/functions_url.inc.php

    r6363 r6411  
    5959  if ($with_scheme)
    6060  {
    61     if (isset($_SERVER['HTTPS']) && 
     61    if (isset($_SERVER['HTTPS']) &&
    6262        ((strtolower($_SERVER['HTTPS']) == 'on') or ($_SERVER['HTTPS'] == 1)))
    6363    {
     
    728728}
    729729
     730/**
     731 * Returns the 'home page' of this gallery
     732 */
     733function get_gallery_home_url()
     734{
     735  global $conf;
     736  if (!empty($conf['gallery_url']))
     737  {
     738    if (url_is_remote($conf['gallery_url']) or strncmp($conf['gallery_url'], '/', 1)==0)
     739    {
     740      return $conf['gallery_url'];
     741    }
     742    return get_root_url().$conf['gallery_url'];
     743  }
     744  else
     745  {
     746    return make_index_url();
     747  }
     748}
    730749?>
  • trunk/include/section_init.inc.php

    r6363 r6411  
    220220if ('categories' == $page['section'])
    221221{
    222   $page['title'] = '<a href="'.get_absolute_root_url().$conf['home_page'].'">'.l10n('Home').'</a>';
    223 
    224222  if (isset($page['category']))
    225223  {
     
    233231              'main_page_category_description'
    234232            ),
    235         'title'             =>
    236           $page['title'].$conf['level_separator'].get_cat_display_name($page['category']['upper_names'], '', false),
    237         )
    238       );
    239   }
     233        'title'             => get_cat_display_name($page['category']['upper_names'], '', false),
     234        )
     235      );
     236  }
     237  else
     238    $page['title'] = ''; // will be set later
    240239
    241240  if
     
    374373      $page,
    375374      array(
    376         'title' => l10n('Favorites')
    377             )
     375        'title' => l10n('Favorites')
     376      )
    378377    );
    379378
     
    559558}
    560559
     560// title update
     561if (isset($page['title']))
     562{
     563  if (!empty($page['title']))
     564        {
     565          $page['title'] = $conf['level_separator'].$page['title'];
     566        }
     567  $page['title'] = '<a href="'.get_gallery_home_url().'">'.l10n('Home').'</a>'.$page['title'];
     568}
     569
    561570// add meta robots noindex, nofollow to avoid unnecesary robot crawls
    562571$page['meta_robots']=array();
  • trunk/install/config.sql

    r5741 r6411  
    1111INSERT INTO piwigo_config (param,value,comment) VALUES ('gallery_locked','false','Lock your gallery temporary for non admin users');
    1212INSERT INTO piwigo_config (param,value,comment) VALUES ('gallery_title','Piwigo demonstration site','Title at top of each page and for RSS feed');
    13 INSERT INTO piwigo_config (param,value,comment) VALUES ('gallery_url','http://piwigo.org/demo','URL given in RSS feed');
     13INSERT INTO piwigo_config (param,value,comment) VALUES ('gallery_url','','Optional alternate homepage for the gallery');
    1414INSERT INTO piwigo_config (param,value,comment) VALUES ('rate','true','Rating pictures feature is enabled');
    1515INSERT INTO piwigo_config (param,value,comment) VALUES ('rate_anonymous','true','Rating pictures feature is also enabled for visitors');
  • trunk/install/upgrade_1.5.0.php

    r5215 r6411  
    319319$params = array(
    320320  'gallery_url' => array(
    321     'http://piwigo.org/demo',
    322     'URL given in RSS feed'
     321    '',
     322    'Optional alternate homepage for the gallery'
    323323    ),
    324324  'rate' => array(
Note: See TracChangeset for help on using the changeset viewer.