member_id == '') { $_SESSION['original_area']="messages"; header("Location:../signin/signin.php"); die(); } //end $LIST_HEIGHT = $PAGE_COUNT * 20 + 50; $folder = $_GET['folder']; $page = $_GET['page']; $message_id = $_GET['message_id']; $err_id = $_GET['err_id']; $order = $_GET['order']; $order_var = $_GET['order_var']; if ($order=='') $order = "DESC"; switch ($order_var) { case 'sender': $order_clause = 'ORDER BY from_name '.$order; break; case 'subject': $order_clause = 'ORDER BY message_subject '.$order; break; case 'message_date': $order_clause = 'ORDER BY message_date '.$order; break; default: $order_clause = 'ORDER BY message_date '.$order; break; } //error messages switch ($err_id) { case 1: $err_msg = 'You may not create folders named "Inbox" or "Sent".'; break; case 2: $err_msg = "You have allready created a folder with that name."; break; case 3: $err_msg = "You may not delete the Inbox and Sent directories."; break; } //if folder is not set, default is inbox if ($folder=='') $folder = "0"; //if page is not set, default to 1 if( $page=='' ) $page = 1; //set the styles for the selected folder $sender_label = "From"; if ($folder == "0") { $index_folder_class="details_link"; $index_bgcolor="#fae592"; $sent_bgcolor=$BG_COLOR1; } elseif ($folder == "sent") { $sent_folder_class="details_link"; $sent_bgcolor="#fae592"; $index_bgcolor=$BG_COLOR1; $index_folder_class="details_link"; $sender_label = "To"; } //other folder else { $index_folder_class="details_link"; $index_bgcolor=$BG_COLOR1; $sent_folder_class="details_link"; $sent_bgcolor=$BG_COLOR1; } //folder dispaly $query_folder_list = "SELECT folder_id, folder_name FROM m_folders WHERE user_id = ".$auth->member_id; $rs_folder_list = $conn->query($query_folder_list); //ready the folder select (values are id's and lables are folder names) $query_folder_list = "SELECT folder_id, folder_name FROM m_folders WHERE user_id = ".$auth->member_id." AND folder_id != '".$folder."'"; $rs_folder_list_select = $conn->query($query_folder_list); $folder_list_select = new CSelect($folder,$conn); //if folder is not inbox, there will be an option to move messages to inbox if ($folder!=0) { $inbox_move_option = ''; } // a message was selected - it will be displayed if($message_id!="") { if ($folder!='sent') { //Set status to read. $query = "UPDATE m_messages SET message_status=1 WHERE message_id = " . $message_id; $conn->query($query); } //Select the message, with member information $query = "SELECT A.*,UNIX_TIMESTAMP(message_date) AS date, B.username AS from_username, B.gold AS from_gold, C.username AS to_username, C.gold AS to_gold FROM m_messages AS A LEFT JOIN members AS B on A.from_id=B.id LEFT JOIN members as C on A.to_id=C.id WHERE A.message_id = " . $message_id; $rs = $conn->query($query); $row_curr_message = $conn->fetch_array($rs); $current_message_id = $row_curr_message[ "message_id" ]; $current_message_body = $row_curr_message[ "message_body" ]; $current_message_from = $row_curr_message[ "from_username" ]; $current_message_to = $row_curr_message[ "to_username" ]; $current_message_subject = $row_curr_message[ "message_subject" ]; $current_message_date = $row_curr_message[ "date" ]; // implementing abuse if ($folder=='sent') { $current_message_from_id = $row_curr_message['from_id']; $current_message_to_id = $row_curr_message['to_id']; } else { $current_message_to_id = $row_curr_message['from_id']; $current_message_from_id = $row_curr_message['to_id']; } //end abuse :D //ready the add to contacts link, if the member is not a contact if ( ($folder!='sent') && ($auth->member_id != $row_curr_message['from_id']) ) { $query = "SELECT * FROM m_contact_list WHERE user_id = ".$auth->member_id." AND cl_user_id=".$row_curr_message['from_id']; $rs_contacts = $conn->query($query); if ($conn->num_rows($rs_contacts)==0) { $add_contact_link = '  [add to contacts]'; } } } //get the total number of messages - paging needs this if( $folder == 'sent' ) { $query_count = "SELECT *, B.username AS from_name FROM m_messages AS A LEFT JOIN members AS B ON A.to_id = B.id WHERE A.from_id_status = 0 AND A.from_id = ".$auth->member_id; } else { $query_count = "SELECT *, B.username AS from_name, B.username AS to_name FROM m_messages AS A LEFT JOIN members AS B ON A.from_id = B.id LEFT JOIN members AS C ON A.to_id=C.id WHERE A.to_id_status=0 AND A.to_id = ".$auth->member_id." AND A.folder_id = ".$folder; } $rs = $conn->query($query_count); $total_messages = $conn->num_rows($rs); if ($total_message!=0) { $LIST_HEIGHT = 30*$total_messages; } else { $LIST_HEIGHT = 60; } // label for the selected message, if any if($auth->member_type == '1') { $message_label = 'No message is selected. Click on the subject to select one.
'; $gold_label = 'You can reply to this message'; } else { $gold_label = 'This message was sent by a gold member'; if($message_id!='') { $message_label = ' You may only view and reply to messages sent to you by gold members. Please upgrade to a paid subscription in order to view all messages and send messages of your own.
'; } else { $message_label = ' You may only view and reply to messages sent to you by gold members. Please upgrade to a paid subscription in order to view all messages and send messages of your own.
'; } } //shows the reply button if memember is gold or message is from gold member if ( ($row_curr_message['from_gold']==1) || ($auth->member_type==1) ) { $show_reply_button = 1; } ?>

