Changeset 1784 for trunk/admin/notification_by_mail.php
- Timestamp:
- Feb 6, 2007, 11:55:12 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 2 2 gal2 3 3 feed.xml 4 testmail
-
- Property svn:ignore
-
trunk/admin/notification_by_mail.php
r1748 r1784 85 85 86 86 $must_repost = true; 87 array_push($page['errors'], sprintf(l10n('nbm_background_treatment_redirect'), $time_refresh)); 87 array_push($page['errors'], 88 l10n_dec('nbm_background_treatment_redirect_second', 89 'nbm_background_treatment_redirect_seconds', 90 $time_refresh)); 88 91 } 89 92 } … … 271 274 272 275 // set env nbm user 273 set_user_ id_on_env_nbm($nbm_user['user_id']);276 set_user_on_env_nbm($nbm_user['user_id'], $is_action_send); 274 277 275 278 if ($is_action_send) 276 279 { 280 set_make_full_url(); 277 281 // Fill return list of "treated" check_key for 'send' 278 282 array_push($return_list, $nbm_user['check_key']); 279 $message = '';280 283 281 284 if ($conf['nbm_send_detailed_content']) 282 285 { 283 $news = news($nbm_user['last_send'], $dbnow );286 $news = news($nbm_user['last_send'], $dbnow, false, $conf['nbm_send_html_mail']); 284 287 $exist_data = count($news) > 0; 285 288 } … … 292 295 { 293 296 $subject = '['.$conf['gallery_title'].']: '.l10n('nbm_object_news'); 294 $message .= sprintf(l10n('nbm_content_hello'), $nbm_user['username']).",\n\n"; 297 298 // Assign current var for nbm mail 299 assign_vars_nbm_mail_content($nbm_user); 300 301 $end_punct = ($conf['nbm_send_detailed_content'] ? ':' : '.'); 295 302 296 303 if (!is_null($nbm_user['last_send'])) 297 $message .= sprintf(l10n('nbm_content_new_elements_between'), $nbm_user['last_send'], $dbnow);298 else299 $message .= sprintf(l10n('nbm_content_new_elements'), $dbnow);300 301 if ($conf['nbm_send_detailed_content'])302 304 { 303 $message .= ":\n"; 304 305 foreach ($news as $line) 306 { 307 $message .= ' o '.$line."\n"; 308 } 309 $message .= "\n"; 305 $env_nbm['mail_template']->assign_block_vars 306 ( 307 'content_new_elements_between', 308 array 309 ( 310 'DATE_BETWEEN_1' => $nbm_user['last_send'], 311 'DATE_BETWEEN_2' => $dbnow, 312 'END_PUNCT' => $end_punct 313 ) 314 ); 310 315 } 311 316 else 312 317 { 313 $message .= ".\n"; 318 $env_nbm['mail_template']->assign_block_vars 319 ( 320 'content_new_elements_single', 321 array 322 ( 323 'DATE_SINGLE' => $dbnow, 324 'END_PUNCT' => $end_punct 325 ) 326 ); 314 327 } 315 328 316 $message .= sprintf(l10n('nbm_content_goto'), $conf['gallery_title'], $conf['gallery_url'])."\n\n"; 317 $message .= $customize_mail_content."\n\n"; 318 $message .= l10n('nbm_content_byebye')."\n ".$env_nbm['send_as_name']."\n\n"; 319 320 $message .= get_mail_content_subscribe_unsubcribe($nbm_user); 321 322 if (pwg_mail(format_email($nbm_user['username'], $nbm_user['mail_address']), $env_nbm['send_as_mail_formated'], $subject, $message)) 329 if ($conf['nbm_send_detailed_content']) 330 { 331 foreach ($news as $data) 332 { 333 $env_nbm['mail_template']->assign_block_vars 334 ( 335 'global_new_line.new_line', array('DATA' => $data) 336 ); 337 } 338 } 339 340 if (!empty($customize_mail_content)) 341 { 342 $env_nbm['mail_template']->assign_block_vars 343 ( 344 'custom', array('CUSTOMIZE_MAIL_CONTENT' => $customize_mail_content) 345 ); 346 } 347 348 if ($conf['nbm_send_html_mail'] and $conf['nbm_send_recent_post_dates']) 349 { 350 $recent_post_dates = get_recent_post_dates(7, 5, 9); 351 foreach ($recent_post_dates as $date_detail) 352 { 353 $env_nbm['mail_template']->assign_block_vars 354 ( 355 'recent_post.recent_post_block', 356 array 357 ( 358 'TITLE' => get_title_recent_post_date($date_detail), 359 'HTML_DATA' => get_html_description_recent_post_date($date_detail) 360 ) 361 ); 362 } 363 } 364 365 $env_nbm['mail_template']->assign_block_vars 366 ( 367 'goto', 368 array 369 ( 370 'GALLERY_TITLE' => $conf['gallery_title'], 371 'GALLERY_URL' => $conf['gallery_url'] 372 ) 373 ); 374 375 $env_nbm['mail_template']->assign_block_vars 376 ( 377 'byebye', array('SEND_AS_NAME' => $env_nbm['send_as_name']) 378 ); 379 380 if (pwg_mail( 381 format_email($nbm_user['username'], $nbm_user['mail_address']), 382 $env_nbm['send_as_mail_formated'], 383 $subject, 384 $env_nbm['mail_template']->parse('notification_by_mail', true), 385 $env_nbm['email_format'], $env_nbm['email_format'] 386 )) 323 387 { 324 388 inc_mail_sent_success($nbm_user); … … 332 396 inc_mail_sent_failed($nbm_user); 333 397 } 398 399 unset_make_full_url(); 334 400 } 335 401 } … … 342 408 } 343 409 } 410 411 // unset env nbm user 412 unset_user_on_env_nbm(); 344 413 } 345 414 … … 438 507 } 439 508 440 array_push($page['infos'], sprintf(l10n('nbm_updated_param_count'), $updated_param_count)); 509 array_push($page['infos'], 510 l10n_dec('nbm_updated_param_count', 'nbm_updated_params_count', 511 $updated_param_count)); 441 512 442 513 // Reload conf with new values … … 543 614 $page['mode'], 544 615 array( 616 'SEND_HTML_MAIL_YES' => ($conf['nbm_send_html_mail'] ? 'checked="checked"' : ''), 617 'SEND_HTML_MAIL_NO' => (!$conf['nbm_send_html_mail'] ? 'checked="checked"' : ''), 545 618 'SEND_MAIL_AS' => $conf['nbm_send_mail_as'], 546 619 'SEND_DETAILED_CONTENT_YES' => ($conf['nbm_send_detailed_content'] ? 'checked="checked"' : ''), 547 620 'SEND_DETAILED_CONTENT_NO' => (!$conf['nbm_send_detailed_content'] ? 'checked="checked"' : ''), 548 'COMPLEMENTARY_MAIL_CONTENT' => $conf['nbm_complementary_mail_content'] 621 'COMPLEMENTARY_MAIL_CONTENT' => $conf['nbm_complementary_mail_content'], 622 'SEND_RECENT_POST_DATES_YES' => ($conf['nbm_send_recent_post_dates'] ? 'checked="checked"' : ''), 623 'SEND_RECENT_POST_DATES_NO' => (!$conf['nbm_send_recent_post_dates'] ? 'checked="checked"' : '') 549 624 )); 550 625 break;
Note: See TracChangeset
for help on using the changeset viewer.