31 $args =
new stdClass();
34 if(!in_array(
$args->allow_message, array(
'Y',
'N',
'F')))
36 $args->allow_message =
'Y';
67 return new BaseObject(-1,
'msg_not_exists_member');
73 return new BaseObject(-1,
'msg_title_is_null');
79 return new BaseObject(-1,
'msg_content_is_null');
90 $oCommunicationModel =
getModel(
'communication');
91 $config = $oCommunicationModel->getConfig();
93 if(!$oCommunicationModel->checkGrant($config->grant_write))
95 return new BaseObject(-1,
'msg_not_permitted');
98 $receiver_member_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl);
99 if($receiver_member_info->member_srl != $receiver_srl)
101 return new BaseObject(-1,
'msg_not_exists_member');
107 if($receiver_member_info->allow_message ==
'F')
109 if(!$oCommunicationModel->isFriend($receiver_member_info->member_srl))
111 return new BaseObject(-1,
'msg_allow_message_to_friend');
114 else if($receiver_member_info->allow_message ==
'N')
116 return new BaseObject(-1,
'msg_disallow_message');
128 $message_srl =
$output->get(
'message_srl');
131 if($send_mail ==
'Y')
134 $content = sprintf(
"%s<br /><br />From : <a href=\"%s\" target=\"_blank\">%s</a>", $content, $view_url, $view_url);
136 $oMail->setTitle(htmlspecialchars($title, ENT_COMPAT | ENT_HTML401,
'UTF-8',
false));
139 $oMail->setReceiptor($receiver_member_info->nick_name, $receiver_member_info->email_address);
175 function sendMessage($sender_srl, $receiver_srl, $title, $content, $sender_log = TRUE)
178 $title = htmlspecialchars($title, ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
184 $sender_args =
new stdClass();
185 $sender_args->sender_srl = $sender_srl;
186 $sender_args->receiver_srl = $receiver_srl;
187 $sender_args->message_type =
'S';
188 $sender_args->title = $title;
189 $sender_args->content = $content;
190 $sender_args->readed =
'N';
191 $sender_args->regdate = date(
"YmdHis");
192 $sender_args->message_srl = $message_srl;
193 $sender_args->related_srl = $related_srl;
194 $sender_args->list_order = $sender_args->message_srl * -1;
197 $receiver_args =
new stdClass();
198 $receiver_args->message_srl = $related_srl;
199 $receiver_args->related_srl = 0;
200 $receiver_args->list_order = $related_srl * -1;
201 $receiver_args->sender_srl = $sender_srl;
202 if(!$receiver_args->sender_srl)
204 $receiver_args->sender_srl = $receiver_srl;
206 $receiver_args->receiver_srl = $receiver_srl;
207 $receiver_args->message_type =
'R';
208 $receiver_args->title = $title;
209 $receiver_args->content = $content;
210 $receiver_args->readed =
'N';
211 $receiver_args->regdate = date(
"YmdHis");
214 $trigger_obj =
new stdClass();
215 $trigger_obj->sender_srl = $sender_srl;
216 $trigger_obj->receiver_srl = $receiver_srl;
217 $trigger_obj->message_srl = $message_srl;
218 $trigger_obj->related_srl = $related_srl;
219 $trigger_obj->title = $title;
220 $trigger_obj->content = $content;
221 $trigger_obj->sender_log = $sender_log;
223 if(!$triggerOutput->toBool())
225 return $triggerOutput;
232 if($sender_srl && $sender_log)
252 if(!$trigger_output->toBool())
255 return $trigger_output;
259 $flag_path =
'./files/member_extra_info/new_message_flags/' .
getNumberingPath($receiver_srl);
261 $flag_file = sprintf(
'%s%s', $flag_path, $receiver_srl);
267 $result =
new BaseObject(0,
'success_sended');
268 $result->add(
'message_srl', $message_srl);
290 return new BaseObject(-1,
'msg_invalid_request');
294 $oCommunicationModel =
getModel(
'communication');
295 $message = $oCommunicationModel->getSelectedMessage($message_srl);
298 return new BaseObject(-1,
'msg_invalid_request');
301 $args =
new stdClass();
302 $args->message_srl = $message_srl;
332 return new BaseObject(-1,
'msg_invalid_request');
336 $oCommunicationModel =
getModel(
'communication');
337 $message = $oCommunicationModel->getSelectedMessage($message_srl);
340 return new BaseObject(-1,
'msg_invalid_request');
347 if(
$message->sender_srl != $member_srl)
349 return new BaseObject(-1,
'msg_invalid_request');
354 if(
$message->receiver_srl != $member_srl)
356 return new BaseObject(-1,
'msg_invalid_request');
362 $args =
new stdClass();
363 $args->message_srl = $message_srl;
391 return new BaseObject(-1,
'msg_cart_is_null');
395 if(!is_array($message_srl_list))
397 $message_srl_list = explode(
'|@|', trim($message_srl_list));
400 if(!count($message_srl_list))
402 return new BaseObject(-1,
'msg_cart_is_null');
406 if(!$message_type || !in_array($message_type, array(
'R',
'S',
'T')))
408 return new BaseObject(-1,
'msg_invalid_request');
411 $message_count = count($message_srl_list);
413 for($i = 0; $i < $message_count; $i++)
415 $message_srl = (int) trim($message_srl_list[$i]);
421 $target[] = $message_srl;
425 return new BaseObject(-1,
'msg_cart_is_null');
429 $args =
new stdClass();
430 $args->message_srls = implode(
',', $target);
431 $args->message_type = $message_type;
433 if($message_type ==
'S')
435 $args->sender_srl = $member_srl;
439 $args->receiver_srl = $member_srl;
471 return new BaseObject(-1,
'msg_invalid_request');
475 $args =
new stdClass();
480 $args->target_srl = $target_srl;
487 $this->
add(
'member_srl', $target_srl);
518 if(!$friend_srl_list)
520 return new BaseObject(-1,
'msg_cart_is_null');
523 if(!is_array($friend_srl_list))
525 $friend_srl_list = explode(
'|@|', $friend_srl_list);
528 if(!count($friend_srl_list))
530 return new BaseObject(-1,
'msg_cart_is_null');
533 $friend_count = count($friend_srl_list);
535 for($i = 0; $i < $friend_count; $i++)
537 $friend_srl = (int) trim($friend_srl_list[$i]);
543 $target[] = $friend_srl;
548 return new BaseObject(-1,
'msg_cart_is_null');
552 $args =
new stdClass();
553 $args->friend_srls = implode(
',', $target);
587 if(!is_array($friend_srl_list))
589 $friend_srl_list = explode(
'|@|', $friend_srl_list);
592 if(!count($friend_srl_list))
594 return new BaseObject(-1,
'msg_cart_is_null');
597 $friend_count = count($friend_srl_list);
600 for($i = 0; $i < $friend_count; $i++)
602 $friend_srl = (int) trim($friend_srl_list[$i]);
608 $target[] = $friend_srl;
613 return new BaseObject(-1,
'msg_cart_is_null');
617 $args =
new stdClass();
618 $args->friend_srls = implode(
',', $target);
647 $args =
new stdClass();
651 $args->title = htmlspecialchars(
$args->title, ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
655 return new BaseObject(-1,
'msg_invalid_request');
659 if(
$args->friend_group_srl)
662 $msg_code =
'success_updated';
668 $msg_code =
'success_registed';
723 $args =
new stdClass();
727 $args->title = htmlspecialchars(
$args->title, ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
731 return new BaseObject(-1,
'msg_invalid_request');
758 $args =
new stdClass();
777 $args =
new stdClass();
778 $args->message_srl = $message_srl;
779 $args->related_srl = $message_srl;
setMessage($message= 'success', $type=NULL)
getNumberingPath($no, $size=3)
procCommunicationSendMessage()
writeFile($filename, $buff, $mode="w")
setMessageReaded($message_srl)
procCommunicationDeleteMessages()
procCommunicationUpdateAllowMessage()
setRedirectUrl($url= './', $output=NULL)
procCommunicationDeleteFriendGroup()
getInstance($db_type=NULL)
procCommunicationAddFriendGroup()
procCommunicationMoveFriend()
procCommunicationStoreMessage()
getRequestUri($ssl_mode=FOLLOW_REQUEST_SSL, $domain=null)
procCommunicationDeleteFriend()
procCommunicationAddFriend()
executeQuery($query_id, $args=NULL, $arg_columns=NULL)
procCommunicationDeleteMessage()
procCommunicationRenameFriendGroup()
triggerCall($trigger_name, $called_position, &$obj)
sendMessage($sender_srl, $receiver_srl, $title, $content, $sender_log=TRUE)
if(isset($_REQUEST['encode'])) if(isset($_REQUEST['decode'])) $lang