Ignore:
Timestamp:
Feb 6, 2007, 11:55:12 PM (17 years ago)
Author:
rub
Message:

Issue 0000598: NBM: Add new informations

Notification by mail:
Add new informations about last categories and last images like new feature of RSS notification.

2 parts:

  • Possibility to send HTML mail
  • Include last categories and last images on HTML format into notification mail

ccs & HTML experts! Please! Check, fix, improve and enhance HTML mail content!

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        22gal2
        33feed.xml
         4testmail
  • trunk/include/functions_notification.inc.php

    r1677 r1784  
    408408  {
    409409    add_news_line( $news,
    410       nb_new_elements($start, $end), '%d new element', '%d new elements');
     410      nb_new_elements($start, $end), '%d new element', '%d new elements',
     411      get_root_url().'index.php?/recent_pics', $add_url );
    411412  }
    412413
     
    414415  {
    415416    add_news_line( $news,
    416       nb_updated_categories($start, $end), '%d category updated', '%d categories updated');
     417      nb_updated_categories($start, $end), '%d category updated', '%d categories updated',
     418      get_root_url().'/index.php?/recent_cats', $add_url );
    417419  }
    418420
     
    510512  return $dates;
    511513}
     514
     515/**
     516 * returns html description about recently published elements grouped by post date
     517 * @param $date_detail: selected date computed by get_recent_post_dates function
     518 */
     519function get_html_description_recent_post_date($date_detail)
     520{
     521  global $conf;
     522
     523  $description = '';
     524 
     525  $description .=
     526        '<li>'
     527        .l10n_dec('%d new element', '%d new elements', $date_detail['nb_elements'])
     528        .' ('
     529        .'<a href="'.make_index_url(array('section'=>'recent_pics')).'">'
     530          .l10n('recent_pics_cat').'</a>'
     531        .')'
     532        .'</li><br/>';
     533
     534  foreach($date_detail['elements'] as $element)
     535  {
     536    $tn_src = get_thumbnail_url($element);
     537    $description .= '<img src="'.$tn_src.'"/>';
     538  }
     539  $description .= '...<br/>';
     540
     541  $description .=
     542        '<li>'
     543        .l10n_dec('%d category updated', '%d categories updated',
     544                  $date_detail['nb_cats'])
     545        .'</li>';
     546
     547  $description .= '<ul>';
     548  foreach($date_detail['categories'] as $cat)
     549  {
     550    $description .=
     551          '<li>'
     552          .get_cat_display_name_cache($cat['uppercats'])
     553          .' ('.
     554          l10n_dec('%d new element',
     555                   '%d new elements', $cat['img_count']).')'
     556          .'</li>';
     557  }
     558  $description .= '</ul>';
     559
     560  return $description;
     561}
     562
     563/**
     564 * explodes a MySQL datetime format (2005-07-14 23:01:37) in fields "year",
     565 * "month", "day", "hour", "minute", "second".
     566 *
     567 * @param string mysql datetime format
     568 * @return array
     569 */
     570function explode_mysqldt($mysqldt)
     571{
     572  $date = array();
     573  list($date['year'],
     574       $date['month'],
     575       $date['day'],
     576       $date['hour'],
     577       $date['minute'],
     578       $date['second'])
     579    = preg_split('/[-: ]/', $mysqldt);
     580
     581  return $date;
     582}
     583
     584/**
     585 * returns title about recently published elements grouped by post date
     586 * @param $date_detail: selected date computed by get_recent_post_dates function
     587 */
     588function get_title_recent_post_date($date_detail)
     589{
     590  global $lang;
     591
     592  $date = $date_detail['date_available'];
     593  $exploded_date = explode_mysqldt($date);
     594
     595  $title = l10n_dec('%d new element', '%d new elements', $date_detail['nb_elements']);
     596  $title .= ' ('.$lang['month'][(int)$exploded_date['month']].' '.$exploded_date['day'].')';
     597
     598  return $title;
     599}
     600
    512601?>
Note: See TracChangeset for help on using the changeset viewer.