Update of /cvsroot/openfirst/messenger
In directory sc8-pr-cvs1:/tmp/cvs-serv30400
Modified Files:
newmsg.php
Log Message:
Added mail notification via multipart() mail global function. Fixed previewing of current users online when no recipient is specified in query string.
Index: newmsg.php
===================================================================
RCS file: /cvsroot/openfirst/messenger/newmsg.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** newmsg.php 20 Aug 2003 14:29:11 -0000 1.5
--- newmsg.php 20 Aug 2003 16:00:30 -0000 1.6
***************
*** 45,48 ****
--- 45,59 ----
,'".time()."')") or die("INSERT ERROR: ".mysql_error());
+ // Get information about the receiver
+
+ $query = mysql_query("SELECT * FROM ofirst_members WHERE user = '".$_POST['recip']."'") or die(mysql_error());
+ $receiver = mysql_fetch_object($query);
+
+ // Send mail notification to use via multipart mail function
+
+ multipartmail($receiver->email,
+ "New message has arrived!" , $message = "Hello ".$receiver->firstname.", you have received a new message from ".$user->user.".
+ You may pickup your message by visiting: $home/$basepath/messenger/inbox.php. Thank you and have a nice day!");
+
echo("<br><br><br><center>Message has been sent! [ <a href='inbox.php'>Inbox</a> ]<br><br>");
die(include($footer));
***************
*** 62,81 ****
<td>
<?php
// Set the reply based on querystring or list members
if (ISSET($_GET['RECIP'])){
$query = mysql_query("SELECT * FROM ofirst_messenger_usersonline WHERE ID = '".$_GET['RECIP']."'");
$recipient = mysql_fetch_object($query);
! echo $recipient->Member;
echo "<input type='hidden' name='recip' value='".$recipient->Member."'>";
! }else{
! echo "<select name='recip'id='recip'>";
! $query = mysql_query("SELECT * FROM ofirst_messenger_usersonline");
while($recipient = mysql_fetch_object($query)){
! if(! $recipient->Member == "none"){
! echo "<option>".$recipient->Member."<option>";
! }
}
! echo "</select>";
}
?>
--- 73,99 ----
<td>
<?php
+
// Set the reply based on querystring or list members
if (ISSET($_GET['RECIP'])){
+
$query = mysql_query("SELECT * FROM ofirst_messenger_usersonline WHERE ID = '".$_GET['RECIP']."'");
$recipient = mysql_fetch_object($query);
!
echo "<input type='hidden' name='recip' value='".$recipient->Member."'>";
!
! }else{
!
! echo "<select name='recip' id='recip'>";
! $query = mysql_query("SELECT * FROM ofirst_messenger_usersonline");
! echo $recipient->Member;
!
while($recipient = mysql_fetch_object($query)){
! if($recipient->Member != "none"){
! echo "<option>".$recipient->Member."<option>";
! }
}
!
! echo "</select>";
}
?>
|