From 29044a98bf95923d547237b4247b7eb37ddadbcd Mon Sep 17 00:00:00 2001 From: qw5414 Date: Sat, 13 Feb 2016 09:28:07 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BB=A4=EB=AE=A4=EB=8B=88=EC=BC=80=EC=9D=B4?= =?UTF-8?q?=EC=85=98=20=EB=A7=B4=EB=B2=84=20=EB=AA=A8=EB=93=88=EC=9D=84=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=ED=95=98=EA=B3=A0,=20=EC=BB=A4=EB=AE=A4?= =?UTF-8?q?=EB=8B=88=EC=BC=80=EC=9D=B4=EC=85=98=20=EB=AA=A8=EB=93=88?= =?UTF-8?q?=EC=9D=84=20=EC=83=9D=EC=84=B1=20(=EA=B8=B0=EB=B3=B8=EA=B0=92?= =?UTF-8?q?=20=EC=82=AC=EC=9A=A9=ED=95=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/member_communication/conf/info.xml | 94 ------------------- addons/member_communication/lang/en.php | 2 - addons/member_communication/lang/es.php | 2 - addons/member_communication/lang/ja.php | 2 - addons/member_communication/lang/ko.php | 2 - addons/member_communication/lang/ru.php | 2 - addons/member_communication/lang/vi.php | 2 - addons/member_communication/lang/zh-CN.php | 2 - addons/member_communication/lang/zh-TW.php | 2 - .../member_communication.addon.php | 85 ----------------- .../tpl/member_communication.js | 26 ----- .../communication.admin.controller.php | 2 +- .../communication.admin.view.php | 1 - modules/communication/communication.class.php | 28 +++++- .../communication.controller.php | 72 +++++++++++++- modules/communication/communication.model.php | 25 ++++- modules/communication/lang/en.php | 1 + modules/communication/lang/es.php | 1 + modules/communication/lang/ja.php | 1 + modules/communication/lang/ko.php | 1 + modules/communication/lang/ru.php | 1 + modules/communication/lang/vi.php | 1 + modules/communication/lang/zh-CN.php | 1 + modules/communication/lang/zh-TW.php | 1 + .../queries/getNewMessageCount.xml | 15 +++ modules/communication/tpl/index.html | 7 +- .../tpl/js/member_communication.js | 26 +++++ 27 files changed, 176 insertions(+), 229 deletions(-) delete mode 100644 addons/member_communication/conf/info.xml delete mode 100644 addons/member_communication/lang/en.php delete mode 100644 addons/member_communication/lang/es.php delete mode 100644 addons/member_communication/lang/ja.php delete mode 100644 addons/member_communication/lang/ko.php delete mode 100644 addons/member_communication/lang/ru.php delete mode 100644 addons/member_communication/lang/vi.php delete mode 100644 addons/member_communication/lang/zh-CN.php delete mode 100644 addons/member_communication/lang/zh-TW.php delete mode 100644 addons/member_communication/member_communication.addon.php delete mode 100644 addons/member_communication/tpl/member_communication.js create mode 100644 modules/communication/queries/getNewMessageCount.xml create mode 100644 modules/communication/tpl/js/member_communication.js diff --git a/addons/member_communication/conf/info.xml b/addons/member_communication/conf/info.xml deleted file mode 100644 index 00f38f2f1..000000000 --- a/addons/member_communication/conf/info.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - 커뮤니케이션 - コミュニケーション - 会员交流 - Communication - Truyền thông - 커뮤니케이션 - 커뮤니케이션 - Общение - 交流 - - 커뮤니케이션 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다. - 쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 설정하면 됩니다. - - - メッセージ・友達機能を使うにはこのアドオンを「使用」にして下さい。 - - - 此插件可激活短信箱及添加好友功能。 - - - This addon enables the communication module in order to use messaging or friend functions. - Please enable this addon in case you want to use those functions. - - - Addon này cho phép sử dụng Module truyền thông để sử dụng tin nhắn hay chức năng bạn bè. - Hãy kích hoạt nếu bạn muốn sử dụng chức năng này. - - - 커뮤니케이션 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다. - 쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 설정하면 됩니다. - - - 커뮤니케이션 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다. - 쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 설정하면 됩니다. - - - Активизирует модуль Общение, позволяет использование сообщений между друзьями. - - - 讓會員擁有短訊和新增好友功能。 - - 1.7 - 2013-11-27 - - - NAVER - NAVER - NAVER - NAVER - NAVER - NAVER - NAVER - NAVER - NAVER - - - - 알람기능 사용 - Using alarm - Using alarm - Using alarm - Using alarm - Using alarm - Using alarm - 새로운 쪽지가 왔을때 팝업으로 알립니다. - Pop-up alram when new message received. - Pop-up alram when new message received. - Pop-up alram when new message received. - Pop-up alram when new message received. - Pop-up alram when new message received. - Pop-up alram when new message received. - - 사용함 - Using - Using - Using - Using - Using - Using - - - 사용하지 않음 - Not using - Not using - Not using - Not using - Not using - Not using - - - - diff --git a/addons/member_communication/lang/en.php b/addons/member_communication/lang/en.php deleted file mode 100644 index bdfbfc3ce..000000000 --- a/addons/member_communication/lang/en.php +++ /dev/null @@ -1,2 +0,0 @@ -alert_new_message_arrived = 'You have %d new message(s). Do you want to check it now?'; diff --git a/addons/member_communication/lang/es.php b/addons/member_communication/lang/es.php deleted file mode 100644 index 146c9b962..000000000 --- a/addons/member_communication/lang/es.php +++ /dev/null @@ -1,2 +0,0 @@ -alert_new_message_arrived = 'Usted tiene un nuevo mensaje. Quiere comprobar ahora?'; diff --git a/addons/member_communication/lang/ja.php b/addons/member_communication/lang/ja.php deleted file mode 100644 index 39a7d3c53..000000000 --- a/addons/member_communication/lang/ja.php +++ /dev/null @@ -1,2 +0,0 @@ -alert_new_message_arrived = '%d件の新しいメッセージがあります。確認しますか?'; diff --git a/addons/member_communication/lang/ko.php b/addons/member_communication/lang/ko.php deleted file mode 100644 index c3e865818..000000000 --- a/addons/member_communication/lang/ko.php +++ /dev/null @@ -1,2 +0,0 @@ -alert_new_message_arrived = '%d개의 새로운 메시지가 도착하였습니다. 확인하시겠습니까?'; diff --git a/addons/member_communication/lang/ru.php b/addons/member_communication/lang/ru.php deleted file mode 100644 index 4b132bd1b..000000000 --- a/addons/member_communication/lang/ru.php +++ /dev/null @@ -1,2 +0,0 @@ -alert_new_message_arrived = 'У Вас новые сообщения. Проверите сейчас?'; diff --git a/addons/member_communication/lang/vi.php b/addons/member_communication/lang/vi.php deleted file mode 100644 index e27acc310..000000000 --- a/addons/member_communication/lang/vi.php +++ /dev/null @@ -1,2 +0,0 @@ -alert_new_message_arrived = 'Bạn có một tin nhắn mới. bạn có muốn kiểm tra ngay bây giờ không?'; diff --git a/addons/member_communication/lang/zh-CN.php b/addons/member_communication/lang/zh-CN.php deleted file mode 100644 index 51f4fc2e6..000000000 --- a/addons/member_communication/lang/zh-CN.php +++ /dev/null @@ -1,2 +0,0 @@ -alert_new_message_arrived = '您有新消息。要确认吗?'; diff --git a/addons/member_communication/lang/zh-TW.php b/addons/member_communication/lang/zh-TW.php deleted file mode 100644 index 4a4798b01..000000000 --- a/addons/member_communication/lang/zh-TW.php +++ /dev/null @@ -1,2 +0,0 @@ -alert_new_message_arrived = '您收到 %d 個新訊息。要檢視嗎?'; diff --git a/addons/member_communication/member_communication.addon.php b/addons/member_communication/member_communication.addon.php deleted file mode 100644 index 0c660c1e9..000000000 --- a/addons/member_communication/member_communication.addon.php +++ /dev/null @@ -1,85 +0,0 @@ - */ - -if(!defined('__XE__')) - exit(); - -/** - * @file member_communication.addon.php - * @author NAVER (developers@xpressengine.com) - * @brief Promote user communication - * - * - Pop-up the message if new message comes in - * - When calling MemberModel::getMemberMenu, feature to send a message is added - * - When caliing MemberModel::getMemberMenu, feature to add a friend is added - */ -// Stop if non-logged-in user is -if(!Context::get('is_logged') || isCrawler()) -{ - return; -} - -$logged_info = Context::get('logged_info'); - -/** - * Message/Friend munus are added on the pop-up window and member profile. Check if a new message is received - * */ -if($this->module != 'member' && $called_position == 'before_module_init') -{ - // Load a language file from the communication module - Context::loadLang(_XE_PATH_ . 'modules/communication/lang'); - // Add menus on the member login information - $oMemberController = getController('member'); - $oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend'); - $oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box'); - - $flag_file = _XE_PATH_ . 'files/member_extra_info/new_message_flags/' . getNumberingPath($logged_info->member_srl) . $logged_info->member_srl; - if($addon_info->use_alarm != 'N' && file_exists($flag_file)) - { - // Pop-up to display messages if a flag on new message is set - $new_message_count = (int) trim(FileHandler::readFile($flag_file)); - FileHandler::removeFile($flag_file); - Context::loadLang(_XE_PATH_ . 'addons/member_communication/lang'); - Context::loadFile(array('./addons/member_communication/tpl/member_communication.js'), true); - - $text = preg_replace('@\r?\n@', '\\n', addslashes(Context::getLang('alert_new_message_arrived'))); - Context::addHtmlFooter(""); - } -} -elseif($this->act == 'getMemberMenu' && $called_position == 'before_module_proc') -{ - $member_srl = Context::get('target_srl'); - $oCommunicationModel = getModel('communication'); - - // Add a feature to display own message box. - if($logged_info->member_srl == $member_srl) - { - $mid = Context::get('cur_mid'); - $oMemberController = getController('member'); - // Add your own viewing Note Template - $oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationMessages'), 'cmd_view_message_box', '', 'self'); - // Display a list of friends - $oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationFriend'), 'cmd_view_friend', '', 'self'); - // If not, Add menus to send message and to add friends - } - else - { - // Get member information - $oMemberModel = getModel('member'); - $target_member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); - if(!$target_member_info->member_srl) - { - return; - } - - $oMemberController = getController('member'); - // Add a menu for sending message - if($logged_info->is_admin == 'Y' || $target_member_info->allow_message == 'Y' || ($target_member_info->allow_message == 'F' && $oCommunicationModel->isFriend($member_srl))) - $oMemberController->addMemberPopupMenu(getUrl('', 'mid', Context::get('cur_mid'), 'act', 'dispCommunicationSendMessage', 'receiver_srl', $member_srl), 'cmd_send_message', '', 'popup'); - // Add a menu for listing friends (if a friend is new) - if(!$oCommunicationModel->isAddedFriend($member_srl)) - $oMemberController->addMemberPopupMenu(getUrl('', 'mid', Context::get('cur_mid'), 'act', 'dispCommunicationAddFriend', 'target_srl', $member_srl), 'cmd_add_friend', '', 'popup'); - } -} -/* End of file member_communication.addon.php */ -/* Location: ./addons/member_communication/member_communication.addon.php */ diff --git a/addons/member_communication/tpl/member_communication.js b/addons/member_communication/tpl/member_communication.js deleted file mode 100644 index d92c813ea..000000000 --- a/addons/member_communication/tpl/member_communication.js +++ /dev/null @@ -1,26 +0,0 @@ -(function($){ -window.xeNotifyMessage = function(text, count){ - var $bar; - $bar = $('div.message.info'); - if(!$bar.length) { - $bar = $('
') - .hide() - .css({ - 'position' : 'absolute', - 'z-index' : '100', - }) - .prependTo(document.body); - } - text = text.replace('%d', count); - var cur_module = current_url.getQuery('module'); - if( cur_module == "admin" ) - h = $bar.html('

'+text+'

').height(); - else - h = $bar.html('

'+text+'

').height(); - $bar.show().animate({top:0}); - // hide after 10 seconds - setTimeout(function(){ - $bar.slideUp(); - }, 5000); -}; -})(jQuery); diff --git a/modules/communication/communication.admin.controller.php b/modules/communication/communication.admin.controller.php index 1f9e8b028..f0e7f0974 100644 --- a/modules/communication/communication.admin.controller.php +++ b/modules/communication/communication.admin.controller.php @@ -24,7 +24,7 @@ class communicationAdminController extends communication function procCommunicationAdminInsertConfig() { // get the default information - $args = Context::gets('skin', 'colorset', 'editor_skin', 'sel_editor_colorset', 'mskin', 'mcolorset', 'layout_srl', 'mlayout_srl', 'grant_write_default','grant_write_group'); + $args = Context::gets('skin', 'colorset', 'editor_skin', 'sel_editor_colorset', 'mskin', 'mcolorset', 'layout_srl', 'mlayout_srl', 'grant_write_default','grant_write_group', 'member_menu'); $args->editor_colorset = $args->sel_editor_colorset; unset($args->sel_editor_colorset); diff --git a/modules/communication/communication.admin.view.php b/modules/communication/communication.admin.view.php index 264161bfe..9fc91e73d 100644 --- a/modules/communication/communication.admin.view.php +++ b/modules/communication/communication.admin.view.php @@ -66,7 +66,6 @@ class communicationAdminView extends communication $this->setTemplatePath($this->module_path . 'tpl'); $this->setTemplateFile('index'); } - } /* End of file communication.admin.view.php */ /* Location: ./modules/comment/communication.admin.view.php */ diff --git a/modules/communication/communication.class.php b/modules/communication/communication.class.php index 155fd6413..559e2f28b 100644 --- a/modules/communication/communication.class.php +++ b/modules/communication/communication.class.php @@ -8,13 +8,21 @@ */ class communication extends ModuleObject { - + private $triggers = array( + array('moduleHandler.init', 'communication', 'controller', 'triggerModuleHandlerAfter', 'after') + ); /** * Implement if additional tasks are necessary when installing * @return Object */ function moduleInstall() { + $oModuleController = getController('module'); + foreach($this->triggers as $trigger) + { + $oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]); + } + // Create a temporary file storage for one new private message notification FileHandler::makeDir('./files/member_extra_info/new_message_flags'); return new Object(); @@ -46,6 +54,15 @@ class communication extends ModuleObject } } } + + $oModuleModel = getModel('module'); + foreach($this->triggers as $trigger) + { + if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) + { + return TRUE; + } + } return FALSE; } @@ -61,6 +78,14 @@ class communication extends ModuleObject } $oModuleModel = getModel('module'); + $oModuleController = getController('module'); + foreach($this->triggers as $trigger) + { + if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) + { + $oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]); + } + } $config = $oModuleModel->getModuleConfig('message'); if(!is_object($config)) { @@ -76,7 +101,6 @@ class communication extends ModuleObject if(is_dir($template_path)) { $config->skin = implode('|@|', $config_parse); - $oModuleController = getController('module'); $oModuleController->updateModuleConfig('communication', $config); } } diff --git a/modules/communication/communication.controller.php b/modules/communication/communication.controller.php index 8a597f176..5b2d8007b 100644 --- a/modules/communication/communication.controller.php +++ b/modules/communication/communication.controller.php @@ -14,7 +14,6 @@ class communicationController extends communication */ function init() { - } /** @@ -778,6 +777,77 @@ class communicationController extends communication return executeQuery('communication.setMessageReaded', $args); } + function triggerModuleHandlerAfter($module) + { + if(!Context::get('is_logged') && isCrawler()) + { + return new Object(); + } + $oCommunicationModel = getModel('communication'); + $config = $oCommunicationModel->getConfig(); + + if($config->member_menu != 'Y') + { + return new Object(); + } + $act = Context::get('act'); + $logged_info = Context::get('logged_info'); + if($module->module != 'member') + { + $oMemberController = getController('member'); + $oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend'); + $oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box'); + + // Pop-up to display messages if a flag on new message is set + $new_message_count = $oCommunicationModel->getNewMessageCount(); + if($new_message_count > 0) + { + Context::loadFile('./modules/communication/tpl/js/member_communication.js'); + $text = preg_replace('@\r?\n@', '\\n', addslashes(Context::getLang('alert_new_message_arrived'))); + Context::addHtmlHeader(""); + } + + } + elseif($act == 'getMemberMenu') + { + $member_srl = Context::get('target_srl'); + $oCommunicationModel = getModel('communication'); + + // Add a feature to display own message box. + if($logged_info->member_srl == $member_srl) + { + $mid = Context::get('cur_mid'); + $oMemberController = getController('member'); + // Add your own viewing Note Template + $oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationMessages'), 'cmd_view_message_box', '', 'self'); + // Display a list of friends + $oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationFriend'), 'cmd_view_friend', '', 'self'); + // If not, Add menus to send message and to add friends + } + else + { + // Get member information + $oMemberModel = getModel('member'); + $target_member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); + if(!$target_member_info->member_srl) + { + return new Object(); + } + + $oMemberController = getController('member'); + // Add a menu for sending message + if($logged_info->is_admin == 'Y' || $target_member_info->allow_message == 'Y' || ($target_member_info->allow_message == 'F' && $oCommunicationModel->isFriend($member_srl))) + { + $oMemberController->addMemberPopupMenu(getUrl('', 'mid', Context::get('cur_mid'), 'act', 'dispCommunicationSendMessage', 'receiver_srl', $member_srl), 'cmd_send_message', '', 'popup'); + } + // Add a menu for listing friends (if a friend is new) + if(!$oCommunicationModel->isAddedFriend($member_srl)) + { + $oMemberController->addMemberPopupMenu(getUrl('', 'mid', Context::get('cur_mid'), 'act', 'dispCommunicationAddFriend', 'target_srl', $member_srl), 'cmd_add_friend', '', 'popup'); + } + } + } + } } /* End of file communication.controller.php */ /* Location: ./modules/comment/communication.controller.php */ diff --git a/modules/communication/communication.model.php b/modules/communication/communication.model.php index 6a466f853..1c578535c 100644 --- a/modules/communication/communication.model.php +++ b/modules/communication/communication.model.php @@ -51,10 +51,15 @@ class communicationModel extends communication { $communication_config->mskin = 'default'; } - + if(!$communication_config->grant_write) { - $communication_config->grant_write = array('default_grant'=>'member'); + $communication_config->grant_write = array('default_grant' => 'member'); + } + + if(!$communication_config->member_menu) + { + $communication_config->member_menu = 'Y'; } return $communication_config; @@ -228,6 +233,22 @@ class communicationModel extends communication return $message; } + function getNewMessageCount($member_srl) + { + if(!$member_srl) + { + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl; + } + + $args = new stdClass(); + $args->receiver_srl = $member_srl; + $args->readed = 'N'; + + $output = executeQuery('communication.getNewMessageCount', $args); + return $output->data->count; + } + /** * get a message list * @param string $message_type (R: Received Message, S: Sent Message, T: Archive) diff --git a/modules/communication/lang/en.php b/modules/communication/lang/en.php index 550842e2c..4289cec4c 100644 --- a/modules/communication/lang/en.php +++ b/modules/communication/lang/en.php @@ -34,3 +34,4 @@ $lang->message_notice = 'Send a message to the author about this. If you don\'t $lang->friends_page_does_not_support = 'Friends in a mobile environment is not supported. Please go to the PC page.'; $lang->cmd_write_communication = 'Write Grant'; $lang->cmd_manage_base = 'Basic infomation'; +$lang->alert_new_message_arrived = 'You have %d new message(s). Do you want to check it now?'; diff --git a/modules/communication/lang/es.php b/modules/communication/lang/es.php index f60b5dee8..789ed1c77 100644 --- a/modules/communication/lang/es.php +++ b/modules/communication/lang/es.php @@ -28,3 +28,4 @@ $lang->msg_content_is_null = 'Por favor ingresar el contenido'; $lang->msg_allow_message_to_friend = 'Falló el envío por permitir sólo mensajes de sus amigos'; $lang->msg_disallow_message = 'Falló el envío por ser usuario rechazado para recibir mensajes'; $lang->about_allow_message = 'Usted puede decidir la recepción del mensaje'; +$lang->alert_new_message_arrived = 'Usted tiene un nuevo mensaje. Quiere comprobar ahora?'; diff --git a/modules/communication/lang/ja.php b/modules/communication/lang/ja.php index 0e11f9b44..b0a821f76 100644 --- a/modules/communication/lang/ja.php +++ b/modules/communication/lang/ja.php @@ -32,3 +32,4 @@ $lang->msg_disallow_message = 'メッセージの受信を拒否している受 $lang->about_allow_message = 'メッセージを受信するか設定します。'; $lang->message_notice = '作成者にメッセージを送信し、知らせます。作成しなければ送信されません。'; $lang->friends_page_does_not_support = 'モバイル環境では友達リストページをサポートしません。PC画面へ移動してください。'; +$lang->alert_new_message_arrived = '%d件の新しいメッセージがあります。確認しますか?'; diff --git a/modules/communication/lang/ko.php b/modules/communication/lang/ko.php index 3def19bbe..fc7b22f74 100644 --- a/modules/communication/lang/ko.php +++ b/modules/communication/lang/ko.php @@ -34,3 +34,4 @@ $lang->message_notice = '저작자에게 쪽지를 발송해서 이 사실을 $lang->friends_page_does_not_support = '모바일 환경에서는 친구 보기 페이지를 지원하지 않습니다. PC 화면으로 이동하세요.'; $lang->cmd_write_communication = '작성 권한'; $lang->cmd_manage_base = '기본 정보'; +$lang->alert_new_message_arrived = '%d개의 새로운 메시지가 도착하였습니다. 확인하시겠습니까?'; diff --git a/modules/communication/lang/ru.php b/modules/communication/lang/ru.php index fb3a21f48..cb9f9fde3 100644 --- a/modules/communication/lang/ru.php +++ b/modules/communication/lang/ru.php @@ -29,3 +29,4 @@ $lang->msg_content_is_null = 'Пожалуйста, введите содерж $lang->msg_allow_message_to_friend = 'Сообщение не отправлено, поскольку являетесь пользователем, имеющим право посылать сообщения только друзьям'; $lang->msg_disallow_message = 'Сообщение не отправлено, поскольку получатель запретил прием сообщений'; $lang->about_allow_message = 'Вы можете установить режим принятия сообщений'; +$lang->alert_new_message_arrived = 'У Вас новые сообщения. Проверите сейчас?'; diff --git a/modules/communication/lang/vi.php b/modules/communication/lang/vi.php index ecf6d6723..cfd796f53 100644 --- a/modules/communication/lang/vi.php +++ b/modules/communication/lang/vi.php @@ -29,3 +29,4 @@ $lang->msg_content_is_null = 'Xin vui lòng nhập nội dung.'; $lang->msg_allow_message_to_friend = 'Không thể gửi vì người nhận chỉ chấp nhận những tin nhắn từ bạn bè của họ.'; $lang->msg_disallow_message = 'Không thể gửi vì người nhận đã từ chối nhận tin nhắn.'; $lang->about_allow_message = 'Bạn có thể đồng ý nhận tin nhắn.'; +$lang->alert_new_message_arrived = 'Bạn có một tin nhắn mới. bạn có muốn kiểm tra ngay bây giờ không?'; diff --git a/modules/communication/lang/zh-CN.php b/modules/communication/lang/zh-CN.php index 4f05d282e..a020a4b92 100644 --- a/modules/communication/lang/zh-CN.php +++ b/modules/communication/lang/zh-CN.php @@ -29,3 +29,4 @@ $lang->msg_content_is_null = '请输入内容。'; $lang->msg_allow_message_to_friend = '因其为只允许接收好友短消息的用户,所以不能发送短消息。'; $lang->msg_disallow_message = '因其为拒绝接收短消息的用户,所以不能发送短消息。'; $lang->about_allow_message = '可以选择短消息接收与否。'; +$lang->alert_new_message_arrived = '您有新消息。要确认吗?'; diff --git a/modules/communication/lang/zh-TW.php b/modules/communication/lang/zh-TW.php index 97cc047ce..f2dafd5e9 100644 --- a/modules/communication/lang/zh-TW.php +++ b/modules/communication/lang/zh-TW.php @@ -29,3 +29,4 @@ $lang->msg_content_is_null = '請輸入內容。'; $lang->msg_allow_message_to_friend = '只允許接收好友短訊息的用戶,不能發送短訊息。'; $lang->msg_disallow_message = '拒絕接收短訊息的用戶,不能發送短訊息。'; $lang->about_allow_message = '可選擇是否接收短訊息。'; +$lang->alert_new_message_arrived = '您收到 %d 個新訊息。要檢視嗎?'; diff --git a/modules/communication/queries/getNewMessageCount.xml b/modules/communication/queries/getNewMessageCount.xml new file mode 100644 index 000000000..9ef32c1e0 --- /dev/null +++ b/modules/communication/queries/getNewMessageCount.xml @@ -0,0 +1,15 @@ + + + +
+ + + + + + + + + + + diff --git a/modules/communication/tpl/index.html b/modules/communication/tpl/index.html index 7f21fa105..da496c9b0 100644 --- a/modules/communication/tpl/index.html +++ b/modules/communication/tpl/index.html @@ -99,7 +99,12 @@ - +
+ +
+ +
+
diff --git a/modules/communication/tpl/js/member_communication.js b/modules/communication/tpl/js/member_communication.js new file mode 100644 index 000000000..78f6501e2 --- /dev/null +++ b/modules/communication/tpl/js/member_communication.js @@ -0,0 +1,26 @@ +(function($){ + window.xeNotifyMessage = function(text, count){ + var $bar; + $bar = $('div.message.info'); + if(!$bar.length) { + $bar = $('
') + .hide() + .css({ + 'position' : 'absolute', + 'z-index' : '100', + }) + .prependTo(document.body); + } + text = text.replace('%d', count); + var cur_module = current_url.getQuery('module'); + if( cur_module == "admin" ) + h = $bar.html('

'+text+'

').height(); + else + h = $bar.html('

'+text+'

').height(); + $bar.show().animate({top:0}); + // hide after 10 seconds + setTimeout(function(){ + $bar.slideUp(); + }, 5000); + }; +})(jQuery);