Changeset 1071 for trunk


Ignore:
Timestamp:
Mar 9, 2006, 2:57:13 AM (19 years ago)
Author:
rvelices
Message:

bug 255: parameter values in #config limited to 255 chars (value becomes text)

feature 303: page banner moved from combination of gallery_title,
gallery_description and template to database (simplifies user customization)

Location:
trunk
Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin.php

    r1058 r1071  
    5858//----------------------------------------------------- template initialization
    5959$title = l10n('PhpWebGallery Administration'); // for include/page_header.php
    60 $page['gallery_title'] = l10n('PhpWebGallery Administration');
     60$page['page_banner'] = '<h1>'.l10n('PhpWebGallery Administration').'</h1>';
    6161$page['body_id'] = 'theAdminPage';
    6262include(PHPWG_ROOT_PATH.'include/page_header.php');
  • trunk/admin/configuration.php

    r1048 r1071  
    5151  {
    5252    $conf[$row['param']] = $_POST[$row['param']];
    53   }
    54 }                                         
     53    if ( 'page_banner'==$row['param'] )
     54    { // should we do it for all ?
     55      $conf[$row['param']] = stripslashes( $conf[$row['param']] );
     56    }
     57  }
     58}
    5559//------------------------------ verification and registration of modifications
    5660if (isset($_POST['submit']))
     
    106110    }
    107111  }
    108  
     112
    109113  // updating configuration if no error found
    110114  if (count($page['errors']) == 0)
     
    117121      {
    118122        $value = $_POST[$row['param']];
    119      
    120         if ('gallery_title' == $row['param']
    121             or 'gallery_description' == $row['param'])
     123
     124        if ('gallery_title' == $row['param'])
    122125        {
    123126          if (!$conf['allow_html_descriptions'])
     
    126129          }
    127130        }
    128        
     131
    129132        $query = '
    130133UPDATE '.CONFIG_TABLE.'
     
    153156
    154157    'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=configuration',
    155    
     158
    156159    'F_ACTION'=>$action
    157160    ));
     
    162165  {
    163166    $html_check='checked="checked"';
    164    
     167
    165168    $history_yes = ($conf['log']=='true')?'checked="checked"':'';
    166169    $history_no  = ($conf['log']=='false')?'checked="checked"':'';
    167170    $lock_yes = ($conf['gallery_locked']=='true')?'checked="checked"':'';
    168171    $lock_no = ($conf['gallery_locked']=='false')?'checked="checked"':'';
    169    
     172
    170173    $template->assign_block_vars(
    171174      'general',
     
    179182             ? 'RATE_ANONYMOUS_YES' : 'RATE_ANONYMOUS_NO')=>$html_check,
    180183        'CONF_GALLERY_TITLE' => $conf['gallery_title'],
    181         'CONF_GALLERY_DESCRIPTION' => $conf['gallery_description'],
     184        'CONF_PAGE_BANNER' => $conf['page_banner'],
    182185        'CONF_GALLERY_URL' => $conf['gallery_url'],
    183186        ));
     
    190193    $validate_yes = ($conf['comments_validation']=='true')?'checked="checked"':'';
    191194    $validate_no = ($conf['comments_validation']=='false')?'checked="checked"':'';
    192      
     195
    193196    $template->assign_block_vars(
    194197      'comments',
     
    208211    $expand_yes = ($conf['auto_expand']=='true')?'checked="checked"':'';
    209212    $expand_no  = ($conf['auto_expand']=='false')?'checked="checked"':'';
    210      
     213
    211214    $template->assign_block_vars(
    212215      'default',
     
    223226        'SHOW_COMMENTS_NO'=>$show_no
    224227        ));
    225    
     228
    226229    $blockname = 'default.language_option';
    227    
     230
    228231    foreach (get_languages() as $language_code => $language_name)
    229232    {
     
    242245        $selected = '';
    243246      }
    244      
     247
    245248      $template->assign_block_vars(
    246249        $blockname,
     
    270273        $selected = '';
    271274      }
    272      
     275
    273276      $template->assign_block_vars(
    274277        $blockname,
     
    281284    }
    282285
    283  
     286
    284287    break;
    285288  }
  • trunk/include/page_header.php

    r1004 r1071  
    2525// | USA.                                                                  |
    2626// +-----------------------------------------------------------------------+
    27  
     27
    2828//
    2929// Start output of page
     
    3939      isset($page['gallery_title']) ?
    4040        $page['gallery_title'] : $conf['gallery_title'],
    41    
    42     'GALLERY_DESCRIPTION' =>
    43       isset($page['gallery_description']) ?
    44         $page['gallery_description'] : $conf['gallery_description'],
    45    
     41
     42    'PAGE_BANNER' =>
     43      isset($page['page_banner']) ?
     44        $page['page_banner'] : $conf['page_banner'],
     45
    4646    'BODY_ID' =>
    4747      isset($page['body_id']) ?
    4848        $page['body_id'] : '',
    49    
     49
    5050    'CONTENT_ENCODING' => $lang_info['charset'],
    5151    'PAGE_TITLE' => $title,
    5252    'LANG'=>$lang_info['code'],
    5353    'DIR'=>$lang_info['direction'],
    54    
     54
    5555    'T_STYLE' => $css
    5656    ));
  • trunk/install/config.sql

    r1044 r1071  
    1616INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('gallery_locked','false','Lock your gallery temporary for non admin users');
    1717INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('gallery_title','PhpWebGallery demonstration site','Title at top of each page and for RSS feed');
    18 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('gallery_description','My photos web site','Short description displayed with gallery title');
    1918INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('gallery_url','http://demo.phpwebgallery.net','URL given in RSS feed');
    2019INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('rate','true','Rating pictures feature is enabled');
    2120INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('rate_anonymous','true','Rating pictures feature is also enabled for visitors');
     21INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('page_banner','<div id=\"theHeader\"><h1>PhpWebGallery demonstration site</h1><p>My photos web site</p></div>','html displayed on the top each page of your gallery');
    2222
  • trunk/install/phpwebgallery_structure.sql

    r1070 r1071  
    7979CREATE TABLE `phpwebgallery_config` (
    8080  `param` varchar(40) NOT NULL default '',
    81   `value` varchar(255) default NULL,
     81  `value` text,
    8282  `comment` varchar(255) default NULL,
    8383  PRIMARY KEY  (`param`)
  • trunk/language/en_UK.iso-8859-1/admin.lang.php

    r1070 r1071  
    119119$lang['PhpWebGallery Administration'] = 'PhpWebGallery Administration';
    120120$lang['PhpWebGallery version'] = 'PhpWebGallery version';
     121$lang['Page banner'] = 'Page banner';
    121122$lang['Picture informations updated'] = 'Picture informations updated';
    122123$lang['Position'] = 'Position';
  • trunk/language/en_UK.iso-8859-1/help/configuration.html

    r1044 r1071  
    1414<ul>
    1515
    16   <li><strong>Gallery title</strong>: displayed on top of each public
    17   page.</li>
     16  <li><strong>Gallery title</strong>: used in RSS feed and notifications by
     17email.</li>
    1818
    19   <li><strong>Gallery description</strong>: displayed under gallery
    20   title.</li>
     19  <li><strong>Page banner</strong>: displayed on top of each public
     20page.</li>
    2121
    2222  <li><strong>Gallery URL</strong>: used for the RSS feed.</li>
     
    3434  <li><strong>Rating</strong>: Picture rating feature is enabled.</li>
    3535
    36   <li><strong>Rating by guests</strong>: Even non registered users can 
     36  <li><strong>Rating by guests</strong>: Even non registered users can
    3737rate images.</li>
    3838
  • trunk/language/fr_FR.iso-8859-1/admin.lang.php

    r1070 r1071  
    112112$lang['Order by'] = 'Trier selon';
    113113$lang['Other private categories'] = 'Autres catégories privées';
     114$lang['Page banner'] = 'Bannière des pages';
    114115$lang['Parent category'] = 'Catégorie parente';
    115116$lang['Path'] = 'Chemin';
  • trunk/language/fr_FR.iso-8859-1/help/configuration.html

    r1044 r1071  
    1414<ul>
    1515
    16   <li><strong>Titre de la galerie</strong>: affiché en haut de chaque page
    17 de la partie publique.</li>
     16  <li><strong>Titre de la galerie</strong>: utilisé pour le flux RSS et
     17la notification par email.</li>
    1818
    19   <li><strong>Description de la galerie</strong>: affiché en dessous du
    20 titre de la galerie.</li>
     19  <li><strong>Bannière des pages</strong>: code html affiché en haut des
     20pages.</li>
    2121
    2222  <li><strong>URL de la galerie</strong>: utilisé pour le flux RSS.</li>
     
    3434  <li><strong>Notation</strong>: La notation des photos est possible.</li>
    3535
    36   <li><strong>Notation par les visiteurs</strong>: Même les utilisateurs 
     36  <li><strong>Notation par les visiteurs</strong>: Même les utilisateurs
    3737non enregistrés peuvent noter les images.</li>
    3838
  • trunk/popuphelp.php

    r879 r1071  
    3434
    3535$page['body_id'] = 'thePopuphelpPage';
    36 $page['gallery_title'] = $title = l10n('PhpWebGallery Help');
     36$title = l10n('PhpWebGallery Help');
     37$page['page_banner'] = '<h1>'.$title.'</h1>';
    3738include(PHPWG_ROOT_PATH.'include/page_header.php');
    3839
  • trunk/search_rules.php

    • Property svn:eol-style set to native
    r1015 r1071  
    4646
    4747$page['body_id'] = 'thePopuphelpPage';
    48 $page['gallery_title'] = $title = l10n('PhpWebGallery Help');
     48$title = l10n('PhpWebGallery Help');
     49$page['page_banner'] = '<h1>'.$title.'</h1>';
    4950include(PHPWG_ROOT_PATH.'include/page_header.php');
    5051
     
    195196        'CONTENT' => sprintf(
    196197          l10n($lang_items['period']),
    197          
     198
    198199          format_date($search['fields'][ $keys['after'] ]['date']),
    199200          inc_exc_str($search['fields'][ $keys['after'] ]['inc']),
     
    212213        'CONTENT' => sprintf(
    213214          l10n($lang_items['before']),
    214          
     215
    215216          format_date($search['fields'][ $keys['before'] ]['date']),
    216217          inc_exc_str($search['fields'][ $keys['before'] ]['inc'])
     
    226227        'CONTENT' => sprintf(
    227228          l10n($lang_items['after']),
    228          
     229
    229230          format_date($search['fields'][ $keys['after'] ]['date']),
    230231          inc_exc_str($search['fields'][ $keys['after'] ]['inc'])
  • trunk/template/yoga/admin/configuration.tpl

    r1044 r1071  
    2020
    2121    <li>
    22       <label for="gallery_description"><strong>{lang:Gallery description}</strong></label>
    23       <textarea cols="50" rows="5" name="gallery_description" id="gallery_description">{general.CONF_GALLERY_DESCRIPTION}</textarea>
     22      <label for="page_banner"><strong>{lang:Page banner}</strong></label>
     23      <textarea cols="50" rows="5" name="page_banner" id="page_banner">{general.CONF_PAGE_BANNER}</textarea>
    2424    </li>
    2525
    2626    <li>
    27       <label for="gallery_title"><strong>{lang:Gallery URL}</strong></label>
     27      <label for="gallery_url"><strong>{lang:Gallery URL}</strong></label>
    2828      <input type="text" maxlength="255" size="50" name="gallery_url" id="gallery_url" value="{general.CONF_GALLERY_URL}" />
    2929    </li>
     
    4141    </li>
    4242  </ul>
    43  
     43
    4444  <ul>
    4545    <li>
     
    140140<!-- END default -->
    141141  </fieldset>
    142  
     142
    143143  <p>
    144144    <input type="submit" name="submit" value="{lang:Submit}">
  • trunk/template/yoga/header.tpl

    r1020 r1071  
    2828<div id="the_page">
    2929
    30 <div id="theHeader">
    31   <h1>{GALLERY_TITLE}</h1>
    32   <p>{GALLERY_DESCRIPTION}</p>
    33 </div>
     30{PAGE_BANNER}
Note: See TracChangeset for help on using the changeset viewer.