". $check_res[CHECK_ACTION_MESSAGE] ." \n"; return $ret; } $action_result = ""; // Check if recipient found if( !$recipient ) { $_page['header_text'] = _t("_Send virtual kiss3"); $ret = "
 
\n"; return $ret; } // Perform sending $send_result = MemberSendVKiss( $member, $recipient ); switch ( $send_result ) { case 1: $action_result .= _t_err( "_VKISS_BAD" ); break; case 7: $action_result .= _t_err( "_VKISS_BAD_COUSE_B" ); break; case 10: $action_result .= _t_err( "_VKISS_BAD_COUSE_C" ); break; case 13: $action_result .= _t_err( "_VKISS_BAD_COUSE_A3" ); break; case 23: $action_result .= _t_err( "_VKISS_BAD_COUSE_X" ); break; case 24: $action_result .= _t_err( "_VKISS_BAD_COUSE_Y" ); break; default: $action_result .= _t( "_VKISS_OK" ); break; } if ( $send_result == 0 ) $_page['header_text'] = _t("_Send virtual kiss2"); else $_page['header_text'] = _t("_Send virtual kiss3"); $ret = "
{$action_result}
\n"; return DesignBoxContent( _t("_Send virtual kiss"), $ret, $oTemplConfig -> PageVkiss_db_num ); } /** * Send virtual kiss */ function MemberSendVKiss( $member, $recipient ) { global $site; global $logged; // Check if recipient is active if( 'Active' != $recipient['Status'] ) { return 7; } // block members if ( db_arr( "SELECT `ID`, `Profile` FROM `BlockList` WHERE `ID` = {$recipient['ID']} AND `Profile` = {$member['ID']}", 0 ) ) { return 24; } // Get sender info $sender = getProfileInfo( $member['ID'] ); //db_arr( "SELECT `NickName` FROM `Profiles` WHERE `ID` = {$member['ID']}" ); // Send email notification $message = $logged['member'] ? getParam( "t_VKiss" ) : getParam( "t_VKiss_visitor" ); $subject = getParam('t_VKiss_subject'); $ConfCode = urlencode( base64_encode( base64_encode( crypt( $recipient['ID'], "vkiss_secret_string" ) ) ) ); $aPlus = array(); $aPlus['ConfCode'] = $ConfCode; $aPlus['ProfileReference'] = $sender ? '' . $sender['NickName'] . ' (' . getProfileLink($member['ID']) . ') ' : '' . _t("_Visitor") . ''; $aPlus['VKissLink'] = $sender ? '' . $site['url'] . 'greet.php?sendto=' . $member['ID'] . '&from=' . $recipient['ID'] . '&ConfCode=' . $ConfCode . '' : '' . $site['url'] . 'contacts.php'; $mail_ret = sendMail( $recipient['Email'], $subject, $message, $recipient['ID'], $aPlus ); if ( !$mail_ret ) { return 10; } // Insert kiss into database $kiss_arr = db_arr( "SELECT `ID` FROM `VKisses` WHERE `ID` = {$member['ID']} AND `Member` = {$recipient['ID']} LIMIT 1", 0 ); if ( !$kiss_arr ) $result = db_res( "INSERT INTO `VKisses` ( `ID`, `Member`, `Number`, `Arrived`, `New` ) VALUES ( {$member['ID']}, {$recipient['ID']}, 1, NOW(), '1' )", 0 ); else $result = db_res( "UPDATE `VKisses` SET `Number` = `Number` + 1, `New` = '1' WHERE `ID` = {$member['ID']} AND `Member` = {$recipient['ID']}", 0 ); // If success then perform actions if ( $result ) checkAction( $member['ID'], ACTION_ID_SEND_VKISS, true ); else return 1; return 0; } ?>