Changeset 1784 for trunk/feed.php


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/feed.php

    r1750 r1784  
    3333// |                               functions                               |
    3434// +-----------------------------------------------------------------------+
    35 
    36 /**
    37  * explodes a MySQL datetime format (2005-07-14 23:01:37) in fields "year",
    38  * "month", "day", "hour", "minute", "second".
    39  *
    40  * @param string mysql datetime format
    41  * @return array
    42  */
    43 function explode_mysqldt($mysqldt)
    44 {
    45   $date = array();
    46   list($date['year'],
    47        $date['month'],
    48        $date['day'],
    49        $date['hour'],
    50        $date['minute'],
    51        $date['second'])
    52     = preg_split('/[-: ]/', $mysqldt);
    53 
    54   return $date;
    55 }
    5635
    5736/**
     
    186165}
    187166
    188 $dates = get_recent_post_dates( 5, 6, 6);
     167$dates = get_recent_post_dates(5, 6, 6);
    189168
    190 foreach($dates as  $date_detail)
     169foreach($dates as $date_detail)
    191170{ // for each recent post date we create a feed item
     171  $item = new FeedItem();
    192172  $date = $date_detail['date_available'];
    193   $exploded_date = explode_mysqldt($date);
    194   $item = new FeedItem();
    195   $item->title = l10n_dec('%d new element', '%d new elements', $date_detail['nb_elements']);
    196   $item->title .= ' ('.$lang['month'][(int)$exploded_date['month']].' '.$exploded_date['day'].')';
     173  $item->title = get_title_recent_post_date($date_detail);
    197174  $item->link = make_index_url(
    198175        array(
     
    207184    '<a href="'.make_index_url().'">'.$conf['gallery_title'].'</a><br/> ';
    208185
    209   $item->description .=
    210         '<li>'
    211         .l10n_dec('%d new element', '%d new elements', $date_detail['nb_elements'])
    212         .' ('
    213         .'<a href="'.make_index_url(array('section'=>'recent_pics')).'">'
    214           .l10n('recent_pics_cat').'</a>'
    215         .')'
    216         .'</li>';
    217 
    218   foreach( $date_detail['elements'] as $element )
    219   {
    220     $tn_src = get_thumbnail_url($element);
    221     $item->description .= '<img src="'.$tn_src.'"/>';
    222   }
    223   $item->description .= '...<br/>';
    224 
    225   $item->description .=
    226         '<li>'
    227         .l10n_dec('%d category updated', '%d categories updated',
    228                   $date_detail['nb_cats'])
    229         .'</li>';
    230 
    231   $item->description .= '<ul>';
    232   foreach( $date_detail['categories'] as $cat )
    233   {
    234     $item->description .=
    235           '<li>'
    236           .get_cat_display_name_cache($cat['uppercats'])
    237           .' ('.
    238           l10n_dec('%d new element',
    239                    '%d new elements', $cat['img_count']).')'
    240           .'</li>';
    241   }
    242   $item->description .= '</ul>';
     186  $item->description .= get_html_description_recent_post_date($date_detail);
    243187
    244188  $item->descriptionHtmlSyndicated = true;
Note: See TracChangeset for help on using the changeset viewer.