From b6fc0fa5eb94301d5611b5385371aeda821da0fe Mon Sep 17 00:00:00 2001 From: rvelices Date: Thu, 8 Feb 2007 01:31:05 +0000 Subject: - correct php warnings (section_init and mass_inserts) - flat category view url is now 'flat' instead of 'flat_cat' (it is nicer and shorter) - small html validation (double class attribute) - removed unnecessary class="" - changed 2 times hard coded index.php?recent_pics with make_index_url(...) git-svn-id: http://piwigo.org/svn/trunk@1789 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_notification.inc.php | 222 ++++++++++++++++----------------- 1 file changed, 111 insertions(+), 111 deletions(-) (limited to 'include/functions_notification.inc.php') diff --git a/include/functions_notification.inc.php b/include/functions_notification.inc.php index 78c561475..a69bd4211 100644 --- a/include/functions_notification.inc.php +++ b/include/functions_notification.inc.php @@ -2,13 +2,13 @@ // +-----------------------------------------------------------------------+ // | PhpWebGallery - a PHP based picture gallery | // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | -// | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net | +// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | // +-----------------------------------------------------------------------+ // | branch : BSF (Best So Far) -// | file : $RCSfile$ -// | last update : $Date: 2005-11-26 21:15:50 +0100 (sam., 26 nov. 2005) $ -// | last modifier : $Author: plg $ -// | revision : $Revision: 958 $ +// | file : $Id$ +// | last update : $Date$ +// | last modifier : $Author$ +// | revision : $Revision$ // +-----------------------------------------------------------------------+ // | This program is free software; you can redistribute it and/or modify | // | it under the terms of the GNU General Public License as published by | @@ -28,18 +28,18 @@ // +-----------------------------------------------------------------------+ // | functions | // +-----------------------------------------------------------------------+ - -/* - * get standard sql where in order to - * restict an filter caregories and images - * - * IMAGE_CATEGORY_TABLE muste named ic in the query - * - * @param none - * - * @return string sql where - */ -function get_std_sql_where_restrict_filter($prefix_condition, $force_one_condition = false) + +/* + * get standard sql where in order to + * restict an filter caregories and images + * + * IMAGE_CATEGORY_TABLE muste named ic in the query + * + * @param none + * + * @return string sql where + */ +function get_std_sql_where_restrict_filter($prefix_condition, $force_one_condition = false) { return get_sql_condition_FandF ( @@ -52,7 +52,7 @@ function get_std_sql_where_restrict_filter($prefix_condition, $force_one_conditi $prefix_condition, $force_one_condition ); -} +} /* * Execute custom notification query @@ -68,7 +68,7 @@ function get_std_sql_where_restrict_filter($prefix_condition, $force_one_conditi function custom_notification_query($action, $type, $start, $end) { global $user; - + switch($type) { case 'new_comments': @@ -407,15 +407,15 @@ function news($start, $end, $exclude_img_cats=false, $add_url=false) if (!$exclude_img_cats) { add_news_line( $news, - nb_new_elements($start, $end), '%d new element', '%d new elements', - get_root_url().'index.php?/recent_pics', $add_url ); + nb_new_elements($start, $end), '%d new element', '%d new elements', + make_index_url(array('section'=>'recent_pics')), $add_url ); } if (!$exclude_img_cats) { add_news_line( $news, - nb_updated_categories($start, $end), '%d category updated', '%d categories updated', - get_root_url().'/index.php?/recent_cats', $add_url ); + nb_updated_categories($start, $end), '%d category updated', '%d categories updated', + make_index_url(array('section'=>'recent_cats')), $add_url ); } add_news_line( $news, @@ -448,7 +448,7 @@ function news($start, $end, $exclude_img_cats=false, $add_url=false) */ function get_recent_post_dates($max_dates, $max_elements, $max_cats) { - global $conf, $user; + global $conf, $user; $where_sql = get_std_sql_where_restrict_filter('WHERE', true); @@ -510,92 +510,92 @@ SELECT DISTINCT c.uppercats, COUNT(DISTINCT i.id) img_count } } return $dates; -} - -/** - * returns html description about recently published elements grouped by post date - * @param $date_detail: selected date computed by get_recent_post_dates function - */ -function get_html_description_recent_post_date($date_detail) -{ - global $conf; - - $description = ''; - - $description .= - '
  • ' - .l10n_dec('%d new element', '%d new elements', $date_detail['nb_elements']) - .' (' - .'' - .l10n('recent_pics_cat').'' - .')' - .'

  • '; - - foreach($date_detail['elements'] as $element) - { - $tn_src = get_thumbnail_url($element); - $description .= ''; - } - $description .= '...
    '; - - $description .= - '
  • ' - .l10n_dec('%d category updated', '%d categories updated', - $date_detail['nb_cats']) - .'
  • '; - - $description .= ''; - - return $description; -} - -/** - * explodes a MySQL datetime format (2005-07-14 23:01:37) in fields "year", - * "month", "day", "hour", "minute", "second". - * - * @param string mysql datetime format - * @return array - */ -function explode_mysqldt($mysqldt) -{ - $date = array(); - list($date['year'], - $date['month'], - $date['day'], - $date['hour'], - $date['minute'], - $date['second']) - = preg_split('/[-: ]/', $mysqldt); - - return $date; -} - -/** - * returns title about recently published elements grouped by post date - * @param $date_detail: selected date computed by get_recent_post_dates function - */ -function get_title_recent_post_date($date_detail) -{ - global $lang; - - $date = $date_detail['date_available']; - $exploded_date = explode_mysqldt($date); - - $title = l10n_dec('%d new element', '%d new elements', $date_detail['nb_elements']); - $title .= ' ('.$lang['month'][(int)$exploded_date['month']].' '.$exploded_date['day'].')'; - - return $title; -} +} + +/** + * returns html description about recently published elements grouped by post date + * @param $date_detail: selected date computed by get_recent_post_dates function + */ +function get_html_description_recent_post_date($date_detail) +{ + global $conf; + + $description = ''; + + $description .= + '
  • ' + .l10n_dec('%d new element', '%d new elements', $date_detail['nb_elements']) + .' (' + .'' + .l10n('recent_pics_cat').'' + .')' + .'

  • '; + + foreach($date_detail['elements'] as $element) + { + $tn_src = get_thumbnail_url($element); + $description .= ''; + } + $description .= '...
    '; + + $description .= + '
  • ' + .l10n_dec('%d category updated', '%d categories updated', + $date_detail['nb_cats']) + .'
  • '; + + $description .= ''; + + return $description; +} + +/** + * explodes a MySQL datetime format (2005-07-14 23:01:37) in fields "year", + * "month", "day", "hour", "minute", "second". + * + * @param string mysql datetime format + * @return array + */ +function explode_mysqldt($mysqldt) +{ + $date = array(); + list($date['year'], + $date['month'], + $date['day'], + $date['hour'], + $date['minute'], + $date['second']) + = preg_split('/[-: ]/', $mysqldt); + + return $date; +} + +/** + * returns title about recently published elements grouped by post date + * @param $date_detail: selected date computed by get_recent_post_dates function + */ +function get_title_recent_post_date($date_detail) +{ + global $lang; + + $date = $date_detail['date_available']; + $exploded_date = explode_mysqldt($date); + + $title = l10n_dec('%d new element', '%d new elements', $date_detail['nb_elements']); + $title .= ' ('.$lang['month'][(int)$exploded_date['month']].' '.$exploded_date['day'].')'; + + return $title; +} ?> \ No newline at end of file -- cgit v1.2.3