Jump to content

Recommended Posts

I am having a time trying to figure out how to correct this. I am testing the emailing to one person then replying but the replies go to the person replying and not the original person. In the db it shows as going from_id to to_id but it is the same number ie 2 in both. But the original ones start out with the correct from_id = 1 and to_id = 2

 

Here is the script for the inbox

[sCRIPT]

function toggleChecks(field) {

if (document.myform.toggleAll.checked == true){

  for (i = 0; i < field.length; i++) {

              field.checked = true;

  }

} else {

  for (i = 0; i < field.length; i++) {

              field.checked = false;

  }

}

 

}

$(document).ready(function() {

$(".toggle").click(function () {

  if ($(this).next().is(":hidden")) {

$(".hiddenDiv").hide();

    $(this).next().slideDown("fast");

  } else {

    $(this).next().hide();

  }

});

});

function markAsRead(msgID) {

$.post("scripts_for_profile/markAsRead.php",{ messageid:msgID, ownerid:<?php echo $_SESSION['SESS_ID']; ?> } ,function(data) {

$('#subj_line_'+msgID).addClass('msgRead');

      // alert(data); // This line was just for testing returned data from the PHP file, it is not required for marking messages as read

  });

}

function toggleReplyBox(subject,sendername,senderid,recName,recID) {

$("#sendernameShow").text(sendername);

$("#subjectShow").text(subject);

$("#recipientShow").text(recName);

document.replyForm.pmSubject.value = subject;

document.replyForm.pm_sender_name.value = sendername;

//document.replyForm.pmWipit.value = replyWipit;

document.replyForm.pm_sender_id.value = senderid;

document.replyForm.pm_rec_name.value = recName;

document.replyForm.pm_rec_id.value = recID;

    document.replyForm.replyBtn.value = "Send reply to "+recName;

    if ($('#replyBox').is(":hidden")) {

  $('#replyBox').fadeIn(1000);

    } else {

  $('#replyBox').hide();

    }     

}

function processReply () {

 

  var pmSubject = $("#pmSubject");

  var pmTextArea = $("#pmTextArea");

  var sendername = $("#pm_sender_name");

  var senderid = $("#pm_sender_id");

  var recName = $("#pm_rec_name");

  var recID = $("#pm_rec_id");

//var pm_wipit = $("#pmWipit");

  var url = "scripts_for_profile/private_msg_parse.php";

      if (pmTextArea.val() == "") {

  $("#PMStatus").text("Please type in your message.").show().fadeOut(6000);

      } else {

  $("#pmFormProcessGif").show();

  $.post(url,{ subject: pmSubject.val(), message: pmTextArea.val(), senderName: sendername.val(), senderID: senderid.val(), rcpntName: recName.val(), rcpntID: recID.val() } ,  function(data) {

  document.replyForm.pmTextArea.value = "";

  $("#pmFormProcessGif").hide();

  $('#replyBox').slideUp("fast");

  $("#PMFinal").html("   "+data).show().fadeOut(8000);

          }); 

  }

}

[/sCRIPT]

 

PHP for the inbox

if (isset($_POST['deleteBtn'])) {
    foreach ($_POST as $key => $value) {
        $value = urlencode(stripslashes($value));
	if ($key != "deleteBtn") {
	   $sql = mysql_query("UPDATE private_messages SET recipientDelete='1', opened='1' WHERE id='$value' AND to_id='".$_SESSION['SESS_ID']."' LIMIT 1");
	   // Check to see if sender also removed from sent box, then it is safe to remove completely from system
	}
    }
header("location: pm_inbox.php");
}

 

 

Code for the outbox

if (isset($_POST['deleteBtn'])) {
    foreach ($_POST as $key => $value) {
        $value = urlencode(stripslashes($value));
	if ($key != "deleteBtn") {
	   $sql = mysql_query("UPDATE private_messages SET senderDelete='1' WHERE id='$value' AND from_id='".$_SESSION['SESS_ID']."' LIMIT 1");
	   // Check to see if sender also removed from sent box, then it is safe to remove completely from system
	}
    }
header("location: pm_sentbox.php");
}

 

 

Script for sentbox

[sCRIPT]

function toggleChecks(field) {

if (document.myform.toggleAll.checked == true){

  for (i = 0; i < field.length; i++) {

              field.checked = true;

  }

} else {

  for (i = 0; i < field.length; i++) {

              field.checked = false;

  }

}

 

}

$(document).ready(function() {

$(".toggle").click(function () {

  if ($(this).next().is(":hidden")) {

$(".hiddenDiv").hide();

    $(this).next().slideDown("fast");

  } else {

    $(this).next().hide();

  }

});

});

</script>

<style type="text/css">

.hiddenDiv{display:none}

#pmFormProcessGif{display:none}

.msgDefault {font-weight:bold;}

.msgRead {font-weight:100;color:#666;}

[/sCRIPT]

 

:-\

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.