home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 May / INTERNET103.ISO / pc / software / windows / building / php_nuke / html / modules / webmail / compose.php < prev    next >
Encoding:
PHP Script  |  2002-09-16  |  4.9 KB  |  127 lines

  1. <?php
  2.  
  3. /*************************************************************************/
  4.  #  Mailbox 0.9.2a   by Sivaprasad R.L (http://netlogger.net)             #
  5.  #  eMailBox 0.9.3   by Don Grabowski  (http://ecomjunk.com)              #
  6.  #          --  A pop3 client addon for phpnuked websites --              #
  7.  #                                                                        #
  8.  # This program is distributed in the hope that it will be useful,        #
  9.  # but WITHOUT ANY WARRANTY; without even the implied warranty of         #
  10.  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          #
  11.  # GNU General Public License for more details.                           #
  12.  #                                                                        #
  13.  # You should have received a copy of the GNU General Public License      #
  14.  # along with this program; if not, write to the Free Software            #
  15.  # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.              #
  16.  #                                                                        #
  17.  #             Copyright (C) by Sivaprasad R.L                            #
  18.  #            Script completed by Ecomjunk.com 2001                       #
  19. /*************************************************************************/
  20.  
  21. if (!eregi("modules.php", $PHP_SELF)) {
  22.     die ("You can't access this file directly...");
  23. }
  24.  
  25. require_once("mainfile.php");
  26. $module_name = basename(dirname(__FILE__));
  27. get_lang($module_name);
  28.  
  29. if ($email_send == 1) {
  30.  
  31. if(!isset($user)) {
  32.     Header("Location: modules.php?name=Your_Account");
  33.     exit();
  34. }
  35. $user2 = base64_decode($user);
  36. $userdata = explode(":", $user2);
  37. $userid = $userdata[0];
  38. $numrows = sql_num_rows(sql_query("select * from ".$prefix."_popsettings where uid='$userid'", $dbi), $dbi);
  39. if ($numrows == 0 OR $numrows == "") {
  40.     Header("Location: modules.php?name=$module_name");
  41. }
  42.  
  43. $pagetitle = "- "._COMPOSEEMAIL."";
  44.  
  45. include ("header.php");
  46. include ("modules/$module_name/mailheader.php");
  47. $body = stripslashes($body);
  48. $to = stripslashes($to);
  49. $subject = stripslashes($subject);
  50.  
  51. if(isset($op)) {
  52.     if($op == "reply") $subject = "Re: ".$subject;
  53.     else if($op == "forward") $subject = "Fwd: ".$subject;
  54.     if (eregi($body,"<br>",$out)) {
  55.     $bodytext = explode("<br>",$body);
  56.         foreach($bodytext as $bt) {
  57.         $content .= "> ".$bt;
  58.         }
  59.     } else {
  60.         $bodytext = explode("\n",$body);
  61.         foreach($bodytext as $bt) {
  62.             $content .= "> ".$bt."\n";
  63.         }
  64.     }
  65. }
  66.  
  67. title(""._COMPOSEEMAIL."");
  68. OpenTable();
  69.  
  70. if (ini_get(file_uploads) AND $attachments == 1) {
  71.     echo "<script language=\"javascript\">\n"
  72.     ."function open_w(file) {\n"
  73.     ."    newwin = window.open(file,'Attachments','width=450, height=250, scrollbars=no, toolbar=no');\n"
  74.     ."}\n"
  75.     ."\n"
  76.     ."function attachfiles(files,types) {\n"
  77.     ."    window.document.all.Atts.innerText = files;\n"
  78.     ."    document.emailform.attachment.value = files;\n"
  79.     ."    document.emailform.attchtype.value = types;\n"
  80.     ."}\n"
  81.     ."</script>\n";
  82. }
  83.  
  84. echo "<b>"._SENDANEMAIL."</b><br><br>"
  85.     ."<form method=\"post\" action=\"modules.php?name=$module_name&file=nlmail\" name=\"emailform\">"
  86.     ."<table align=\"center\" width=\"98%\">"
  87.     ."<tr><td>"._TO.":</td><td width=100%><input type=text name=\"to\" size=47 value='$to'></td></tr>"
  88.     ."<tr><td> </td><td><font class=\"tiny\"><i>"._SEPARATEEMAILS."</i></font></td></tr>"
  89.     ."<tr><td>"._SUBJECT.":</td><td><input type=text name=\"subject\" size=47 value='$subject'></td></tr>"
  90.     ."<tr><td><i>Cc:</i></td><td><input type=text name=\"cc\" size=20>  <i>Bcc:</i> <input type=text name=\"bcc\" size=19></td></tr>"
  91.     ."<tr><td>"._PRIORITY.":</td><td><select name=\"prior\">"
  92.     ."<option value=\"1\">"._HIGH."</option>"
  93.     ."<option value=\"3\" selected>"._NORMAL."</option>"
  94.     ."<option value=\"4\">"._LOW."</option>"
  95.     ."</select>"
  96.     ."</td>"
  97.     ."</tr>"
  98.     ."<tr><td><br>"._MESSAGE.":</td></tr>"
  99.     ."<tr><td colspan=\"2\">"
  100.     ."<textarea name=\"message\" rows=\"15\" cols=\"70\" wrap=\"virtual\">$content</textarea>"
  101.     ."</td></tr>";
  102.  
  103. if (ini_get(file_uploads) AND $attachments == 1) {
  104.     echo "<tr><td colspan=2>";
  105.     OpenTable();
  106.     echo ""._ATTACHMENTS.": <span style=\"background-color:#ffffcc\" id=\"Atts\">"._NONE."</span>  <br><br><a href=\"javascript: open_w('modules/$module_name/mailattach.php')\">"._CLICKTOATTACH."</a><br>";
  107.     CloseTable();
  108. }
  109.  
  110. echo "<tr><td colspan=\"2\">"
  111.     ."<input type=\"submit\" name=\"send\" value=\""._SENDMESSAGE."\">  <input type=\"reset\" value=\""._CLEARALL."\">"
  112.     ."</td></tr>"
  113.     ."</table>"
  114.     ."</center>"
  115.     ."<input type=hidden name=\"attachment\">"
  116.     ."<input type=hidden name=\"attchtype\">"
  117.     ."</form>";
  118.  
  119. Closetable();
  120. include ("modules/$module_name/mailfooter.php");
  121.  
  122. } else {
  123.     Header("Location: modules.php?name=$module_name");
  124.     exit();
  125. }
  126.  
  127. ?>