home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / akce / web / phpnuke / PHP-Nuke-7.5.exe / html / modules / Feedback / index.php
PHP Script  |  2004-01-29  |  5KB  |  112 lines

  1. <?php
  2.  
  3. /************************************************************************/
  4. /* PHP-NUKE: Web Portal System                                          */
  5. /* ===========================                                          */
  6. /*                                                                      */
  7. /* Copyright (c) 2002 by Francisco Burzi                                */
  8. /* http://phpnuke.org                                                   */
  9. /*                                                                      */
  10. /* Based on php Addon Feedback 1.0                                      */
  11. /* Copyright (c) 2001 by Jack Kozbial                                   */
  12. /* http://www.InternetIntl.com                                          */
  13. /* jack@internetintl.com                                                */
  14. /*                                                                      */
  15. /* This program is free software. You can redistribute it and/or modify */
  16. /* it under the terms of the GNU General Public License as published by */
  17. /* the Free Software Foundation; either version 2 of the License.       */
  18. /************************************************************************/
  19. /*         Additional security & Abstraction layer conversion           */
  20. /*                           2003 chatserv                              */
  21. /*      http://www.nukefixes.com -- http://www.nukeresources.com        */
  22. /************************************************************************/
  23.  
  24. if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
  25.     die ("You can't access this file directly...");
  26. }
  27.  
  28. require_once("mainfile.php");
  29. $module_name = basename(dirname(__FILE__));
  30. get_lang($module_name);
  31.  
  32. /**********************************/
  33. /* Configuration                  */
  34. /*                                */
  35. /* You can change this:           */
  36. /* $index = 0; (right side off)   */
  37. /**********************************/
  38. $index = 1;
  39. $subject = "$sitename "._FEEDBACK."";
  40. /**********************************/
  41.  
  42. include("header.php");
  43. $cookie[0] = intval($cookie[0]);
  44. if ($cookie[1] != "") {
  45.     $row = $db->sql_fetchrow($db->sql_query("SELECT name, username, user_email FROM ".$user_prefix."_users WHERE user_id='$cookie[0]'"));
  46.     if ($row['name'] != "") {
  47.     $sender_name = $row['name'];
  48.     } else {
  49.     $sender_name = $row['username'];
  50.     }
  51.     $sender_email = $row['user_email'];
  52. }
  53.  
  54. $form_block = "
  55.     <center><font class=\"title\"><b>$sitename: "._FEEDBACKTITLE."</b></font>
  56.     <br><br><font class=\"content\">"._FEEDBACKNOTE."</font>
  57.     <FORM METHOD=\"post\" ACTION=\"modules.php?name=$module_name\">
  58.     <P><strong>"._YOURNAME.":</strong><br>
  59.     <INPUT type=\"text\" NAME=\"sender_name\" VALUE=\"$sender_name\" SIZE=30></p>
  60.     <P><strong>"._YOUREMAIL.":</strong><br>
  61.     <INPUT type=\"text\" NAME=\"sender_email\" VALUE=\"$sender_email\" SIZE=30></p>
  62.     <P><strong>"._MESSAGE.":</strong><br>
  63.     <TEXTAREA NAME=\"message\" COLS=30 ROWS=5 WRAP=virtual>$message</TEXTAREA></p>
  64.     <INPUT type=\"hidden\" name=\"opi\" value=\"ds\">
  65.     <P><INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\""._SEND."\"></p>
  66.     </FORM></center>
  67. ";
  68.  
  69. OpenTable();
  70. if ($opi != "ds") {
  71.     echo "$form_block";
  72. } elseif ($opi == "ds") {
  73.     if ($sender_name == "") {
  74.     $name_err = "<center><font class=\"option\"><b><i>"._FBENTERNAME."</i></b></font></center><br>";
  75.     $send = "no";
  76.     } 
  77.     if ($sender_email == "") {
  78.     $email_err = "<center><font class=\"option\"><b><i>"._FBENTEREMAIL."</i></b></font></center><br>";
  79.     $send = "no";
  80.     } 
  81.     if ($message == "") {
  82.         $message_err = "<center><font class=\"option\"><b><i>"._FBENTERMESSAGE."</i></b></font></center><br>";
  83.     $send = "no";
  84.     } 
  85.     if ($send != "no") {
  86.     $sender_name = removecrlf($sender_name);
  87.     $sender_email = removecrlf($sender_email);
  88.     $msg = "$sitename\n\n";
  89.     $msg .= ""._SENDERNAME.": $sender_name\n";
  90.     $msg .= ""._SENDEREMAIL.": $sender_email\n";
  91.     $msg .= ""._MESSAGE.": $message\n\n";
  92.     $to = $adminmail;
  93.     $mailheaders = "From: $sender_name <$sender_email>\n";
  94.     $mailheaders .= "Reply-To: $sender_email\n\n";
  95.     mail($to, $subject, $msg, $mailheaders);
  96.     echo "<P><center>"._FBMAILSENT."</center></p>";
  97.     echo "<P><center>"._FBTHANKSFORCONTACT."</center></p>";
  98.     } elseif ($send == "no") {
  99.     OpenTable2();
  100.     echo "$name_err";
  101.     echo "$email_err";
  102.     echo "$message_err";
  103.     CloseTable2();
  104.     echo "<br><br>";
  105.     echo "$form_block";  
  106.     } 
  107. }
  108.  
  109. CloseTable();   
  110. include("footer.php");
  111.  
  112. ?>