Example #1
0
 if ($proceed == true) {
     $sql = "INSERT into messages (from_username, subject, message, todays_date, to_id) VALUES ('{$user_name}', '{$subject}', '{$message}', NOW(), {$to_id})";
     @mysql_query($sql);
     // record a copy in sent items box
     $sql = "INSERT into messages_sent (to_username, subject, message, todays_date, from_id) VALUES ('{$member_username}', '{$subject}', '{$message}', NOW(), {$user_id})";
     @mysql_query($sql);
     //Check for errors
     if (@mysql_error()) {
         $blk_notification = 1;
         $message_type = $config['word_error'];
         $error_message = $config['error_26'];
         unset($_SESSION['update_token']);
         $_SESSION['update_token'] = '';
     } else {
         // check if receipients allow notifications if yes , send them a notification that they have an message
         if (notification_preferences($to_id, 'privatemessage') == true) {
             // send pm notification email to recipients registartion email addy
             $email_template = 'email_templates/newmessage.htm';
             $subject = $config['email_new_email'];
             // at this point we do not have any email to send to
             $to = $members_email;
             $from = $config['notifications_from_email'];
             //send email template to TBS for rendering of variable inside
             $template = $email_template;
             $inner_template1 = "themes/{$user_theme}/templates/inner_email_compose.htm";
             $TBS = new clsTinyButStrong();
             $TBS->NoErr = true;
             $TBS->LoadTemplate("{$template}");
             $TBS->tbs_show(TBS_NOTHING);
             $message = $TBS->Source;
             //load postage.php
Example #2
0
$friends_email = $result['email_address'];
$friends_username = $result['user_name'];
if (@mysql_num_rows($query) < 0) {
    ErrorDisplay1($config['error_2']);
    //user could not be found or is not active ...
    die;
}
//Everything Good sofar - Invite member
////////////////////////////////////////
$invite_id = randomcode();
$sql = "INSERT INTO friends (user_id, invitation_id, friends_id, invitation_type, blocked_users, invitation_status, my_username, friends_username, todays_date) VALUES ({$user_id}, '{$invite_id}', {$member_id}, 'online', 'no', 'pending', '{$user_name}', '{$friends_username}', NOW())";
@mysql_query($sql);
//Send Invitee an email
///////////////////////
// check users notification setting and send system notification
if (notification_preferences($member_id, "friendsinvite") == true) {
    //get my real name for use in email
    ///////////////////////////////////
    $sql_1 = "SELECT * FROM member_profile WHERE user_id = {$user_id}";
    $result_1 = @mysql_fetch_array(@mysql_query($sql_1));
    $my_real_name = $result_1['first_name'];
    //if the member has not yet updated their profile to show real name then use their username and email instead
    if ($my_real_name == "") {
        $my_real_name = $user_name . ' (' . $result_1['email_address'] . ')';
        //this will create something like: inmotion (me@gmail.com)
    }
    //send email --------resuable------------------------------------->>
    //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    $email_template = 'email_templates/invitemessage_internal.htm';
    $subject = $config['invite_email_subject'];
    $to = $friends_email;