From f007a28bf6a40632e06f227a59f45d525136f9f4 Mon Sep 17 00:00:00 2001 From: z0rglub Date: Fri, 9 Jul 2004 21:00:00 +0000 Subject: replacement of short_period and long_period by recent_period git-svn-id: http://piwigo.org/svn/trunk@452 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/configuration.php | 22 +++++----------------- category.php | 5 ++--- include/category_recent_cats.inc.php | 4 ++-- include/functions_user.inc.php | 3 +-- include/htmlfunctions.inc.php | 14 +++----------- include/user.inc.php | 4 ++-- install/config.sql | 5 ++--- language/en_UK.iso-8859-1/admin.lang.php | 4 ++-- language/en_UK.iso-8859-1/common.lang.php | 6 ++---- profile.php | 28 ++++++++-------------------- template/default/admin/configuration.tpl | 10 +++------- template/default/profile.tpl | 22 +++++++++------------- 12 files changed, 41 insertions(+), 86 deletions(-) diff --git a/admin/configuration.php b/admin/configuration.php index 92243fb01..871784758 100644 --- a/admin/configuration.php +++ b/admin/configuration.php @@ -90,20 +90,11 @@ if ( isset( $_POST['submit'] ) ) array_push( $error, $lang['conf_err_mail'] ); } // periods must be integer values, they represents number of days - if ( !preg_match( $int_pattern, $_POST['short_period'] ) - or !preg_match( $int_pattern, $_POST['long_period'] ) ) + if (!preg_match($int_pattern, $_POST['recent_period']) + or $_POST['recent_period'] <= 0) { array_push( $error, $lang['err_periods'] ); } - else - { - // long period must be longer than short period - if ( $_POST['long_period'] <= $_POST['short_period'] - or $_POST['short_period'] <= 0 ) - { - array_push( $error, $lang['err_periods_2'] ); - } - } // session_id size must be an integer between 4 and 50 if ( !preg_match( $int_pattern, $_POST['session_id_size'] ) or $_POST['session_id_size'] < 4 @@ -216,8 +207,7 @@ $template->assign_vars(array( 'NB_IMAGE_LINE'=>$conf['nb_image_line'], 'NB_ROW_PAGE'=>$conf['nb_line_page'], 'STYLE_SELECT'=>style_select($conf['default_style'], 'default_style'), - 'SHORT_PERIOD'=>$conf['short_period'], - 'LONG_PERIOD'=>$conf['long_period'], + 'RECENT_PERIOD'=>$conf['recent_period'], 'UPLOAD_MAXSIZE'=>$conf['upload_maxfilesize'], 'UPLOAD_MAXWIDTH'=>$conf['upload_maxwidth'], 'UPLOAD_MAXHEIGHT'=>$conf['upload_maxheight'], @@ -271,10 +261,8 @@ $template->assign_vars(array( 'L_NB_ROW_PAGE_INFO'=>$lang['conf_default_nb_row_per_page_info'], 'L_STYLE_SELECT'=>$lang['customize_theme'], 'L_STYLE_SELECT_INFO'=>$lang['conf_default_theme_info'], - 'L_SHORT_PERIOD'=>$lang['customize_short_period'], - 'L_SHORT_PERIOD_INFO'=>$lang['conf_default_short_period_info'], - 'L_LONG_PERIOD'=>$lang['customize_long_period'], - 'L_LONG_PERIOD_INFO'=>$lang['conf_default_long_period_info'], + 'L_RECENT_PERIOD'=>$lang['customize_recent_period'], + 'L_RECENT_PERIOD_INFO'=>$lang['conf_default_recent_period_info'], 'L_EXPAND_TREE'=>$lang['customize_expand'], 'L_EXPAND_TREE_INFO'=>$lang['conf_default_expand_info'], 'L_NB_COMMENTS'=>$lang['customize_show_nb_comments'], diff --git a/category.php b/category.php index 906082437..ed5889951 100644 --- a/category.php +++ b/category.php @@ -160,7 +160,7 @@ if ( isset( $page['cat_nb_images'] ) and $page['cat_nb_images'] > 0 ) $template_title.= ' ['.$page['cat_nb_images'].']'; } -$icon_short = get_icon( date( 'Y-m-d' ) ); +$icon_recent = get_icon(date('Y-m-d')); $template->assign_vars(array( 'NB_PICTURE' => count_user_total_images(), @@ -201,8 +201,7 @@ $template->assign_vars(array( 'F_IDENTIFY' => add_session_id( PHPWG_ROOT_PATH.'identification.php' ), 'T_COLLAPSED' => $user['lien_collapsed'], - 'T_SHORT' => $icon_short, - 'T_LONG'=>get_icon(date( 'Y-m-d',time()-($user['short_period']*24*60*60+1))), + 'T_RECENT' => $icon_recent, 'U_HOME' => add_session_id( PHPWG_ROOT_PATH.'category.php' ), 'U_FAVORITE' => add_session_id( PHPWG_ROOT_PATH.'category.php?cat=fav' ), diff --git a/include/category_recent_cats.inc.php b/include/category_recent_cats.inc.php index 3bfc1f524..c91a738fa 100644 --- a/include/category_recent_cats.inc.php +++ b/include/category_recent_cats.inc.php @@ -38,7 +38,7 @@ $query = ' SELECT id AS category_id FROM '.CATEGORIES_TABLE.' WHERE date_last > SUBDATE(CURRENT_DATE - ,INTERVAL '.$user['short_period'].' DAY)'; + ,INTERVAL '.$user['recent_period'].' DAY)'; if ( $user['forbidden_categories'] != '' ) { $query.= ' @@ -70,7 +70,7 @@ SELECT id,file,tn_ext,storage_category_id FROM '.IMAGES_TABLE.', '.IMAGE_CATEGORY_TABLE.' WHERE category_id = '.$row['category_id'].' AND date_available > SUBDATE(CURRENT_DATE - ,INTERVAL '.$user['short_period'].' DAY) + ,INTERVAL '.$user['recent_period'].' DAY) AND id = image_id ORDER BY RAND() LIMIT 0,1 diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php index 983d7e82e..0e1f8a628 100644 --- a/include/functions_user.inc.php +++ b/include/functions_user.inc.php @@ -84,8 +84,7 @@ function register_user( $login, $password, $password_conf, // 1. retrieving default values, the ones of the user "guest" $infos = array( 'nb_image_line', 'nb_line_page', 'language', 'maxwidth', 'maxheight', 'expand', 'show_nb_comments', - 'short_period', 'long_period', 'template', - 'forbidden_categories' ); + 'recent_period', 'template', 'forbidden_categories' ); $query = 'SELECT '; for ( $i = 0; $i < sizeof( $infos ); $i++ ) { diff --git a/include/htmlfunctions.inc.php b/include/htmlfunctions.inc.php index 3c6046c99..a63b44f40 100644 --- a/include/htmlfunctions.inc.php +++ b/include/htmlfunctions.inc.php @@ -36,19 +36,11 @@ function get_icon( $date ) $day_in_seconds = 24*60*60; $output = ''; $title = $lang['recent_image'].' '; - if ( $diff < $user['long_period'] * $day_in_seconds ) + if ( $diff < $user['recent_period'] * $day_in_seconds ) { $icon_url = './template/'.$user['template'].'/theme/'; - if ( $diff < $user['short_period'] * $day_in_seconds ) - { - $icon_url.= 'new_short.gif'; - $title .= $user['short_period']; - } - else - { - $icon_url.= 'new_long.gif'; - $title .= $user['long_period']; - } + $icon_url.= 'recent.gif'; + $title .= $user['recent_period']; $title .= ' '.$lang['days']; $size = getimagesize( $icon_url ); $output = ''checked="checked"', - 'L_TITLE' => $lang['customize_title'], + 'L_TITLE' => $lang['customize_title'], 'L_PASSWORD' => $lang['password'], - 'L_NEW' => $lang['new'], - 'L_CONFIRM' => $lang['reg_confirm'], + 'L_NEW' => $lang['new'], + 'L_CONFIRM' => $lang['reg_confirm'], 'L_COOKIE' => $lang['create_cookie'], - 'L_CONFIRM'=>$lang['conf_confirmation'], 'L_LANG_SELECT'=>$lang['customize_language'], 'L_NB_IMAGE_LINE'=>$lang['customize_nb_image_per_row'], 'L_NB_ROW_PAGE'=>$lang['customize_nb_row_per_page'], 'L_STYLE_SELECT'=>$lang['customize_theme'], - 'L_SHORT_PERIOD'=>$lang['customize_short_period'], - 'L_LONG_PERIOD'=>$lang['customize_long_period'], + 'L_RECENT_PERIOD'=>$lang['customize_recent_period'], 'L_EXPAND_TREE'=>$lang['customize_expand'], 'L_NB_COMMENTS'=>$lang['customize_show_nb_comments'], 'L_YES'=>$lang['yes'], diff --git a/template/default/admin/configuration.tpl b/template/default/admin/configuration.tpl index 76d09519a..5c1bef87d 100644 --- a/template/default/admin/configuration.tpl +++ b/template/default/admin/configuration.tpl @@ -99,12 +99,8 @@ {STYLE_SELECT} - {L_SHORT_PERIOD} :
{L_SHORT_PERIOD_INFO} - - - - {L_LONG_PERIOD} :
{L_LONG_PERIOD_INFO} - + {L_RECENT_PERIOD} :
{L_RECENT_PERIOD_INFO} + {L_EXPAND_TREE} :
{L_EXPAND_TREE_INFO} @@ -203,4 +199,4 @@ - \ No newline at end of file + diff --git a/template/default/profile.tpl b/template/default/profile.tpl index e34ffd0ee..a3045f795 100644 --- a/template/default/profile.tpl +++ b/template/default/profile.tpl @@ -27,12 +27,8 @@ {LANG_SELECT} - {L_SHORT_PERIOD} - - - - {L_LONG_PERIOD} - + {L_RECENT_PERIOD} + {L_EXPAND_TREE} @@ -46,8 +42,8 @@ - {text.F_LABEL} - + {text.F_LABEL} + @@ -56,12 +52,12 @@   - {L_NEW} {L_PASSWORD} - + {L_NEW} {L_PASSWORD} + - {L_CONFIRM} - + {L_CONFIRM} +   @@ -72,4 +68,4 @@ - \ No newline at end of file + -- cgit v1.2.3