| [ Index ] |
|
Code source de e107 0.7.8 |
1 <?php 2 /* 3 + ----------------------------------------------------------------------------+ 4 | e107 website system 5 | 6 | ©Steve Dunstan 2001-2002 7 | http://e107.org 8 | jalist@e107.org 9 | 10 | Released under the terms and conditions of the 11 | GNU General Public License (http://gnu.org). 12 | 13 | $Source: /cvsroot/e107/e107_0.7/e107_admin/mailout.php,v $ 14 | $Revision: 1.59 $ 15 | $Date: 2006/11/29 22:27:40 $ 16 | $Author: e107coders $ 17 +----------------------------------------------------------------------------+ 18 */ 19 20 require_once ("../class2.php"); 21 $e_sub_cat = 'mail'; 22 if (!isset($_POST['submit'])) { 23 $e_wysiwyg = "email_body"; 24 } 25 set_time_limit(180); 26 session_write_close(); 27 require_once(e_ADMIN."auth.php"); 28 require_once(e_HANDLER."ren_help.php"); 29 if (!getperms("W")) { 30 header("location:".e_BASE."index.php"); 31 exit; 32 } 33 include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_users.php"); 34 require_once(e_HANDLER."userclass_class.php"); 35 36 if (isset($_POST['testemail'])) { 37 if(trim($_POST['testaddress']) == ""){ 38 $message = MAILAN_19; 39 }else{ 40 $mailheader_e107id = USERID; 41 require_once(e_HANDLER."mail.php"); 42 $add = ($pref['mailer']) ? " (".strtoupper($pref['mailer']).")" : " (PHP)"; 43 $sendto = trim($_POST['testaddress']); 44 if (!sendemail($sendto, PRFLAN_66." ".SITENAME.$add, PRFLAN_67,USERNAME)) { 45 $message = ($pref['mailer'] == "smtp") ? PRFLAN_75 : PRFLAN_68; 46 } else { 47 $message = PRFLAN_69. "(".$sendto.")"; 48 } 49 } 50 } 51 52 $sql->db_Delete("generic", "gen_type='sendmail' AND gen_datestamp < ".(time()-86400)); 53 54 if (isset($_POST['save_email'])){ 55 $qry = "0,'massmail', '".time()."', '".USERID."', '".$tp->toDB($_POST['email_subject'])."', '0', \"".$tp->toDB($_POST['email_body'])."\" "; 56 $message = $sql -> db_Insert("generic", $qry) ? LAN_SAVED : LAN_ERROR; 57 } 58 59 if (isset($_POST['update_email'])){ 60 $qry = "gen_user_id = '".USERID."', gen_datestamp = '".time()."', gen_ip = '".$tp->toDB($_POST['email_subject'])."', gen_chardata= \"".$tp->toDB($_POST['email_body'])."\" WHERE gen_id = '".$_POST['update_id']."' "; 61 $message = $sql -> db_Update("generic", $qry) ? LAN_UPDATED : LAN_UPDATED_FAILED; 62 } 63 64 if (isset($_POST['delete'])){ 65 $d_idt = array_keys($_POST['delete']); 66 $message = ($sql -> db_Delete("generic", "gen_id='".$d_idt[0]."'")) ? LAN_DELETED : LAN_DELETED_FAILED; 67 } 68 69 if (isset($_POST['edit'])){ 70 $e_idt = array_keys($_POST['edit']); 71 if($sql -> db_Select("generic", "*", "gen_id='".$e_idt[0]."' ")){ 72 $foo = $sql -> db_Fetch(); 73 74 } 75 } 76 77 if (isset($_POST['submit'])) { 78 79 if ($_POST['email_to'] == "all" || $_POST['email_to'] == "admin") { 80 81 switch ($_POST['email_to']) { 82 case "admin": 83 $insert = "u.user_admin='1' "; 84 break; 85 86 case "all": 87 $insert = "u.user_ban='0' "; 88 break; 89 } 90 91 $qry = "SELECT u.*, ue.* FROM #user AS u LEFT JOIN #user_extended AS ue ON ue.user_extended_id = u.user_id WHERE $insert "; 92 93 } elseif($_POST['email_to'] == "unverified"){ 94 $qry = "SELECT u.* FROM #user AS u WHERE u.user_ban='2'"; 95 96 } elseif($_POST['email_to'] == "self"){ 97 $qry = "SELECT u.* FROM #user AS u WHERE u.user_id='".USERID."'"; 98 99 } else { 100 101 $insert = "u.user_class REGEXP concat('(^|,)',{$_POST['email_to']},'(,|$)') AND u.user_ban='0' "; 102 $qry = "SELECT u.*, ue.* FROM #user AS u LEFT JOIN #user_extended AS ue ON ue.user_extended_id = u.user_id WHERE $insert "; 103 } 104 105 $sql2 = new db; 106 $c = 0; 107 108 if($_POST['extended_1_name'] && $_POST['extended_1_value']){ 109 $qry .= " AND ".$_POST['extended_1_name']." = '".$_POST['extended_1_value']."' "; 110 } 111 112 if($_POST['extended_2_name'] && $_POST['extended_2_value']){ 113 $qry .= " AND ".$_POST['extended_2_name']." = '".$_POST['extended_2_value']."' "; 114 } 115 116 if($_POST['user_search_name'] && $_POST['user_search_value']){ 117 $qry .= " AND u.".$_POST['user_search_name']." LIKE '%".$_POST['user_search_value']."%' "; 118 } 119 120 $qry .= " ORDER BY u.user_name"; 121 122 $_POST['mail_id'] = time(); 123 124 $sql->db_Select_gen($qry); 125 if (ob_get_level() == 0) { 126 ob_start(); 127 } 128 while ($row = $sql->db_Fetch()) { 129 $qry = "0,'sendmail', '".$_POST['mail_id']."', '".$row['user_id']."', '', '0', \"".$tp->toDB($_POST['email_subject'])."\" "; 130 if($sql2 -> db_Insert("generic", $qry)){ 131 $c++; 132 } 133 ob_flush(); 134 flush(); 135 } 136 ob_end_flush(); 137 138 $debug = (e_MENU == "debug") ? "?[debug]" : ""; 139 140 $text = "<div style='text-align:center'> 141 <form method='post' action='".e_HANDLER."phpmailer/mailout_process.php".$debug."' name='mailform' onsubmit=\"open('', 'popup','width=230,height=170,resizable=1,scrollbars=0');this.target = 'popup';return true;\" > 142 <div>"; 143 144 foreach($_POST as $key=>$val) 145 { 146 $text .= "<input type='hidden' name='".$key."' value='".stripslashes($tp->post_toForm($val))."' />\n"; 147 } 148 149 $text .= "</div>"; 150 151 $text .= "<div>$c ".MAILAN_24."</div>"; 152 153 $text .= "<div><br /><input class='button' type='submit' name='send_mails' value='".MAILAN_37."' /> 154 <input class='button' type='submit' name='cancel_emails' value='".MAILAN_38."' /> 155 </div>"; 156 $text .= "</form><br /><br /></div>"; 157 158 // --------------- Preview Email --------------------------> 159 160 if(is_numeric($_POST['email_to'])) 161 { 162 $sql->db_Select("userclass_classes", "userclass_name", "userclass_id = '{$_POST['email_to']}'"); 163 $row = $sql->db_Fetch(); 164 $_to = MAILAN_23.$row['userclass_name']; 165 } 166 else 167 { 168 $_to = $_POST['email_to']; 169 } 170 $text .= " 171 <div> 172 <table class='fborder'> 173 174 <tr> 175 <td class='forumheader3' style='width:30%'>".MAILAN_03."</td> 176 <td class='forumheader3'>".$_to." "; 177 if($_POST['email_to'] == "self"){ 178 $text .= "<".USEREMAIL.">"; 179 } 180 $text .="</td> 181 </tr> 182 183 <tr> 184 <td class='forumheader3' style='width:30%'>".MAILAN_01." / ".MAILAN_02."</td> 185 <td class='forumheader3'>".$_POST['email_from_name']." <".$_POST['email_from_email']."></td> 186 </tr> 187 188 <tr> 189 <td class='forumheader3' style='width:20%'>".MAILAN_06."</td> 190 <td class='forumheader3'>".$_POST['email_subject']." </td> 191 </tr>"; 192 193 $text .= ($_POST['email_cc']) ? " 194 <tr> 195 <td class='forumheader3' style='width:30%'>".MAILAN_04."</td> 196 <td class='forumheader3'>".$_POST['email_cc']." </td> 197 </tr>": ""; 198 199 $text .= ($_POST['email_bcc']) ? " 200 <tr> 201 <td class='forumheader3' style='width:30%'>".MAILAN_05."</td> 202 <td class='forumheader3'>".$_POST['email_bcc']." </td> 203 </tr>": ""; 204 205 206 $text .= ($_POST['user_search_name'] && $_POST['user_search_value']) ? " 207 <tr> 208 <td class='forumheader3' style='width:30%'>".$_POST['user_search_name']."</td> 209 <td class='forumheader3'>".$_POST['user_search_value']." </td> 210 </tr>": ""; 211 212 213 214 $text .= ($_POST['extended_1_name'] && $_POST['extended_1_value']) ? " 215 <tr> 216 <td class='forumheader3' style='width:30%'>".$_POST['extended_1_name']."</td> 217 <td class='forumheader3'>".$_POST['extended_1_value']." </td> 218 </tr>": ""; 219 220 221 222 $text .= ($_POST['extended_2_name'] && $_POST['extended_2_value']) ? " 223 <tr> 224 <td class='forumheader3' style='width:30%'>".$_POST['extended_2_name']."</td> 225 <td class='forumheader3'>".$_POST['extended_2_value']." </td> 226 </tr>": ""; 227 228 229 230 $text .=" 231 <tr> 232 <td class='forumheader3' colspan='2'>".stripslashes($tp->toHTML($_POST['email_body'],TRUE))."</td> 233 </tr> 234 235 </table> 236 </div>"; 237 238 239 $ns->tablerender(MAILAN_39." ($c) ", $text); 240 require_once(e_ADMIN."footer.php"); 241 exit; 242 } 243 244 245 246 247 //. Update Preferences. 248 249 if (isset($_POST['updateprefs'])) { 250 $pref['mailer'] = $_POST['mailer']; 251 $pref['sendmail'] = $_POST['sendmail']; 252 $pref['smtp_server'] = $tp->toDB($_POST['smtp_server']); 253 $pref['smtp_username'] = $tp->toDB($_POST['smtp_username']); 254 $pref['smtp_password'] = $tp->toDB($_POST['smtp_password']); 255 $pref['smtp_keepalive'] = $_POST['smtp_keepalive']; 256 $pref['smtp_pop3auth'] = $_POST['smtp_pop3auth']; 257 258 $pref['mail_pause'] = $_POST['mail_pause']; 259 $pref['mail_pausetime'] = $_POST['mail_pausetime']; 260 $pref['mail_bounce_email'] = $_POST['mail_bounce_email']; 261 $pref['mail_bounce_pop3'] = $_POST['mail_bounce_pop3']; 262 $pref['mail_bounce_user'] = $_POST['mail_bounce_user']; 263 $pref['mail_bounce_pass'] = $_POST['mail_bounce_pass']; 264 $pref['mail_bounce_delete'] = $_POST['mail_bounce_delete']; 265 266 save_prefs(); 267 $message = LAN_SETSAVED; 268 } 269 270 271 if (isset($message)) { 272 $ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>"); 273 } 274 275 276 277 // ----------------- Actions -----------------------------------------------> 278 279 if(e_QUERY == "prefs"){ 280 show_prefs(); 281 } 282 283 if((!e_QUERY && !$_POST['delete']) || $_POST['edit']){ 284 show_mailform($foo); 285 } 286 287 288 if(e_QUERY == "list" || $_POST['delete'] ){ 289 showList(); 290 } 291 292 293 require_once(e_ADMIN."footer.php"); 294 295 296 297 // ------------------- Display Mailout Form.---------------------------------> 298 299 function show_mailform($foo=""){ 300 global $ns,$sql,$tp,$pref,$HANDLERS_DIRECTORY; 301 302 $email_subject = $foo['gen_ip']; 303 $email_body = $tp->toForm($foo['gen_chardata']); 304 $email_id = $foo['gen_id']; 305 $text = ""; 306 307 if(strpos($_SERVER['SERVER_SOFTWARE'],"mod_gzip") && !is_readable(e_HANDLER."phpmailer/.htaccess")){ 308 $warning = MAILAN_40." ".$HANDLERS_DIRECTORY."phpmailer/ ".MAILAN_41; 309 $ns -> tablerender(MAILAN_42, $warning); 310 } 311 312 $debug = (e_MENU == "debug") ? "?[debug]" : ""; 313 $text .= "<div style='".ADMIN_WIDTH." text-align:center'> 314 <form method='post' action='".e_SELF.$debug."' id='mailout_form'> 315 <table class='fborder' style='".ADMIN_WIDTH."' cellpadding='0' cellspacing='0'> 316 <tr> 317 <td style='width:30%' class='forumheader3'>".MAILAN_01.": </td> 318 <td style='width:70%' class='forumheader3'> 319 <input type='text' name='email_from_name' class='tbox' style='width:80%' size='10' value=\"".$_POST['email_from_name']."\" /> 320 </td> 321 </tr>"; 322 323 324 $text .=" 325 326 <tr> 327 <td class='forumheader3'>".MAILAN_02.": </td> 328 <td class='forumheader3'> 329 <input type='text' name='email_from_email' class='tbox' style='width:80%' value=\"".$_POST['email_from_email']."\" /> 330 </td> 331 </tr> 332 333 <tr> 334 <td class='forumheader3'>".MAILAN_03.": </td> 335 <td class='forumheader3'> 336 ".userclasses("email_to", $_POST['email_to'])."</td> 337 </tr>"; 338 339 340 // User Search Field. 341 342 343 $u_array = array("user_name"=>MAILAN_43,"user_login"=>MAILAN_44,"user_email"=>MAILAN_45); 344 345 $text .= " 346 <tr> 347 <td style='width:35%' class='forumheader3'>".MAILAN_46." 348 <select name='user_search_name' class='tbox'> 349 <option value=''> </option>"; 350 351 foreach($u_array as $key=>$val){ 352 $text .= "<option value='$key' >".$val."</option>\n"; 353 } 354 355 $text .= " 356 </select> ".MAILAN_47." </td> 357 <td style='width:65%' class='forumheader3'> 358 <input type='text' name='user_search_value' class='tbox' style='width:80%' value='' /> 359 </td></tr> 360 "; 361 362 // Extended Field #1. 363 364 $text .= " 365 <tr> 366 <td class='forumheader3'>".MAILAN_46." 367 <select name='extended_1_name' class='tbox'> 368 <option value=''> </option>"; 369 $sql -> db_Select("user_extended_struct"); 370 while($row = $sql-> db_Fetch()){ 371 $text .= "<option value='ue.user_".$row['user_extended_struct_name']."' >".ucfirst($row['user_extended_struct_name'])."</option>\n"; 372 } 373 374 $text .= " 375 </select> ".MAILAN_48." </td> 376 <td class='forumheader3'> 377 <input type='text' name='extended_1_value' class='tbox' style='width:80%' value='' /> 378 </td></tr> 379 "; 380 381 382 383 // Extended Field #2. 384 385 $text .= " 386 <tr> 387 <td class='forumheader3'>".MAILAN_46." 388 <select name='extended_2_name' class='tbox'> 389 <option value=''> </option>"; 390 $sql -> db_Select("user_extended_struct"); 391 while($row = $sql-> db_Fetch()){ 392 $text .= "<option value='ue.user_".$row['user_extended_struct_name']."' >".ucfirst($row['user_extended_struct_name'])."</option>\n"; 393 } 394 395 $text .= " 396 </select> ".MAILAN_48." </td> 397 <td class='forumheader3'> 398 <input type='text' name='extended_2_value' class='tbox' style='width:80%' value='' /> 399 </td></tr> 400 "; 401 402 403 404 405 $text .= " 406 407 <tr> 408 <td class='forumheader3'>".MAILAN_04.": </td> 409 <td class='forumheader3'> 410 <input type='text' name='email_cc' class='tbox' style='width:80%' value=\"".$_POST['email_cc']."\" /> 411 412 </td> 413 </tr> 414 415 416 <tr> 417 <td class='forumheader3'>".MAILAN_05.": </td> 418 <td class='forumheader3'> 419 <input type='text' name='email_bcc' class='tbox' style='width:80%' value='$email_bcc' /> 420 421 </td> 422 </tr> 423 424 <tr> 425 <td class='forumheader3'>".MAILAN_06.": </td> 426 <td class='forumheader3'> 427 <input type='text' name='email_subject' class='tbox' style='width:80%' value='$email_subject' /> 428 429 </td> 430 </tr>"; 431 432 433 434 435 // Attachment. 436 437 $text .= "<tr> 438 <td class='forumheader3'>".MAILAN_07.": </td> 439 <td class='forumheader3'>"; 440 $text .= "<select class='tbox' name='email_attachment' > 441 <option value=''> </option>\n"; 442 $sql->db_Select("download", "download_url,download_name", "download_id !='' ORDER BY download_name"); 443 while ($row = $sql->db_Fetch()) { 444 extract($row); 445 $selected = ($_POST['email_attachment'] == $download_url) ? "selected='selected'" : 446 ""; 447 $text .= "<option value=\"$download_url \" $selected>".htmlspecialchars($download_name)."</option>\n"; 448 } 449 $text .= " </select>"; 450 451 $text .= "</td> 452 </tr>"; 453 454 455 456 457 458 $text .= " 459 <tr> 460 <td class='forumheader3'>".MAILAN_09.": </td> 461 <td class='forumheader3'> 462 <input type='checkbox' name='use_theme' value='1' /> 463 </td> 464 </tr> 465 466 <tr> 467 <td colspan='2' class='forumheader3'> 468 <textarea rows='10' cols='20' id='email_body' name='email_body' class='tbox' style='width:100%;height:200px' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>".$email_body."</textarea> 469 </td> 470 </tr>"; 471 472 $text .=" 473 <tr> 474 <td style='width:100%' class='forumheader3' colspan='2'> 475 <div style='width:100%;text-align:center;vertical-align: middle;' >"; 476 477 global $eplug_bb; 478 479 $eplug_bb[] = array( 480 "name" => 'shortcode', 481 "onclick" => 'expandit', 482 "onclick_var" => "sc_selector", 483 "icon" => e_IMAGE."generic/bbcode/shortcode.png", 484 "helptext" => MAILAN_11, 485 "function" => "sc_Select", 486 "function_var" => "sc_selector" 487 ); 488 489 $text .= display_help("helpb",'mailout'); 490 491 if(e_WYSIWYG) { 492 $text .="<span style='vertical-align: super;margin-left:5%;margin-bottom:auto;margin-top:auto'><input type='button' class='button' name='usrname' value=\"".MAILAN_16."\" onclick=\"tinyMCE.selectedInstance.execCommand('mceInsertContent',0,'|USERNAME|')\" /> 493 <input type='button' class='button' name='usrlink' value=\"".MAILAN_17."\" onclick=\"tinyMCE.selectedInstance.execCommand('mceInsertContent',0,'|SIGNUP_LINK|')\" /> 494 <input type='button' class='button' name='usrid' value=\"".MAILAN_18."\" onclick=\"tinyMCE.selectedInstance.execCommand('mceInsertContent',0,'|USERID|')\" /></span>"; 495 } 496 497 $text .=" 498 </div></td> 499 </tr>"; 500 501 502 $text .= "<tr style='vertical-align:top'> 503 <td colspan='2' style='text-align:center' class='forumheader'>"; 504 if(isset($_POST['edit'])){ 505 $text .= "<input type='hidden' name='update_id' value='".$email_id."' />"; 506 $text .= "<input class='button' type='submit' name='update_email' value=\"".LAN_UPDATE."\" />"; 507 }else{ 508 $text .= "<input class='button' type='submit' name='save_email' value=\"".LAN_SAVE."\" />"; 509 } 510 511 $text .=" <input class='button' type='submit' name='submit' value=\"".MAILAN_08."\" /> 512 513 </td> 514 </tr> 515 </table> 516 </form> 517 </div>"; 518 519 $ns->tablerender(MAILAN_15, $text); 520 521 } 522 523 // ------------------ Preferences --------------------------------------------> 524 525 function show_prefs(){ 526 global $pref,$ns; 527 $text = " 528 <form method='post' action='".e_SELF."?".e_QUERY."' id='mailsettingsform'> 529 <div id='mail' style='text-align:center;'> 530 <table style='".ADMIN_WIDTH."' class='fborder'> 531 <tr> 532 <td style='width:30%' class='forumheader3'><span title='".PRFLAN_64."' style='cursor:help'>".PRFLAN_63."</span><br /></td> 533 <td style='width:70%; text-align:right' class='forumheader3'><input class='button' type='submit' name='testemail' value=\"".PRFLAN_65."\" /> 534 <input name='testaddress' class='tbox' type='text' value=\"".SITEADMINEMAIL."\" /> 535 </td> 536 </tr> 537 538 <tr> 539 <td style='vertical-align:top' class='forumheader3'>".PRFLAN_70."<br /><span class='smalltext'>".PRFLAN_71."</span></td> 540 <td style='text-align:right' class='forumheader3'> 541 <select class='tbox' name='mailer' onchange='disp(this.value)'>\n"; 542 $mailers = array("php","smtp","sendmail"); 543 foreach($mailers as $opt){ 544 $sel = ($pref['mailer'] == $opt) ? "selected='selected'" : ""; 545 $text .= "<option value='$opt' $sel>$opt</option>\n"; 546 } 547 $text .="</select><br />"; 548 549 550 // SMTP. --------------> 551 552 553 $smtpdisp = ($pref['mailer'] != "smtp") ? "display:none;" : ""; 554 $text .= "<div id='smtp' style='$smtpdisp text-align:right'><table style='margin-right:0px;margin-left:auto;border:0px'>"; 555 $text .= " <tr> 556 <td style='text-align:right' >".PRFLAN_72.": </td> 557 <td style='width:50%; text-align:right' > 558 <input class='tbox' type='text' name='smtp_server' size='40' value='".$pref['smtp_server']."' maxlength='50' /> 559 </td> 560 </tr> 561 562 <tr> 563 <td style='text-align:right' >".PRFLAN_73.": (".LAN_OPTIONAL.") </td> 564 <td style='width:50%; text-align:right' > 565 <input class='tbox' type='text' name='smtp_username' size='40' value=\"".$pref['smtp_username']."\" maxlength='50' /> 566 </td> 567 </tr> 568 569 <tr> 570 <td style='text-align:right' >".PRFLAN_74.": (".LAN_OPTIONAL.") </td> 571 <td style='width:50%; text-align:right' > 572 <input class='tbox' type='password' name='smtp_password' size='40' value='".$pref['smtp_password']."' maxlength='50' /> 573 </td> 574 </tr> 575 576 <tr> 577 <td colspan='2' style='text-align:right' >".MAILAN_57.": 578 "; 579 $checked = (isset($pref['smtp_keepalive']) && $pref['smtp_keepalive']==1) ? "checked='checked'" : ""; 580 $text .= "<input type='checkbox' name='smtp_keepalive' value='1' {$checked} /> 581 </td> 582 </tr> 583 584 <tr> 585 <td colspan='2' style='text-align:right' >".MAILAN_67.": 586 "; 587 $checked = (isset($pref['smtp_pop3auth']) && $pref['smtp_pop3auth']==1) ? "checked='checked'" : ""; 588 $text .= "<input type='checkbox' name='smtp_pop3auth' value='1' {$checked} /> 589 </td> 590 </tr> 591 592 593 594 </table></div>"; 595 596 // Sendmail. --------------> 597 598 599 $senddisp = ($pref['mailer'] != "sendmail") ? "display:none;" : ""; 600 $text .= "<div id='sendmail' style='$senddisp text-align:right'><table style='margin-right:0px;margin-left:auto;border:0px'>"; 601 $text .= " 602 603 <tr> 604 <td >".MAILAN_20.": </td> 605 <td style='text-align:right' > 606 <input class='tbox' type='text' name='sendmail' size='60' value=\"".(!$pref['sendmail'] ? "/usr/sbin/sendmail -t -i -r ".$pref['siteadminemail'] : $pref['sendmail'])."\" maxlength='80' /> 607 </td> 608 </tr> 609 610 </table></div>"; 611 $text .="</td> 612 </tr> 613 614 <tr> 615 <td class='forumheader3'>".MAILAN_25."</td> 616 <td class='forumheader3' style='text-align: right;'> ".MAILAN_26." 617 <input class='tbox' size='3' type='text' name='mail_pause' value='".$pref['mail_pause']."' /> ".MAILAN_27.". 618 </td> 619 </tr>\n 620 621 <tr> 622 <td class='forumheader3'>".MAILAN_28."</td> 623 <td class='forumheader3' style='text-align: right;'> 624 <input class='tbox' size='3' type='text' name='mail_pausetime' value='".$pref['mail_pausetime']."' /> ".MAILAN_29.".<br /> 625 <span class='smalltext'>".MAILAN_30."</span> 626 </td> 627 </tr>\n 628 629 <tr> 630 <td style='vertical-align:top' class='forumheader3'>".MAILAN_31."</td> 631 <td style=' text-align:right' class='forumheader3'> 632 ".MAILAN_32.": <input class='tbox' size='40' type='text' name='mail_bounce_email' value=\"".$pref['mail_bounce_email']."\" /><br /> 633 ".MAILAN_33." (POP3): <input class='tbox' size='40' type='text' name='mail_bounce_pop3' value=\"".$pref['mail_bounce_pop3']."\" /><br /> 634 ".MAILAN_34.": <input class='tbox' size='40' type='text' name='mail_bounce_user' value=\"".$pref['mail_bounce_user']."\" /><br /> 635 ".MAILAN_35.": <input class='tbox' size='40' type='text' name='mail_bounce_pass' value=\"".$pref['mail_bounce_pass']."\" /><br />"; 636 637 $check = ($pref['mail_bounce_delete']==1) ? "checked='checked'" : ""; 638 $text .= MAILAN_36.": <input type='checkbox' name='mail_bounce_delete' value='1' {$check} /> 639 640 </td> 641 </tr> 642 643 644 <tr> 645 <td style='text-align:center' colspan='2' class='forumheader'> 646 <input class='button' type='submit' name='updateprefs' value=\"".PRFLAN_52."\" /> 647 </td> 648 </tr> 649 650 651 652 653 654 </table></div></form>"; 655 656 $text .= ""; 657 $caption = LAN_PREFS; 658 $ns->tablerender($caption, $text); 659 } 660 661 662 663 664 function showList() 665 { 666 global $sql,$ns,$tp; 667 $gen = new convert; 668 $qry ="SELECT g.*,u.* FROM #generic AS g LEFT JOIN #user AS u ON g.gen_user_id = u.user_id WHERE g.gen_type = 'massmail' ORDER BY g.gen_datestamp DESC"; 669 // $count = $sql -> db_Select("generic", "*", "gen_type ='massmail' ORDER BY gen_datestamp DESC"); 670 $count = $sql -> db_Select_gen($qry); 671 672 $text = "<div style='text-align:center'>"; 673 674 if (!$count) 675 { 676 $text = " 677 <div class='forumheader2' style='text-align:center'>".MAILAN_22."</div>"; 678 $ns -> tablerender("<div style='text-align:center'>".MAILAN_21."</div>", $text); 679 require_once(e_ADMIN."footer.php"); 680 exit; 681 } 682 else 683 { 684 685 $text .= " 686 687 <form action='".e_SELF."' id='display' method='post'> 688 <table style='".ADMIN_WIDTH."' class='fborder'> 689 690 <tr> 691 <td style='width:5%; text-align: center;' class='fcaption'>".MAILAN_49."</td> 692 <td style='width:10%' class='fcaption'>".MAILAN_50."</td> 693 <td style='width:40%' class='fcaption'>".MAILAN_51."</td> 694 <td style='width:20%; text-align: center;' class='fcaption'>".MAILAN_52."</td> 695 <td style='width:5%; text-align: center;' class='fcaption'>".LAN_OPTIONS."</td> 696 </tr> 697 "; 698 699 $glArray = $sql -> db_getList(); 700 foreach($glArray as $row2) 701 { 702 703 $datestamp = $gen->convert_date($row2['gen_datestamp'], "short"); 704 705 $text .= "<tr> 706 <td class='forumheader3' style='; text-align: center;'>".$row2['gen_id'] ."</td> 707 <td class='forumheader3'>".$row2['user_name']."</td> 708 <td class='forumheader3'>".$row2['gen_ip']."</td> 709 710 <td class='forumheader3' style='; text-align: center;'>".$datestamp."</td> 711 712 <td style='width:50px;white-space:nowrap' class='forumheader3'> 713 <div> 714 <input type='image' name='edit[{$row2['gen_id']}]' value='edit' src='".e_IMAGE."admin_images/edit_16.png' alt='".LAN_EDIT."' title='".LAN_EDIT."' style='border:0px' /> 715 <input type='image' name='delete[{$row2['gen_id']}]' value='del' onclick=\"return jsconfirm('".$tp->toJS(LAN_CONFIRMDEL." [".$row2['gen_ip']."]")."') \" src='".e_IMAGE."admin_images/delete_16.png' alt='".LAN_DELETE."' title='".LAN_DELETE."' style='border:0px' /> 716 </div> 717 </td> 718 </tr> 719 "; 720 } 721 } 722 723 $text .= "</table>\n</form><br /><br /><br /></div>"; 724 $ns -> tablerender("<div style='text-align:center'>".MAILAN_21."</div>", $text); 725 } 726 727 728 729 730 function userclasses($name) { 731 global $sql; 732 $text .= "<select style='width:80%' class='tbox' name='$name' > 733 <option value='all'>".MAILAN_12."</option> 734 <option value='unverified'>".MAILAN_13."</option> 735 <option value='admin'>".MAILAN_53."</option> 736 <option value='self'>".MAILAN_54."</option>"; 737 $query = "SELECT uc.*, count(u.user_id) AS members 738 FROM #userclass_classes AS uc 739 LEFT JOIN #user AS u ON u.user_class REGEXP concat('(^|,)',uc.userclass_id,'(,|$)') 740 GROUP BY uc.userclass_id 741 "; 742 743 $sql->db_Select_gen($query); 744 while ($row = $sql->db_Fetch()) { 745 $public = ($row['userclass_editclass'] == 0)? "(".MAILAN_10.")" : ""; 746 $text .= "<option value='{$row['userclass_id']}' >".MAILAN_55." - {$row['userclass_name']} $public [{$row['members']}]</option>"; 747 } 748 $text .= " </select>"; 749 750 return $text; 751 } 752 753 754 function mailout_adminmenu() { 755 $action = (e_QUERY) ? e_QUERY : "post"; 756 if($action == "edit"){ 757 $action = "post"; 758 } 759 $var['post']['text'] = MAILAN_56; 760 $var['post']['link'] = e_SELF; 761 $var['post']['perm'] = "W"; 762 $var['list']['text'] = LAN_SAVED; 763 $var['list']['link'] = e_SELF."?list"; 764 $var['list']['perm'] = "W"; 765 if(getperms("0")){ 766 $var['prefs']['text'] = LAN_OPTIONS; 767 $var['prefs']['link'] = e_SELF."?prefs"; 768 $var['prefs']['perm'] = "0"; 769 } 770 show_admin_menu(MAILAN_15, $action, $var); 771 } 772 773 774 function sc_Select($container='sc_selector') { 775 $text =" 776 <!-- Start of Shortcode selector --> 777 <div style='margin-left:0px;margin-right:0px; position:relative;z-index:1000;float:right;display:none' id='{$container}'> 778 <div style='position:absolute; bottom:30px; right:125px'> 779 <table class='fborder' style='background-color: #fff'> 780 <tr><td class='forumheader3'> 781 <select class='tbox' name='sc_sel' onchange=\"addtext(this.value); expandit('{$container}')\"> 782 <option value=''> -- </option>\n"; 783 784 $sc = array( 785 "|USERNAME|" => MAILAN_16, 786 "|SIGNUP_LINK|" => MAILAN_17, 787 "|USERID|" => MAILAN_18 788 ); 789 790 foreach($sc as $key=>$val){ 791 $text .= "<option value='".$key."'>".$val."</option>\n"; 792 } 793 $text .=" 794 </select></td></tr> \n </table></div> 795 </div> 796 \n<!-- End of SC selector --> 797 798 "; 799 800 return $text; 801 } 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 function headerjs() 818 { 819 820 $text = " 821 <script type='text/javascript'> 822 function disp(type) { 823 824 825 if(type == 'smtp'){ 826 document.getElementById('smtp').style.display = ''; 827 document.getElementById('sendmail').style.display = 'none'; 828 return; 829 } 830 831 if(type =='sendmail'){ 832 document.getElementById('smtp').style.display = 'none'; 833 document.getElementById('sendmail').style.display = ''; 834 return; 835 } 836 837 document.getElementById('smtp').style.display = 'none'; 838 document.getElementById('sendmail').style.display = 'none'; 839 840 } 841 </script>"; 842 843 return $text; 844 } 845 846 847 848 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |