Changing webdate code
Posted: Sat Mar 27, 2004 12:47 am
I have a matching/dating site (using webDate software) that sends these "Virtual Kisses" to the member’s personal email. I want to change it so the "Virtual Kiss" just goes to the member’s internal inbox not to their personal email. Can anyone tell me how to change this script to do this? Thanks
send_vkiss.pml - page which just goes to members personal email:
Now the following script (page) is for sending messages, which sends the message to the member’s internal inbox and a "you have new mail" message to their personal email. Just though having this script would help find a solution.
send_message.pml - page:
send_vkiss.pml - page which just goes to members personal email:
Code: Select all
<?
if($profile_id == "")
{
include "templates/index.ihtml";
return;
}
$f_profile = f(q("SELECT id, name, status FROM dt_profile WHERE member_id='$fMember[id]'"));
$f_target_profile = f(q("SELECT member_id FROM dt_profile WHERE id='$profile_id'"));
$f_target_member = f(q("SELECT email FROM dt_members WHERE id='$f_target_profile[member_id]'"));
if($f_profile[ status ] != 1)
{
include "templates/vkiss_failed.ihtml";
}
else
{
$profile_name = $f_profile[ name ];
$profile_link = $root_host."index.php?page=view_profile&id=$f_profile[id]";
$profile_free_text = "";
$gm = f(q("select id from dt_members where member_id='$fMember[id]' and system_status='1' and system_status_end>='".strtotime(date("d M Y H:i:s"))."'"));
if($gm != "")
{
$profile_free_text = "You can contact this user for free!";
}
mailSend($f_target_member[ email ], "virtual_kiss");
include "templates/vkiss_success.ihtml";
}
?>send_message.pml - page:
Code: Select all
<?
if($action == send)
{
$fBlocked = f(q("SELECT id FROM dt_blocked WHERE member_id = '$rid' and blocked_id = '$fMember[id]'"));
if ($fBlocked[id] != "")
{
$errors_num++;
$errors_string .= "$errors_num. You have been blocked by this user!<br>\n";
}
if ($rid =="")
{
$errors_num++;
$errors_string .= "$errors_num. Please enter a recepient.<br>\n";
}
if ($subject =="")
{
$errors_num++;
$errors_string .= "$errors_num. Please enter a subject.<br>\n";
}
if ($message =="")
{
$errors_num++;
$errors_string .= "$errors_num. Please enter a message.<br>\n";
}
if ($errors_num)
{
$r_records = q("SELECT * FROM dt_address_book WHERE member_id='$fMember[id]'");
include "templates/send_message.ihtml";
}
else
{
q("INSERT INTO dt_messages (sid, rid, subject, message, timesent) VALUES (".$fMember[id].", $rid, '$subject', '$message', ".(strtotime(date("d M Y H:i:s"))).")");
include "templates/message_sent.ihtml";
$query = "select * from dt_members where id = '$rid'";
$user_info = f(q($query));
$login = $user_info["login"];
$generated_link = $root_host."index.php?page=sign_in";
mailSend($user_info["email"], "new_mail");
}
}
else
{
if(! $valid)
{
include "templates/cannot_contact.ihtml";
return;
}
if ($reply != "")
{
$r_records = q("SELECT * FROM dt_messages WHERE id=$reply");
}
elseif ($mid != "")
{
$f_record = f(q("SELECT * FROM dt_address_book WHERE (member_id='$fMember[id]' AND contact_profile_id = '$mid')"));
}
elseif ($pid != "")
{
$f_record = f(q("SELECT * FROM dt_address_book WHERE (member_id='$fMember[id]' AND contact_profile_id = '$pid')"));
}
else
{
$r_records = q("SELECT * FROM dt_address_book WHERE member_id='$fMember[id]'");
}
include "templates/send_message.ihtml";
}
?>