In this section you can send and receive messages, organize them into folders and erase them if no longer needed in a similar way a normal email client works.

num_rows($rs_folder_list))!=0 ) { while( $row_folder_list = $conn->fetch_array($rs_folder_list) ) { if($folder == $row_folder_list["folder_id"]) { $bgcolor="#fae592"; $folder_class="details_link"; } else { //$bgcolor="#FFFFFF"; $folder_class="details_link"; } ?>
Folders
Inbox Inbox
Inbox Sent
  ">">



Add Folder



Delete
Delete current folder?
member_id . " and A.from_id_status=0 ".$order_clause." limit " . (($page*$PAGE_COUNT) - $PAGE_COUNT) . "," . ($PAGE_COUNT); } else { $sql_messages = " SELECT *,UNIX_TIMESTAMP(message_date) as date, B.username as from_name, B.username as to_name, B.gold AS from_gold FROM m_messages as A LEFT JOIN members as B on A.from_id = B.id LEFT join members as C on A.to_id=C.id where A.to_id =" . $auth->member_id . " and A.to_id_status=0 and A.folder_id = " . $folder . " ".$order_clause." limit " . (($page*$PAGE_COUNT) - $PAGE_COUNT) . "," . ($PAGE_COUNT); } $rs = $conn->query($sql_messages); if($conn->num_rows($rs) == 0) { ?> fetch_array($rs)) { if( $message_id=='' && $row_messages["message_id"] == $message_id) { $bgcolor = "#FFCC99"; } else { if($i%2==0) { $bgcolor = "#FFFFFF"; } else { $bgcolor = "#ffffee"; } } ?>
   
Subject
Received
No messages in this folder
" name="message_id[]"> ":""?> ');"> "> 10) {$message_trail = "...";}else{$message_trail = "";} ?>
with selection: Delete move to
%keyword%", $page, $PAGE_COUNT, $total_messages); ?> member_type == '1') || ($folder!='sent' && $row_curr_message['from_gold']==1) || ($folder=='sent' && $row_curr_message['to_gold']==1) ) { ?>
 
From:
On:
Subject:
Body:

 
query($q); echo mysql_affected_rows($res); } ?>

Disclaimer and Reminder: Remember through the site you can get in touch with other members, while keeping your personal real world details confidential (e.g. your phone number / email ). So please remember Your name or email will never be revealed by the site to other members unless you choose to do so yourself in your messages, or without your prior consent, or unless required to by Law or other official bodies. So please take care only to give personal information once you've used your common sense and judgement. If you do have any bad experiences let us know and we'll investigate and if necessary block/remove the offending members. We recommend never giving out any financial information and always waiting until you know and trust people before giving out any personal information. Please follow normal common sense, and if you have any concerns get support and guidance from people you trust, or you can contact us.