Changeset 2129
- Timestamp:
- Oct 9, 2007, 11:35:31 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 5 5 phpmv2 6 6 map.php 7 upgrade65.log
-
- Property svn:ignore
-
trunk/include/functions_mail.inc.php
r2126 r2129 411 411 $list[] = $row; 412 412 } 413 } 414 415 foreach ($list as $elem) 416 { 417 $query = ' 413 414 foreach ($list as $elem) 415 { 416 $query = ' 418 417 SELECT 419 418 u.'.$conf['user_fields']['username'].' as username, … … 430 429 ;'; 431 430 432 $result = pwg_query($query); 433 434 if (mysql_num_rows($result) > 0) 435 { 436 $Bcc = array(); 437 while ($row = mysql_fetch_array($result)) 431 $result = pwg_query($query); 432 433 if (mysql_num_rows($result) > 0) 438 434 { 439 if (!empty($row['mail_address'])) 435 $Bcc = array(); 436 while ($row = mysql_fetch_array($result)) 440 437 { 441 array_push($Bcc, format_email($row['username'], $row['mail_address'])); 438 if (!empty($row['mail_address'])) 439 { 440 array_push($Bcc, format_email($row['username'], $row['mail_address'])); 441 } 442 442 } 443 } 444 445 if (count($Bcc) > 0) 446 { 447 switch_lang_to($elem['language']); 448 449 $mail_template = get_mail_template($email_format, $elem); 450 $mail_template->set_filename($tpl_shortname, 451 (empty($dirname) ? '' : $dirname.'/').$tpl_shortname.'.tpl'); 452 $mail_template->assign_vars($assign_vars); 453 454 $return = pwg_mail 455 ( 456 '', 457 array 443 444 if (count($Bcc) > 0) 445 { 446 switch_lang_to($elem['language']); 447 448 $mail_template = get_mail_template($email_format, $elem); 449 $mail_template->set_filename($tpl_shortname, 450 (empty($dirname) ? '' : $dirname.'/').$tpl_shortname.'.tpl'); 451 $mail_template->assign_vars($assign_vars); 452 453 $return = pwg_mail 458 454 ( 459 'Bcc' => $Bcc, 460 'subject' => l10n_args($keyargs_subject), 461 'email_format' => $email_format, 462 'content' => $mail_template->parse($tpl_shortname, true), 463 'content_format' => $email_format, 464 'template' => $elem['template'], 465 'theme' => $elem['theme'] 466 ) 467 ) and $return; 468 469 switch_lang_back(); 455 '', 456 array 457 ( 458 'Bcc' => $Bcc, 459 'subject' => l10n_args($keyargs_subject), 460 'email_format' => $email_format, 461 'content' => $mail_template->parse($tpl_shortname, true), 462 'content_format' => $email_format, 463 'template' => $elem['template'], 464 'theme' => $elem['theme'] 465 ) 466 ) and $return; 467 468 switch_lang_back(); 469 } 470 470 } 471 471 } … … 589 589 $content = ''; 590 590 591 if (!isset($conf_mail[$args['email_format']][get_pwg_charset()][$args['template']][$args['theme']])) 591 // key compose of indexes witch allow ti cache mail data 592 $cache_key = $args['email_format'].'-'.$lang_info['code'].'-'.$args['template'].'-'.$args['theme']; 593 594 if (!isset($conf_mail[$cache_key])) 592 595 { 593 596 if (!isset($mail_template)) … … 650 653 651 654 // what are displayed on the header of each mail ? 652 $conf_mail[$args['email_format']] 653 [get_pwg_charset()] 654 [$args['template']][$args['theme']]['header'] = 655 $mail_template->parse('mail_header', true); 655 $conf_mail[$cache_key]['header'] = 656 $mail_template->parse('mail_header', true); 656 657 657 658 // what are displayed on the footer of each mail ? 658 $conf_mail[$args['email_format']] 659 [get_pwg_charset()] 660 [$args['template']][$args['theme']]['footer'] = 661 $mail_template->parse('mail_footer', true); 659 $conf_mail[$cache_key]['footer'] = 660 $mail_template->parse('mail_footer', true); 662 661 } 663 662 664 663 // Header 665 $content.= $conf_mail[$args['email_format']] 666 [get_pwg_charset()] 667 [$args['template']][$args['theme']]['header']; 664 $content.= $conf_mail[$cache_key]['header']; 668 665 669 666 // Content … … 683 680 684 681 // Footer 685 $content.= $conf_mail[$args['email_format']] 686 [get_pwg_charset()] 687 [$args['template']][$args['theme']]['footer']; 682 $content.= $conf_mail[$cache_key]['footer']; 688 683 689 684 // Close boundary … … 700 695 global $user; 701 696 @mkdir(PHPWG_ROOT_PATH.'testmail'); 702 $filename = PHPWG_ROOT_PATH.'testmail/mail.'.$user['username'] ;697 $filename = PHPWG_ROOT_PATH.'testmail/mail.'.$user['username'].'.'.$lang_info['code'].'.'.$args['template'].'.'.$args['theme']; 703 698 if ($args['content_format'] == 'text/plain') 704 699 {
Note: See TracChangeset
for help on using the changeset viewer.