[Openfirst-cvscommit] feedback index.php,1.18,1.19
Brought to you by:
xtimg
From: Tim G. <xt...@us...> - 2004-04-15 00:59:39
|
Update of /cvsroot/openfirst/feedback In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17825 Modified Files: index.php Log Message: Commit final changes to feedback module before release Index: index.php =================================================================== RCS file: /cvsroot/openfirst/feedback/index.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** index.php 9 Apr 2004 18:13:42 -0000 1.18 --- index.php 15 Apr 2004 00:59:30 -0000 1.19 *************** *** 1,126 **** ! <?php ! /* ! * openFIRST.feedback - index.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Tim Ginn <tim...@sy...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! include_once("../config/globals.php"); ! include_once($header); ! ! echo("<h1>Give Feedback</h1>"); ! ! // Get a list of the users able to be contacted via the feedback form. ! $query = ofirst_dbquery("SELECT * FROM ofirst_feedbackusers ORDER BY name;"); ! ! if (ofirst_dbnum_rows($query) != 0){ ! if(isset($_POST["to"]) == true) { ! $messageallowed = false; ! } else { ! ?> ! <form onsubmit="return dhtmlEditorPrepareSubmit();" method="post" action="index.php"> ! <table> ! <tr> ! <th> </th> ! <th>Feedback Form</th> ! </tr> ! <tr> ! <td>Message To:</td> ! <td><select name="to"> ! <?php ! } ! while($feedback = ofirst_dbfetch_object($query)){ ! if(! isset($_POST["to"])) { ! echo("<option value='$feedback->email'>$feedback->name</option>"); ! } else { ! if ($_POST["to"] == $feedback->email) { ! $messageallowed = true; ! } ! } ! } ! if(isset($_POST["to"]) == false) { ! ?> ! </select></td> ! </tr> ! <tr> ! <td>Your E-mail Address<br> ! <font size="1">(used for replies):</font></td> ! <td><input type="text" name="from" style="width: 150px;" value="<?php if(isset($user->email)){echo($user->email); } ?>" /></td> ! </tr> ! <tr> ! <td>Type of feedback: </td> ! <td> ! <?php ! if (function_exists("make_wysiwyg")) { ! if(isset($user->signature)){ $msg = "Insert your feedback here.<br>\n\n$user->signature"; }else{ $msg = "Insert your feedback here."; } ! make_wysiwyg("message",400,200,$msg); ! } else { ! ?> ! <textarea name="message" cols="40" rows="20">Insert your feedback here. ! <?php echo($user->signature); ?> ! </textarea> ! <?php } ?> ! <br> <input type="radio" name="type" value="comment" /> ! Comment ! <input type="radio" name="type" value="question" /> ! Question ! <input type="radio" name="type" value="concern" /> ! Concern </td> ! </tr> ! <tr> ! <td> </td> ! <td><input name="submit" type="submit" value="Send Feedback" /> <input name="reset" type="reset" value="Clear Feedback" /> ! </td> ! </tr> ! </table> ! <p> </p> ! </form> ! ! <?php ! } else { ! if ($messageallowed == true) { ! // Mail who they wish to contact. ! if (isset($user->user)) { $isuser = "registered user"; } else { $isuser = "unregistered user"; } ! if(! isset($_POST["type"])) { $_POST["type"] = "comment"; } ! if (function_exists("multipartmail")) { ! multipartmail($_POST["to"], "Feedback: $isuser " . $_POST["type"], $_POST["message"] ! . "\r\n\r\n--\r\nMessage generated by openFIRST.feedback. ! For more information about openFIRST, see: ! http://www.openfirst.org/","From: " . $_POST["from"] ."\r\nReply-To: ". $_POST["from"] ."\r\n"); ! } else { ! mail($_POST["to"], "Feedback: $isuser " . $_POST["type"], $_POST["message"] ! . "\r\n\r\n--\r\nMessage generated by openFIRST.feedback. For more information about openFIRST, see: ! http://www.openfirst.org/","From: " . $_POST["from"] ."\r\nReply-To: ". $_POST["from"] ."\r\n"); ! } ! // Inform user of message being sent. ! echo("Your message has been sent. You should receive it in the near future."); ! ! } else { ! // Give an error. ! echo("You cannot use the feedback form to contact that person as the administrator of this web site has not allowed it. If you believe you should be able to contact this person, contact the administrator asking them to change their settings."); ! } ! } ! } else { ! echo("Before you can use this, someone must first set up users able to be e-mailed by modifying the database."); ! } ! include_once($footer); ?> --- 1,122 ---- ! <?php ! /* ! * openFIRST.feedback - index.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Tim Ginn <tim...@sy...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! include_once("../config/globals.php"); ! include_once($header); ! ! echo("<h1>Give Feedback</h1>"); ! ! // Get a list of the users able to be contacted via the feedback form. ! $query = ofirst_dbquery("SELECT * FROM ofirst_feedbackusers ORDER BY name;"); ! ! if (ofirst_dbnum_rows($query) != 0){ ! if(isset($_POST["to"]) == true) { ! $messageallowed = false; ! } else { ! ?> ! <form onsubmit="return dhtmlEditorPrepareSubmit();" method="post" action="index.php"> ! <table> ! <tr> ! <th> </th> ! <th>Feedback Form</th> ! </tr> ! <tr> ! <td>Message To:</td> ! <td><select name="to"> ! <?php ! } ! while($feedback = ofirst_dbfetch_object($query)){ ! if(! isset($_POST["to"])) { ! echo("<option value='$feedback->email'>$feedback->name</option>"); ! } else { ! if ($_POST["to"] == $feedback->email) { ! $messageallowed = true; ! } ! } ! } ! if(isset($_POST["to"]) == false) { ! ?> ! </select></td> ! </tr> ! <tr> ! <td>Your E-mail Address<br> ! <font size="1">(used for replies):</font></td> ! <td><input type="text" name="from" style="width: 150px;" value="<?php if(isset($user->email)){echo($user->email); } ?>" /></td> ! </tr> ! <tr> ! <td>Type of feedback: </td> ! <td> ! <?php ! if (function_exists("make_wysiwyg")) { ! if(isset($user->signature)){ $msg = "Insert your feedback here.<br>\n\n$user->signature"; }else{ $msg = "Insert your feedback here."; } ! make_wysiwyg("message",400,200,$msg); ! } else { ! ?> ! <textarea name="message" cols="40" rows="20">Insert your feedback here. ! <?php echo($user->signature); ?> ! </textarea> ! <?php } ?> ! <br> <input type="radio" name="type" value="comment" /> ! Comment ! <input type="radio" name="type" value="question" /> ! Question ! <input type="radio" name="type" value="concern" /> ! Concern </td> ! </tr> ! <tr> ! <td> </td> ! <td><input name="submit" type="submit" value="Send Feedback" /> <input name="reset" type="reset" value="Clear Feedback" /> ! </td> ! </tr> ! </table> ! <p> </p> ! </form> ! ! <?php ! } else { ! if ($messageallowed == true) { ! // Mail who they wish to contact. ! if (isset($user->user)) { $isuser = "registered user"; } else { $isuser = "unregistered user"; } ! if(! isset($_POST["type"])) { $_POST["type"] = "comment"; } ! if (function_exists("multipartmail")) { ! multipartmail($_POST["to"], "Feedback: $isuser " . $_POST["type"], $_POST["message"] ! . "\r\n\r\n--\r\nMessage generated by openFIRST.feedback. ! For more information about openFIRST, see: ! http://www.openfirst.org/","From: " . $_POST["from"] ."\r\nReply-To: ". $_POST["from"] ."\r\n"); ! } else { ! mail($_POST["to"], "Feedback: $isuser " . $_POST["type"], $_POST["message"] ! . "\r\n\r\n--\r\nMessage generated by openFIRST.feedback. For more information about openFIRST, see: ! http://www.openfirst.org/","From: " . $_POST["from"] ."\r\nReply-To: ". $_POST["from"] ."\r\n"); ! } ! // Inform user of message being sent. ! echo("Your message has been sent. You should receive it in the near future."); ! ! } else { ! // Give an error. ! echo("You cannot use the feedback form to contact that person as the administrator of this web site has not allowed it. If you believe you should be able to contact this person, contact the administrator asking them to change their settings."); ! } ! } ! } else { ! echo("Before you can use this, someone must first set up users able to be e-mailed by modifying the database."); ! } ! include_once($footer); ?> |