Changeset 452 for trunk


Ignore:
Timestamp:
Jul 9, 2004, 11:00:00 PM (20 years ago)
Author:
z0rglub
Message:

replacement of short_period and long_period by recent_period

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/configuration.php

    r394 r452  
    9191  }
    9292  // periods must be integer values, they represents number of days
    93   if ( !preg_match( $int_pattern, $_POST['short_period'] )
    94        or !preg_match( $int_pattern, $_POST['long_period'] ) )
     93  if (!preg_match($int_pattern, $_POST['recent_period'])
     94      or $_POST['recent_period'] <= 0)
    9595  {
    9696    array_push( $error, $lang['err_periods'] );
    97   }
    98   else
    99   {
    100     // long period must be longer than short period
    101     if ( $_POST['long_period'] <= $_POST['short_period']
    102          or $_POST['short_period'] <= 0 )
    103     {
    104       array_push( $error, $lang['err_periods_2'] );
    105     }
    10697  }
    10798  // session_id size must be an integer between 4 and 50
     
    217208  'NB_ROW_PAGE'=>$conf['nb_line_page'],
    218209  'STYLE_SELECT'=>style_select($conf['default_style'], 'default_style'),
    219   'SHORT_PERIOD'=>$conf['short_period'],
    220   'LONG_PERIOD'=>$conf['long_period'],
     210  'RECENT_PERIOD'=>$conf['recent_period'],
    221211  'UPLOAD_MAXSIZE'=>$conf['upload_maxfilesize'],
    222212  'UPLOAD_MAXWIDTH'=>$conf['upload_maxwidth'],
     
    272262  'L_STYLE_SELECT'=>$lang['customize_theme'],
    273263  'L_STYLE_SELECT_INFO'=>$lang['conf_default_theme_info'],
    274   'L_SHORT_PERIOD'=>$lang['customize_short_period'],
    275   'L_SHORT_PERIOD_INFO'=>$lang['conf_default_short_period_info'],
    276   'L_LONG_PERIOD'=>$lang['customize_long_period'],
    277   'L_LONG_PERIOD_INFO'=>$lang['conf_default_long_period_info'],
     264  'L_RECENT_PERIOD'=>$lang['customize_recent_period'],
     265  'L_RECENT_PERIOD_INFO'=>$lang['conf_default_recent_period_info'],
    278266  'L_EXPAND_TREE'=>$lang['customize_expand'],
    279267  'L_EXPAND_TREE_INFO'=>$lang['conf_default_expand_info'],
  • trunk/category.php

    r441 r452  
    161161}
    162162
    163 $icon_short = get_icon( date( 'Y-m-d' ) );
     163$icon_recent = get_icon(date('Y-m-d'));
    164164
    165165$template->assign_vars(array(
     
    202202 
    203203  'T_COLLAPSED' => $user['lien_collapsed'],
    204   'T_SHORT' => $icon_short,
    205   'T_LONG'=>get_icon(date( 'Y-m-d',time()-($user['short_period']*24*60*60+1))),
     204  'T_RECENT' => $icon_recent,
    206205
    207206  'U_HOME' => add_session_id( PHPWG_ROOT_PATH.'category.php' ),
  • trunk/include/category_recent_cats.inc.php

    r440 r452  
    3939  FROM '.CATEGORIES_TABLE.'
    4040  WHERE date_last > SUBDATE(CURRENT_DATE
    41                             ,INTERVAL '.$user['short_period'].' DAY)';
     41                            ,INTERVAL '.$user['recent_period'].' DAY)';
    4242if ( $user['forbidden_categories'] != '' )
    4343{
     
    7171  WHERE category_id = '.$row['category_id'].'
    7272    AND date_available > SUBDATE(CURRENT_DATE
    73                                  ,INTERVAL '.$user['short_period'].' DAY)
     73                                 ,INTERVAL '.$user['recent_period'].' DAY)
    7474    AND id = image_id
    7575  ORDER BY RAND()
  • trunk/include/functions_user.inc.php

    r423 r452  
    8585    $infos = array( 'nb_image_line', 'nb_line_page', 'language',
    8686                    'maxwidth', 'maxheight', 'expand', 'show_nb_comments',
    87                     'short_period', 'long_period', 'template',
    88                     'forbidden_categories' );
     87                    'recent_period', 'template', 'forbidden_categories' );
    8988    $query = 'SELECT ';
    9089    for ( $i = 0; $i < sizeof( $infos ); $i++ )
  • trunk/include/htmlfunctions.inc.php

    r438 r452  
    3737  $output = '';
    3838  $title = $lang['recent_image'].'&nbsp;';
    39   if ( $diff < $user['long_period'] * $day_in_seconds )
     39  if ( $diff < $user['recent_period'] * $day_in_seconds )
    4040  {
    4141    $icon_url = './template/'.$user['template'].'/theme/';
    42     if ( $diff < $user['short_period'] * $day_in_seconds )
    43     {
    44       $icon_url.= 'new_short.gif';
    45       $title .= $user['short_period'];
    46     }
    47     else
    48     {
    49       $icon_url.= 'new_long.gif';
    50       $title .= $user['long_period'];
    51     }
     42    $icon_url.= 'recent.gif';
     43    $title .= $user['recent_period'];
    5244    $title .=  '&nbsp;'.$lang['days'];
    5345    $size = getimagesize( $icon_url );
  • trunk/include/user.inc.php

    r405 r452  
    3333$infos = array( 'id', 'username', 'mail_address', 'nb_image_line',
    3434                'nb_line_page', 'status', 'language', 'maxwidth',
    35                 'maxheight', 'expand', 'show_nb_comments', 'short_period',
    36                 'long_period', 'template', 'forbidden_categories' );
     35                'maxheight', 'expand', 'show_nb_comments', 'recent_period',
     36                'template', 'forbidden_categories' );
    3737
    3838$query_user = 'SELECT '.implode( ',', $infos );
  • trunk/install/config.sql

    r399 r452  
    2525INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nb_image_line','5','Number of images displayed per row');
    2626INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nb_line_page','3','Number of rows displayed per page');
    27 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('short_period','7','Period within which pictures are displayed as new (in days)');
    28 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('long_period','14','Long period within which pictures are displayed as new (in days)');
     27INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('recent_period','7','Period within which pictures are displayed as new (in days)');
    2928INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('auto_expand','false','Auto expand of the category tree');
    3029INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('show_nb_comments','true','Show the number of comments under the thumbnails');
  • trunk/language/en_UK.iso-8859-1/admin.lang.php

    r403 r452  
    113113$lang['conf_upload_title'] = 'Configuration of the users upload';
    114114$lang['conf_upload_available'] = 'authorized the upload of pictures';
     115$lang['conf_upload_available_info'] = '';
    115116$lang['conf_upload_maxfilesize'] = 'maximum filesize';
    116117$lang['conf_upload_maxfilesize_info'] = 'Maximum filesize for the uploaded pictures. Must be a number between 10 and 1000 KB.';
     
    147148$lang['conf_default_nb_image_per_row_info'] = 'number of pictures for each row by default';
    148149$lang['conf_default_nb_row_per_page_info'] = 'number of rows by page by default';
    149 $lang['conf_default_short_period_info'] = 'By days. Period within a picture is shown with a red mark. The short period must be superior to 1 day.';
    150 $lang['conf_default_long_period_info'] = 'By days. Period within a picture is shown with a green mark. The long period must be superior to the short period.';
     150$lang['conf_default_recent_period_info'] = 'By days. Period within a picture is shown as new. The short period must be superior to 1 day.';
    151151$lang['conf_default_expand_info'] = 'expand all categories by default in the menu ?';
    152152$lang['conf_default_show_nb_comments_info'] = 'show the number of comments for each picture on the thumbnails page';
  • trunk/language/en_UK.iso-8859-1/common.lang.php

    r439 r452  
    220220$lang['customize_expand'] = 'expand all categories';
    221221$lang['customize_show_nb_comments'] = 'show number of comments';
    222 $lang['customize_short_period'] = 'short period';
    223 $lang['customize_long_period'] = 'long period';
     222$lang['customize_recent_period'] = 'recent period';
    224223$lang['customize_template'] = 'template';
    225 $lang['err_periods'] = 'periods must be integer values';
    226 $lang['err_periods_2'] = 'periods must be superior to 0. The long period must be grater than the short period.';
     224$lang['err_periods'] = 'recent period must be a positive integer value';
    227225$lang['create_cookie'] = 'create a cookie';
    228226$lang['customize_day'] = 'day';
  • trunk/profile.php

    r405 r452  
    4141$infos = array( 'nb_image_line', 'nb_line_page', 'language',
    4242                'maxwidth', 'maxheight', 'expand', 'show_nb_comments',
    43                 'short_period', 'long_period', 'template', 'mail_address' );
     43                'recent_period', 'template', 'mail_address' );
    4444// mise à jour dans la base de données des valeurs
    4545// des paramètres pour l'utilisateur courant
     
    6363  }
    6464  // periods must be integer values, they represents number of days
    65   if ( !preg_match( $int_pattern, $_POST['short_period'] )
    66        or !preg_match( $int_pattern, $_POST['long_period'] ) )
     65  if (!preg_match($int_pattern, $_POST['recent_period'])
     66      or $_POST['recent_period'] <= 0)
    6767  {
    6868    array_push( $errors, $lang['err_periods'] );
    69   }
    70   else
    71   {
    72     // long period must be longer than short period
    73     if ( $_POST['long_period'] <= $_POST['short_period']
    74          or $_POST['short_period'] <= 0 )
    75     {
    76       array_push( $errors, $lang['err_periods_2'] );
    77     }
    7869  }
    7970  $mail_error = validate_mail_address( $_POST['mail_address'] );
     
    138129  'NB_ROW_PAGE'=>$user['nb_line_page'],
    139130  'STYLE_SELECT'=>style_select($user['template'], 'template'),
    140   'SHORT_PERIOD'=>$user['short_period'],
    141   'LONG_PERIOD'=>$user['long_period'],
     131  'RECENT_PERIOD'=>$user['recent_period'],
    142132 
    143133  $expand=>'checked="checked"',
    144134  $nb_comments=>'checked="checked"',
    145135 
    146    'L_TITLE' => $lang['customize_title'],
     136  'L_TITLE' => $lang['customize_title'],
    147137  'L_PASSWORD' => $lang['password'],
    148   'L_NEW' =>  $lang['new'], 
    149   'L_CONFIRM' =>  $lang['reg_confirm'], 
     138  'L_NEW' =>  $lang['new'],
     139  'L_CONFIRM' =>  $lang['reg_confirm'],
    150140  'L_COOKIE' =>  $lang['create_cookie'],
    151   'L_CONFIRM'=>$lang['conf_confirmation'],
    152141  'L_LANG_SELECT'=>$lang['customize_language'],
    153142  'L_NB_IMAGE_LINE'=>$lang['customize_nb_image_per_row'],
    154143  'L_NB_ROW_PAGE'=>$lang['customize_nb_row_per_page'],
    155144  'L_STYLE_SELECT'=>$lang['customize_theme'],
    156   'L_SHORT_PERIOD'=>$lang['customize_short_period'],
    157   'L_LONG_PERIOD'=>$lang['customize_long_period'],
     145  'L_RECENT_PERIOD'=>$lang['customize_recent_period'],
    158146  'L_EXPAND_TREE'=>$lang['customize_expand'],
    159147  'L_NB_COMMENTS'=>$lang['customize_show_nb_comments'],
  • trunk/template/default/admin/configuration.tpl

    r394 r452  
    100100  </tr>
    101101  <tr>
    102     <td><strong>{L_SHORT_PERIOD}&nbsp;:</strong><br /><span class="small">{L_SHORT_PERIOD_INFO}</span></td>
    103         <td class="row1"><input type="text" size="3" maxlength="2" name="short_period" value="{SHORT_PERIOD}" /></td>
    104   </tr>
    105   <tr>
    106     <td><strong>{L_LONG_PERIOD}&nbsp;:</strong><br /><span class="small">{L_LONG_PERIOD_INFO}</span></td>
    107         <td class="row1"><input type="text" size="3" maxlength="2" name="long_period" value="{LONG_PERIOD}" /></td>
     102    <td><strong>{L_RECENT_PERIOD}&nbsp;:</strong><br /><span class="small">{L_RECENT_PERIOD_INFO}</span></td>
     103        <td class="row1"><input type="text" size="3" maxlength="2" name="recent_period" value="{RECENT_PERIOD}" /></td>
    108104  </tr>
    109105  <tr>
  • trunk/template/default/profile.tpl

    r393 r452  
    2828  </tr>
    2929   <tr>
    30     <td>{L_SHORT_PERIOD}</td>
    31         <td><input type="text" size="3" maxlength="2" name="short_period" value="{SHORT_PERIOD}" /></td>
    32   </tr>
    33   <tr>
    34     <td>{L_LONG_PERIOD}</td>
    35         <td><input type="text" size="3" maxlength="2" name="long_period" value="{LONG_PERIOD}" /></td>
     30    <td>{L_RECENT_PERIOD}</td>
     31        <td><input type="text" size="3" maxlength="2" name="recent_period" value="{RECENT_PERIOD}" /></td>
    3632  </tr>
    3733  <tr>
     
    4743  <!-- BEGIN text -->
    4844  <tr>
    49         <td class="menu">{text.F_LABEL}</td>
    50         <td class="menu">
     45        <td>{text.F_LABEL}</td>
     46        <td>
    5147          <input type="text" name="{text.F_NAME}" value="{text.F_VALUE}" />
    5248        </td>
     
    5753  </tr>
    5854  <tr>
    59         <td class="menu">{L_NEW} {L_PASSWORD} <input type="checkbox" name="use_new_pwd" value="1" /></td>
    60         <td class="menu"><input type="password" name="password" value="" /></td>
     55        <td>{L_NEW} {L_PASSWORD} <input type="checkbox" name="use_new_pwd" value="1" /></td>
     56        <td><input type="password" name="password" value="" /></td>
    6157  </tr>
    6258  <tr>
    63         <td class="menu">{L_CONFIRM}</td>
    64         <td class="menu"><input type="password" name="passwordConf" value="" /></td>
     59        <td>{L_CONFIRM}</td>
     60        <td><input type="password" name="passwordConf" value="" /></td>
    6561  </tr>
    6662  <tr>
Note: See TracChangeset for help on using the changeset viewer.