Ignore:
Timestamp:
Mar 14, 2007, 12:01:16 AM (17 years ago)
Author:
rub
Message:

Fix bad default value for language on table user_info
Improve mail send (Undisclosed-recipients, switch language, ...)
Improve send an email to group members (Use Bcc, template, multi-language, ...) (But need more improvements)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/cat_modify.php

    r1900 r1904  
    530530if (isset($_POST['submitEmail']))
    531531{
    532   $query = '
    533 SELECT
    534     user_id,
    535     '.$conf['user_fields']['email'].' AS email
    536   FROM '.USER_GROUP_TABLE.'
    537     INNER JOIN '.USERS_TABLE.' ON '.$conf['user_fields']['id'].' = user_id
    538   WHERE '.$conf['user_fields']['email'].' IS NOT NULL
    539     AND group_id = '.$_POST['group'].'
    540 ;';
    541   $result = pwg_query($query);
    542 
    543   while ($row = mysql_fetch_array($result))
    544   {
    545     pwg_mail(
    546       $row['email'],
    547       array(
    548         'content' => get_absolute_root_url().make_index_url(
     532  set_make_full_url();
     533
     534  /* TODO: if $category['representative_picture_id']
     535    is empty find child representative_picture_id */
     536  if (!empty($category['representative_picture_id']))
     537  {
     538    $query = '
     539SELECT id, file, path, tn_ext
     540  FROM '.IMAGES_TABLE.'
     541  WHERE id = '.$category['representative_picture_id'].'
     542;';
     543
     544    $result = pwg_query($query);
     545    if (mysql_num_rows($result) > 0)
     546    {
     547      $element = mysql_fetch_assoc($result);
     548
     549      $img_url  = '<a href="'.
     550                      make_picture_url(array(
     551                          'image_id' => $element['id'],
     552                          'image_file' => $element['file'],
     553                          'category' => $category
     554                        ))
     555                      .'"><img src="'.get_thumbnail_url($element).'"/></a>';
     556    }
     557  }
     558 
     559  if (!isset($img_url))
     560  {
     561    $img_url = '';
     562  }
     563
     564  // TODO Mettre un array pour traduction subjet
     565  pwg_mail_group(
     566    $_POST['group'],
     567    get_str_email_format(true), /* TODO add a checkbox in order to choose format*/
     568    $category['name'],
     569    'cat_group_info',
     570    array
     571    (
     572      'IMG_URL' => $img_url,
     573      'LINK' => make_index_url(
    549574          array(
    550575            'category' => array(
    551576              'id' => $category['id'],
    552577              'name' => $category['name'],
    553               'permalink' => $category['permalink'],
    554               )
    555             )
    556           ),
    557         'subject' => $category['name']
    558         )
    559       );
    560   }
     578              'permalink' => $category['permalink']
     579              ))),
     580      'CPL_CONTENT' => '' /* TODO Add text area to add complementary content */
     581    ),
     582    '' /* TODO Add listbox in order to choose Language selected */);
     583
     584  unset_make_full_url();
    561585
    562586  $query = '
Note: See TracChangeset for help on using the changeset viewer.