diff --git a/acp/acp_mchat_module.php b/acp/acp_mchat_module.php index a72c0db..7370d51 100644 --- a/acp/acp_mchat_module.php +++ b/acp/acp_mchat_module.php @@ -172,6 +172,9 @@ class acp_mchat_module $config->set('mchat_new_posts_quote', $request->variable('mchat_new_posts_quote', 0)); // update setting in config table for stats on index $config->set('mchat_stats_index', $request->variable('mchat_stats_index', 0)); + // update setting in config table for message om top + $config->set('mchat_message_top', $request->variable('mchat_message_top', 0)); + // and an entry into the log table add_log('admin', 'LOG_MCHAT_CONFIG_UPDATE'); @@ -206,6 +209,8 @@ class acp_mchat_module $mchat_stats_index = isset($config['mchat_stats_index']) ? $config['mchat_stats_index'] : 0; + $mchat_message_top = isset($config['mchat_message_top']) ? $config['mchat_message_top'] : 0; + $dateformat_options = ''; foreach ($user->lang['dateformats'] as $format => $null) { @@ -230,6 +235,7 @@ class acp_mchat_module 'MCHAT_PRUNE_NUM' => !empty($mchat_row['prune_num']) ? $mchat_row['prune_num'] : $mchat_config['prune_num'], 'MCHAT_ENABLE' => ($mchat_enable) ? true : false, 'MCHAT_ON_INDEX' => ($mchat_on_index) ? true : false, + 'MCHAT_MESSAGE_TOP' => ($mchat_message_top) ? true : false, 'MCHAT_LOCATION' => !empty($mchat_row['location']) ? $mchat_row['location'] : $mchat_config['location'], 'MCHAT_REFRESH' => !empty($mchat_row['refresh']) ? $mchat_row['refresh'] : $mchat_config['refresh'], 'MCHAT_WHOIS_REFRESH' => !empty($mchat_row['whois_refresh']) ? $mchat_row['whois_refresh'] : $mchat_config['whois_refresh'], diff --git a/adm/style/acp_mchat.html b/adm/style/acp_mchat.html index 1cdb4b8..381180f 100644 --- a/adm/style/acp_mchat.html +++ b/adm/style/acp_mchat.html @@ -17,6 +17,12 @@
+
+

+ {L_MCHAT_MESSAGE_TOP_EXPLAIN}
+
+
+

{L_MCHAT_NEW_POSTS_EXPLAIN}
diff --git a/composer.json b/composer.json index 0501779..f5f742c 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "type": "phpbb-extension", "description": "mChat Extension for phpbb 3.1.x", "homepage": "http://www.dmzx-web.net", - "version": "0.0.11", + "version": "0.0.12", "time": "2015-03-10", "keywords": ["phpbb", "extension", "mchat"], "license": "GPL-2.0", diff --git a/core/render_helper.php b/core/render_helper.php index cf5799e..67b91e9 100644 --- a/core/render_helper.php +++ b/core/render_helper.php @@ -69,7 +69,6 @@ class render_helper $this->db = $db; $this->cache = $cache; $this->request = $request; - $this->phpbb_root_path = $phpbb_root_path; $this->phpEx = $phpEx; $this->table_prefix = $table_prefix; @@ -417,7 +416,10 @@ class render_helper $rows = $this->db->sql_fetchrowset($result); $this->db->sql_freeresult($result); // Reverse the array wanting messages appear in reverse + if($this->config['mchat_message_top']) + { $rows = array_reverse($rows); + } foreach($rows as $row) { @@ -534,7 +536,7 @@ class render_helper } // Reguest... - $message = utf8_normalize_nfc(request_var('message', '', true)); + $message = utf8_ucfirst(utf8_normalize_nfc(request_var('message', '', true))); // must have something other than bbcode in the message if (empty($mchatregex)) @@ -956,7 +958,10 @@ class render_helper $rows = $this->db->sql_fetchrowset($result); $this->db->sql_freeresult($result); + if($this->config['mchat_message_top']) + { $rows = array_reverse($rows, true); + } foreach($rows as $row) { @@ -999,7 +1004,7 @@ class render_helper 'MCHAT_USER_AVATAR' => $mchat_avatar, 'U_VIEWPROFILE' => ($row['user_id'] != ANONYMOUS) ? append_sid("{$this->phpbb_root_path}memberlist.{$this->phpEx}", 'mode=viewprofile&u=' . $row['user_id']) : '', 'U_USER_ID' => ($row['user_id'] != ANONYMOUS && $this->user->data['user_id'] != $row['user_id']) ? append_sid("{$this->phpbb_root_path}ucp.{$this->phpEx}", 'i=pm&mode=compose&u=' . $row['user_id']) : '', - 'BOT_USER_ID' => $row['user_id'] != '1', + 'BOT_USER_ID' => $row['user_id'] != '1', 'U_USER_ID' => ($row['user_id'] != ANONYMOUS && $this->config['allow_privmsg'] && $this->auth->acl_get('u_sendpm') && $this->user->data['user_id'] != $row['user_id'] && $row['user_id'] != '1' && ($row['user_allow_pm'] || $this->auth->acl_gets('a_', 'm_') || $this->auth->acl_getf_global('m_'))) ? append_sid("{$this->phpbb_root_path}ucp.{$this->phpEx}", 'i=pm&mode=compose&u=' . $row['user_id']) : '', 'MCHAT_MESSAGE_EDIT' => $message_edit, 'MCHAT_MESSAGE_ID' => $row['message_id'], @@ -1098,6 +1103,7 @@ class render_helper 'MCHAT_ALLOW_IP' => $mchat_ip, 'MCHAT_NOMESSAGE_MODE' => $mchat_no_message, 'MCHAT_ALLOW_BBCODES' => ($mchat_allow_bbcode && $this->config['allow_bbcode']) ? true : false, + 'MCHAT_MESSAGE_TOP' => $this->config['mchat_message_top'] ? true : false, 'MCHAT_ENABLE' => $this->config['mchat_enable'], 'MCHAT_ARCHIVE_URL' => $this->helper->route('dmzx_mchat_controller', array('mode' => 'archive')), 'MCHAT_CUSTOM_PAGE' => $mchat_custom_page, diff --git a/event/listener.php b/event/listener.php index 101e532..f375870 100644 --- a/event/listener.php +++ b/event/listener.php @@ -151,7 +151,7 @@ class listener implements EventSubscriberInterface } // Data... - $message = utf8_normalize_nfc($mchat_new_data . ': [url=' . generate_board_url() . '/viewtopic.' . $this->phpEx . '?p=' . $event['data']['post_id'] . '#p' . $event['data']['post_id'] . ']' . $event['post_data']['post_subject'] . '[/url] in [url=' . generate_board_url() . '/viewforum.' . $this->phpEx . '?f=' . $event['forum_id'] . ']' . $event['post_data']['forum_name'] . ' Section[/url] '); + $message = utf8_normalize_nfc($mchat_new_data . ': [url=' . generate_board_url() . '/viewtopic.' . $this->phpEx . '?p=' . $event['data']['post_id'] . '#p' . $event['data']['post_id'] . ']' . $event['post_data']['post_subject'] . '[/url] '. $this->user->lang['MCHAT_IN'] .' [url=' . generate_board_url() . '/viewforum.' . $this->phpEx . '?f=' . $event['forum_id'] . ']' . $event['post_data']['forum_name'] . ' Section[/url] '); $uid = $bitfield = $options = ''; // will be modified by generate_text_for_storage generate_text_for_storage($message, $uid, $bitfield, $options, true, false, false); diff --git a/language/de/common.php b/language/de/common.php index 007b58b..2b5ab21 100644 --- a/language/de/common.php +++ b/language/de/common.php @@ -40,6 +40,7 @@ $lang = array_merge($lang, array( 'MCHAT_TITLE' => 'Mini-Chat', 'MCHAT_ADD' => 'Senden', + 'MCHAT_IN' => 'In', 'MCHAT_ANNOUNCEMENT' => 'Ankündigen', 'MCHAT_ARCHIVE' => 'Archiv', 'MCHAT_ARCHIVE_PAGE' => 'Mini-Chat Archiv', diff --git a/language/de/info_acp_mchat.php b/language/de/info_acp_mchat.php index 73db6d0..bc99d68 100644 --- a/language/de/info_acp_mchat.php +++ b/language/de/info_acp_mchat.php @@ -115,6 +115,10 @@ $lang = array_merge($lang, array( 'MCHAT_STATS' => 'Wer ist im mChat?', 'MCHAT_STATS_INDEX' => 'Anzeige auf dem Index', 'MCHAT_STATS_INDEX_EXPLAIN' => 'Zeigt auf dem Index an wer im Mini-Chat ist.', + 'MCHAT_MESSAGE_TOP' => 'Keep message on Bottom / Top', + 'MCHAT_MESSAGE_TOP_EXPLAIN' => 'This will post the message bottom or top in the chat message area.', + 'MCHAT_BOTTOM' => 'Bottom', + 'MCHAT_TOP' => 'Top', 'MCHAT_MESSAGES' => 'Nachrichten-Einstellungen', 'MCHAT_PAUSE_ON_INPUT' => 'Den Chat während einer Nachrichteneingabe nicht aktualisieren', 'MCHAT_PAUSE_ON_INPUT_EXPLAIN' => 'Falls JA eingestellt ist, ist das automatische Aktualisieren während der Eingabe einer Nachricht deaktiviert.', diff --git a/language/en/common.php b/language/en/common.php index 2c154d5..620863c 100644 --- a/language/en/common.php +++ b/language/en/common.php @@ -40,6 +40,7 @@ $lang = array_merge($lang, array( 'MCHAT_TITLE' => 'Mini-Chat', 'MCHAT_ADD' => 'Send', + 'MCHAT_IN' => 'In', 'MCHAT_ANNOUNCEMENT' => 'Announcement', 'MCHAT_ARCHIVE' => 'Archive', 'MCHAT_ARCHIVE_PAGE' => 'Mini-Chat Archive', @@ -134,4 +135,7 @@ $lang = array_merge($lang, array( 'MCHAT_SEND_PM' => 'Send Private Message', 'MCHAT_PM' => '(PM)', 'MORE_SMILIES' => 'More Smilies', -)); \ No newline at end of file + + //Cusome edits + 'REPLY_WITH_LIKE' =>'Like This Post', + )); \ No newline at end of file diff --git a/language/en/info_acp_mchat.php b/language/en/info_acp_mchat.php index eb7372d..d4842ce 100644 --- a/language/en/info_acp_mchat.php +++ b/language/en/info_acp_mchat.php @@ -115,6 +115,10 @@ $lang = array_merge($lang, array( 'MCHAT_STATS' => 'Whois Chatting', 'MCHAT_STATS_INDEX' => 'Stats on Index', 'MCHAT_STATS_INDEX_EXPLAIN' => 'Show who is chatting with in the stats section of the forum', + 'MCHAT_MESSAGE_TOP' => 'Keep message on Bottom / Top', + 'MCHAT_MESSAGE_TOP_EXPLAIN' => 'This will post the message bottom or top in the chat message area.', + 'MCHAT_BOTTOM' => 'Bottom', + 'MCHAT_TOP' => 'Top', 'MCHAT_MESSAGES' => 'Message Settings', 'MCHAT_PAUSE_ON_INPUT' => 'Pause on input', 'MCHAT_PAUSE_ON_INPUT_EXPLAIN' => 'If set Yes, then the chat will not autoupdate upon a user entering a message in the input area', diff --git a/language/fr/common.php b/language/fr/common.php index 7dda59d..e52475e 100644 --- a/language/fr/common.php +++ b/language/fr/common.php @@ -40,6 +40,7 @@ $lang = array_merge($lang, array( 'MCHAT_TITLE' => 'Mini-Chat', 'MCHAT_ADD' => 'Envoyer', + 'MCHAT_IN' => 'In', 'MCHAT_ANNOUNCEMENT' => 'Annonce', 'MCHAT_ARCHIVE' => 'Archives', 'MCHAT_ARCHIVE_PAGE' => 'Archives du mini-chat', diff --git a/language/fr/info_acp_mchat.php b/language/fr/info_acp_mchat.php index 69c2f40..ba778af 100644 --- a/language/fr/info_acp_mchat.php +++ b/language/fr/info_acp_mchat.php @@ -115,6 +115,10 @@ $lang = array_merge($lang, array( 'MCHAT_STATS' => 'Qui discute ?', 'MCHAT_STATS_INDEX' => 'Statistiques sur l’index', 'MCHAT_STATS_INDEX_EXPLAIN' => 'Affiche les membres qui discutent dans les statistiques du forum.', + 'MCHAT_MESSAGE_TOP' => 'Keep message on Bottom / Top', + 'MCHAT_MESSAGE_TOP_EXPLAIN' => 'This will post the message bottom or top in the chat message area.', + 'MCHAT_BOTTOM' => 'Bottom', + 'MCHAT_TOP' => 'Top', 'MCHAT_MESSAGES' => 'Paramètres des messages', 'MCHAT_PAUSE_ON_INPUT' => 'Pause sur la saisie', 'MCHAT_PAUSE_ON_INPUT_EXPLAIN' => 'Si activée, le mini-chat ne sera pas mis à jour automatiquement lorsque l’utilisateur rédige un message dans la zone de saisie.', diff --git a/language/it/common.php b/language/it/common.php index 27258be..9a02a76 100644 --- a/language/it/common.php +++ b/language/it/common.php @@ -40,6 +40,7 @@ $lang = array_merge($lang, array( 'MCHAT_TITLE' => 'Mini-Chat', 'MCHAT_ADD' => 'Invia', + 'MCHAT_IN' => 'In', 'MCHAT_ANNOUNCEMENT' => 'Announcio', 'MCHAT_ARCHIVE' => 'Archivio', 'MCHAT_ARCHIVE_PAGE' => 'Mini-Chat Archivio', diff --git a/language/it/info_acp_mchat.php b/language/it/info_acp_mchat.php index c69e526..7ce8feb 100644 --- a/language/it/info_acp_mchat.php +++ b/language/it/info_acp_mchat.php @@ -115,6 +115,10 @@ $lang = array_merge($lang, array( 'MCHAT_STATS' => 'Chat Whois', 'MCHAT_STATS_INDEX' => 'Statistiche Index', 'MCHAT_STATS_INDEX_EXPLAIN' => 'Mostra chi sta chattando nella sezione statistiche del forum', + 'MCHAT_MESSAGE_TOP' => 'Keep message on Bottom / Top', + 'MCHAT_MESSAGE_TOP_EXPLAIN' => 'This will post the message bottom or top in the chat message area.', + 'MCHAT_BOTTOM' => 'Bottom', + 'MCHAT_TOP' => 'Top', 'MCHAT_MESSAGES' => 'Opzioni Messaggi', 'MCHAT_PAUSE_ON_INPUT' => 'Pausa in ingresso', 'MCHAT_PAUSE_ON_INPUT_EXPLAIN' => 'Se impostato Sì, allora la chat non verrà aggiornata automaticamente se un utente inserisce un messaggio in area di immissione', diff --git a/language/nl/common.php b/language/nl/common.php index 69082e3..ea47756 100644 --- a/language/nl/common.php +++ b/language/nl/common.php @@ -40,6 +40,7 @@ $lang = array_merge($lang, array( 'MCHAT_TITLE' => 'Mini-Chat', 'MCHAT_ADD' => 'Versturen', + 'MCHAT_IN' => 'In', 'MCHAT_ANNOUNCEMENT' => 'Aankondiging', 'MCHAT_ARCHIVE' => 'Archief', 'MCHAT_ARCHIVE_PAGE' => 'Mini-Chat Archief', diff --git a/language/nl/info_acp_mchat.php b/language/nl/info_acp_mchat.php index 2665a1e..86c7849 100644 --- a/language/nl/info_acp_mchat.php +++ b/language/nl/info_acp_mchat.php @@ -115,6 +115,10 @@ $lang = array_merge($lang, array( 'MCHAT_STATS' => 'Wie is aan het chatten', 'MCHAT_STATS_INDEX' => 'Statistieken op de Index pagina', 'MCHAT_STATS_INDEX_EXPLAIN' => 'Laat zien wie aan het chatten is in de statistieken sectie op het forum', + 'MCHAT_MESSAGE_TOP' => 'Keep message on Bottom / Top', + 'MCHAT_MESSAGE_TOP_EXPLAIN' => 'This will post the message bottom or top in the chat message area.', + 'MCHAT_BOTTOM' => 'Bottom', + 'MCHAT_TOP' => 'Top', 'MCHAT_MESSAGES' => 'Berichten instellingen', 'MCHAT_PAUSE_ON_INPUT' => 'Pauze op eventuele inactiviteit van mChat', 'MCHAT_PAUSE_ON_INPUT_EXPLAIN' => 'Stel je ja in, dan wordt mChat niet automatisch vernieuwd, todat een gebruiker een bericht plaatst in mChat', diff --git a/language/pl/common.php b/language/pl/common.php index 7be8003..89b0050 100644 --- a/language/pl/common.php +++ b/language/pl/common.php @@ -40,6 +40,7 @@ $lang = array_merge($lang, array( 'MCHAT_TITLE' => 'Mini-Chat', 'MCHAT_ADD' => 'Wyślij', + 'MCHAT_IN' => 'In', 'MCHAT_ANNOUNCEMENT' => 'Ogłoszenie', 'MCHAT_ARCHIVE' => 'Archiwum', 'MCHAT_ARCHIVE_PAGE' => 'Mini-Chat Archiwum', diff --git a/language/pl/info_acp_mchat.php b/language/pl/info_acp_mchat.php index 54aea87..9a4bfa8 100644 --- a/language/pl/info_acp_mchat.php +++ b/language/pl/info_acp_mchat.php @@ -115,6 +115,10 @@ $lang = array_merge($lang, array( 'MCHAT_STATS' => 'Kto czatuje ?', 'MCHAT_STATS_INDEX' => 'Statystyki na stronie głównej', 'MCHAT_STATS_INDEX_EXPLAIN' => 'Pokaż kto korzysta z mChat w dziale statystyki na stronie głównej', + 'MCHAT_MESSAGE_TOP' => 'Keep message on Bottom / Top', + 'MCHAT_MESSAGE_TOP_EXPLAIN' => 'This will post the message bottom or top in the chat message area.', + 'MCHAT_BOTTOM' => 'Bottom', + 'MCHAT_TOP' => 'Top', 'MCHAT_MESSAGES' => 'Ustawienia wiadomości', 'MCHAT_PAUSE_ON_INPUT' => 'Auto-aktuaizacja podczas pisania wiadomości', 'MCHAT_PAUSE_ON_INPUT_EXPLAIN' => 'Zaznacz TAK aby nie auto-aktualizować mChatu gdy użytkownik pisze wiadomość', diff --git a/migrations/mchat_schema.php b/migrations/mchat_schema.php index ac37978..d102997 100644 --- a/migrations/mchat_schema.php +++ b/migrations/mchat_schema.php @@ -23,8 +23,9 @@ class mchat_schema extends \phpbb\db\migration\migration array('config.add', array('mchat_new_posts_reply', false)), array('config.add', array('mchat_new_posts_edit', false)), array('config.add', array('mchat_new_posts_quote', false)), + array('config.add', array('mchat_message_top', true)), array('config.add', array('mchat_stats_index', false)), - array('config.add', array('mchat_version','0.0.11')), + array('config.add', array('mchat_version','0.0.12')), array('permission.add', array('u_mchat_use')), array('permission.add', array('u_mchat_view')), diff --git a/styles/prosilver/template/mchat_ajax_mini.js b/styles/prosilver/template/mchat_ajax_mini.js index df3b99a..0d4960f 100644 --- a/styles/prosilver/template/mchat_ajax_mini.js +++ b/styles/prosilver/template/mchat_ajax_mini.js @@ -235,7 +235,7 @@ var mChat={ }, edit:function(id){ var message=$jQ('#edit'+id).val(); - apprise(mChatEditInfo + ' (Shift and Enter for new line)',{ + apprise(mChatEditInfo,{ 'textarea':message, 'animate':true, 'position':200, diff --git a/styles/prosilver/template/mchat_ajax_mini_top.js b/styles/prosilver/template/mchat_ajax_mini_top.js new file mode 100644 index 0000000..dfde361 --- /dev/null +++ b/styles/prosilver/template/mchat_ajax_mini_top.js @@ -0,0 +1,32 @@ +/** + * + * @package mChat JavaScript Code mini + * @version 1.4.4 of 2013-11-03 + * @copyright (c) 2013 By Rich McGirr (RMcGirr83) http://rmcgirr83.org + * @copyright (c) 2009 By Shapoval Andrey Vladimirovich (AllCity) ~ http://allcity.net.ru/ + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * + Code uses the titlealert jQuery plugin, options are below + interva 500 The flashing interval in milliseconds. + originalTitleInterval null Time in milliseconds that the original title is diplayed for. If null the time is the same as interval. + duration 0 The total lenght of the flashing before it is automatically stopped. Zero means infinite. + stopOnFocus true If true, the flashing will stop when the window gets focus. + stopOnMouseMove false If true, the flashing will stop when the document recieves a mousemove event (i.e. when the user moves the mouse over the document area, regardless of what window is active). + To use find titlealert in the code and make as so + $jQ.titleAlert(mChatNewMessageAlert, { + requireBlur:false, + stopOnFocus:false, + duration:4000, + interval:700 + }); +**/ +var $jQ=jQuery;var hasFocus=true;$jQ(function(){if(!mChatArchiveMode){if(mChatPause){$jQ("#mChatMessage").bind("keypress",function(){clearInterval(interval);$jQ("#mChatLoadIMG,#mChatOkIMG,#mChatErrorIMG").hide();$jQ("#mChatRefreshText").html(mChatRefreshNo).addClass("mchat-alert");$jQ("#mChatPauseIMG").show()})}$jQ([window,document]).blur(function(){hasFocus=false}).focus(function(){hasFocus=true});$jQ.fn.autoGrowInput=function(e){var t=$jQ(".mChatPanel").width();e=$jQ.extend({maxWidth:t-20,minWidth:0,comfortZone:20},e);this.filter("input:text").each(function(){var t=e.minWidth||$jQ(this).width(),n="",r=$jQ(this),i=$jQ("
").css({position:"absolute",top:-9999,left:-9999,width:"auto",fontSize:r.css("fontSize"),fontFamily:r.css("fontFamily"),fontWeight:r.css("fontWeight"),letterSpacing:r.css("letterSpacing"),whiteSpace:"nowrap"}),s=function(){if(n===(n=r.val())){return}var s=n.replace(/&/g,"&").replace(/\s/g," ").replace(//g,">");i.html(s);var u=i.width(),a=u+e.comfortZone>=t?u+e.comfortZone:t,f=r.width(),l=a=t||a>t&&a')}else{$jQ("#mChatSound").html('')}},notice:function(){if(!hasFocus){$jQ.titleAlert(mChatNewMessageAlert,{interval:1e3})}},toggle:function(e){$jQ("#mChat"+e).slideToggle("normal",function(){if($jQ("#mChat"+e).is(":visible")){$jQ.cookie("mChatShow"+e,"yes")}if($jQ("#mChat"+e).is(":hidden")){$jQ.cookie("mChatShow"+e,null)}})},add:function(){if($jQ("#mChatMessage").val()==""){return false}var e=$jQ("#mChatMessage").val().replace(/ /g,"");if(e.length>mChatMssgLngth&&mChatMssgLngth){alert(mChatMssgLngthLong);return}$jQ.ajax({url:mChatFile,timeout:1e4,type:"POST",data:$jQ("#postform").serialize(),async:true,dataType:"text",beforeSend:function(){$jQ("#submit_button").attr("disabled","disabled");if(mChatUserTimeout){clearInterval(activeinterval);clearInterval(counter)}clearInterval(interval)},success:function(){mChat.refresh()},error:function(e){if(e.status==400){alert(mChatFlood)}else if(e.status==403){alert(mChatNoAccess)}else if(e.status==501){alert(mChatNoMessageInput)}},complete:function(){if($jQ("#mChatData").children("#mChatNoMessage :last")){$jQ("#mChatNoMessage").remove()}$jQ("#submit_button").removeAttr("disabled");interval=setInterval(function(){mChat.refresh()},mChatRefresh);if(mChatUserTimeout){session_time=mChatUserTimeout?mChatUserTimeout/1e3:false;counter=setInterval(function(){mChat.countDown()},1e3);activeinterval=setInterval(function(){mChat.active()},mChatUserTimeout)}$jQ("#mChatMessage").val("").focus()}})},edit:function(id){var message=$jQ('#edit'+id).val();apprise(mChatEditInfo,{'textarea':message,'animate':true,'position':200,'confirm':true}, function(r){if(r){$jQ.ajax({url:mChatFile,timeout:10000,type:'POST',data:{mode:'edit',message_id:id,message:r},dataType:'text',beforeSend:function(){clearInterval(interval);if(mChatUserTimeout){clearInterval(activeinterval);clearInterval(counter);$jQ('#mChatSessTimer').html(mChatRefreshing)}},success:function(html){$jQ('#mess'+id).fadeOut('slow',function(){$jQ(this).replaceWith(html);$jQ('#mess'+id).css('display','none').fadeIn('slow')})},error:function(XMLHttpRequest){if(XMLHttpRequest.status==403){alert(mChatNoAccess)}else if(XMLHttpRequest.status==501){alert(mChatNoMessageInput)}},complete:function(){interval=setInterval(function(){mChat.refresh()},mChatRefresh);if(mChatUserTimeout){session_time=mChatUserTimeout?mChatUserTimeout/1000:false;counter=setInterval(function(){mChat.countDown()},1000);activeinterval=setInterval(function(){mChat.active()},mChatUserTimeout)}if(!mChatArchiveMode){scrH=$jQ('#mChatmain')[0].scrollHeight;window.setTimeout(function(){$jQ('#mChatmain')},1500)}}})}})},del:function(e){apprise(mChatDelConfirm,{'position':200,'animate':true,'confirm':true},function(del){if(del){$jQ.ajax({url:mChatFile,timeout:1e4,type:"POST",data:{mode:"delete",message_id:e},beforeSend:function(){clearInterval(interval);if(mChatUserTimeout){clearInterval(activeinterval);clearInterval(counter);$jQ("#mChatSessTimer").html(mChatRefreshing)}},success:function(){$jQ("#mess"+e).fadeOut("slow",function(){$jQ(this).remove()});mChat.sound(mChatForumRoot+"ext/dmzx/mchat/sounds/del.swf")},error:function(){alert(mChatNoAccess)},complete:function(){interval=setInterval(function(){mChat.refresh()},mChatRefresh);if(mChatUserTimeout){session_time=mChatUserTimeout?mChatUserTimeout/1e3:false;counter=setInterval(function(){mChat.countDown()},1e3);activeinterval=setInterval(function(){mChat.active()},mChatUserTimeout)}}})}else{return false;}});},refresh:function(){if(mChatArchiveMode){return}var e=0;if($jQ("#mChatData").children().not("#mChatNoMessage").length){if($jQ("#mChatNoMessage")){$jQ("#mChatNoMessage").remove()}if($jQ("#mChatData").children(":first").not("#mChatNoMessage").attr("id")!=undefined){e=$jQ("#mChatData").children(":first").attr("id").replace("mess","")}}$jQ.ajax({url:mChatFile,timeout:1e4,type:"POST",data:{mode:"read",message_last_id:e},dataType:"html",beforeSend:function(){$jQ("#mChatOkIMG,#mChatErrorIMG,#mChatPauseIMG").hide();$jQ("#mChatLoadIMG").show()},success:function(e){if(e!=""&&e!=0){if($jQ("#mChatRefreshText").hasClass("mchat-alert")){$jQ("#mChatRefreshText").removeClass("mchat-alert")}$jQ("#mChatData").prepend(e).children(":first").not("#mChatNoMessage");$jQ("#mChatData div:first").not("#mChatNoMessage").fadeIn("slow");mChat.sound(mChatForumRoot+"ext/dmzx/mchat/sounds/add.swf");mChat.notice()}setTimeout(function(){$jQ("#mChatLoadIMG,#mChatErrorIMG,#mChatPauseIMG").hide();$jQ("#mChatOkIMG").show();$jQ("#mChatRefreshText").html(mChatRefreshYes)},500)},error:function(){$jQ("#mChatLoadIMG,#mChatOkIMG,#mChatPauseIMG,#mChatRefreshTextNo,#mChatPauseIMG,").hide();$jQ("#mChatErrorIMG").show();mChat.sound(mChatForumRoot+"ext/dmzx/mchat/sounds/error.swf")},complete:function(){if(!$jQ("#mChatData").children(":first").length){$jQ("#mChatData").append('
'+mChatNoMessage+"
").show("slow")}}})},stats:function(){if(!mChatWhois){return}$jQ.ajax({url:mChatFile,timeout:1e4,type:"POST",data:{mode:"stats"},dataType:"html",beforeSend:function(){if(mChatCustomPage){$jQ("#mChatRefreshN").show();$jQ("#mChatRefresh").hide()}},success:function(data){var json = $.parseJSON(data);$jQ("#mChatStats").replaceWith(json.message);if(mChatCustomPage){setTimeout(function(){$jQ("#mChatRefreshN").hide();$jQ("#mChatRefresh").show()},500)}},error:function(){mChat.sound(mChatForumRoot+"ext/dmzx/mchat/sounds/error.swf")},complete:function(){if($jQ("#mChatUserList").length&&($jQ.cookie("mChatShowUserList")=="yes"||mChatCustomPage)){$jQ("#mChatUserList").css("display","block")}}})},active:function(){if(mChatArchiveMode||!mChatUserTimeout){return}clearInterval(interval);$jQ("#mChatLoadIMG,#mChatOkIMG,#mChatErrorIMG").hide();$jQ("#mChatPauseIMG").show();$jQ("#mChatRefreshText").html(mChatRefreshNo).addClass("mchat-alert");$jQ("#mChatSessMess").html(mChatSessOut).addClass("mchat-alert")}};var interval=setInterval(function(){mChat.refresh()},mChatRefresh);var statsinterval=setInterval(function(){mChat.stats()},mChatWhoisRefresh);var activeinterval=setInterval(function(){mChat.active()},mChatUserTimeout);var session_time=mChatUserTimeout?mChatUserTimeout/1e3:false;if(mChatUserTimeout){var counter=setInterval(function(){mChat.countDown()},1e3)}if($jQ.cookie("mChatShowSmiles")=="yes"&&$jQ("#mChatSmiles").css("display","none")){$jQ("#mChatSmiles").slideToggle("slow")}if($jQ.cookie("mChatShowBBCodes")=="yes"&&$jQ("#mChatBBCodes").css("display","none")){$jQ("#mChatBBCodes").slideToggle("slow")}if($jQ.cookie("mChatShowUserList")=="yes"&&$jQ("#mChatUserList").length){$jQ("#mChatUserList").slideToggle("slow")}if($jQ.cookie("mChatShowColour")=="yes"&&$jQ("#mChatColour").css("display","none")){$jQ("#mChatColour").slideToggle("slow")}$jQ("#mChatUseSound").change(function(){if($jQ(this).is(":checked")){$jQ.cookie("mChatNoSound",null)}else{$jQ.cookie("mChatNoSound","yes")}}) +function mChatTimeShow(id){var tid = parseInt(id);$(".mchatrow" + id).show();}function mChatTimeHide(id){var tid = parseInt(id);$(".mchatrow" + id).hide();} +// Apprise 1.5 by Daniel Raftery +// http://thrivingkings.com/apprise +// +// Button text added by Adam Bezulski +// +// Cached jQuery variables, position center added by Josiah Ruddell + +function apprise(a,b,c){a=''+a+"";var d={confirm:false,verify:false,input:false,textarea:false,animate:false,textOk:"Ok",textCancel:"Cancel",textYes:"Yes",textNo:"No",position:"center"};if(b){for(var e in d){if(typeof b[e]=="undefined")b[e]=d[e]}}var f=$(document).height(),g=$(document).width(),h=$('
'),i=$('
'),j=$('
'),k=$('
'),l=300;i.css({height:f,width:g}).appendTo("body").fadeIn(100,function(){$(this).css("filter","alpha(opacity=70)")});h.prependTo("body");j.append(a).appendTo(h);if(b){if(b["input"]){if(typeof b["input"]=="string"){j.append('
')}else{j.append('
')}$(".aTextbox").focus()}if(typeof b["textarea"]=="string"){j.append('
");$(".aEdit").focus()}}j.append(k);if(b){if(b["confirm"]||b["input"]){k.append('");k.append('")}else if(b["verify"]){k.append('");k.append('")}else{k.append('")}}else{k.append('')}h.css("left",($(window).width()-$(".appriseOuter").width())/2+$(window).scrollLeft()+"px");if(b){if(b["position"]&&b["position"]==="center"){l=(f-h.height())/2}if(b["animate"]){var m=b["animate"];if(isNaN(m)){m=400}h.css("top","-200px").show().animate({top:l},m)}else{h.css("top",l).fadeIn(200)}}else{h.css("top",l).fadeIn(200)}$(document).keydown(function(a){if(i.is(":visible")){if(a.shiftKey&&a.keyCode==13){$(".aEdit").append("
")}else if(a.keyCode==13){$('.aButtons > button[value="ok"]').click()}else if(a.keyCode==27){$('.aButtons > button[value="cancel"]').click()}}});var n=$(".aTextbox").val();if(!n){n=false}$(".aTextbox").bind('keydown blur',function(){n=$(this).val()});var o=$(".aEdit").val();if(!o){o=false}$(".aEdit").bind('keydown blur',function(){o=$(this).val()});$(".aButtons > button").click(function(){i.remove();h.remove();if(c){$(this).text("");var a=$(this).attr("value");if(a=="ok"){if(b){if(b["input"]){c(n)}else if(b["textarea"]){c(o)}else{c(true)}}else{c(true)};$('#mChatMessage').focus();}else if(a=="cancel"){c(false);$('#mChatMessage').focus();}}})} diff --git a/styles/prosilver/template/mchat_avatars.html b/styles/prosilver/template/mchat_avatars.html index cb95567..c86b48b 100644 --- a/styles/prosilver/template/mchat_avatars.html +++ b/styles/prosilver/template/mchat_avatars.html @@ -4,7 +4,7 @@
@ @ @ {mchatrow.MCHAT_USERNAME_FULL} {L_MCHAT_PM} - {mchatrow.MCHAT_TIME} - {L_REPLY_WITH_QUOTE} {L_MCHAT_IP} {mchatrow.MCHAT_USER_IP} {L_MCHAT_PERMISSIONS} {L_MCHAT_EDIT} {L_MCHAT_DELITE}
{mchatrow.MCHAT_MESSAGE}
+ {L_REPLY_WITH_LIKE}  {L_REPLY_WITH_QUOTE} {L_MCHAT_IP} {mchatrow.MCHAT_USER_IP} {L_MCHAT_PERMISSIONS} {L_MCHAT_EDIT} {L_MCHAT_DELITE}
{mchatrow.MCHAT_MESSAGE}
diff --git a/styles/prosilver/template/mchat_body.html b/styles/prosilver/template/mchat_body.html index 1d9eced..5c91e26 100644 --- a/styles/prosilver/template/mchat_body.html +++ b/styles/prosilver/template/mchat_body.html @@ -5,7 +5,11 @@ + + + + @@ -94,24 +98,44 @@ var mChatFocusFix = true; function insert_quote(user,text) - { - var quote = decodeURIComponent(text.replace(/\+/g, " ")); - quote = quote.replace(/</g, "<"); - quote = quote.replace(/>/g, ">"); - quote = quote.replace(/:/g, ':'); - quote = quote.replace(/./g, '.'); - quote = quote.replace(/&/g, '&'); - quote = quote.replace(/"/g, '"'); - var username = decodeURIComponent(user.replace(/\+/g, " ")); - username = username.replace(/</g, "<"); - username = username.replace(/>/g, ">"); - username = username.replace(/:/g, ':'); - username = username.replace(/./g, '.'); - username = username.replace(/&/g, '&'); - username = username.replace(/"/g, '"'); - document.getElementById('mChatMessage').value += '[quote="' + username + '"]' + ' ' + quote + '[/quote]'; - document.getElementById('mChatMessage').focus(); - } + { + var quote = decodeURIComponent(text.replace(/\+/g, " ")); + quote = quote.replace(/</g, "<"); + quote = quote.replace(/>/g, ">"); + quote = quote.replace(/:/g, ':'); + quote = quote.replace(/./g, '.'); + quote = quote.replace(/&/g, '&'); + quote = quote.replace(/"/g, '"'); + var username = decodeURIComponent(user.replace(/\+/g, " ")); + username = username.replace(/</g, "<"); + username = username.replace(/>/g, ">"); + username = username.replace(/:/g, ':'); + username = username.replace(/./g, '.'); + username = username.replace(/&/g, '&'); + username = username.replace(/"/g, '"'); + document.getElementById('mChatMessage').value += '[quote="' + username + '"]' + ' ' + quote + '[/quote]'; + document.getElementById('mChatMessage').focus(); + } + + function insert_like(user,text) + { + var quote = decodeURIComponent(text.replace(/\+/g, " ")); + quote = quote.replace(/</g, "<"); + quote = quote.replace(/>/g, ">"); + quote = quote.replace(/:/g, ':'); + quote = quote.replace(/./g, '.'); + quote = quote.replace(/&/g, '&'); + quote = quote.replace(/"/g, '"'); + var username = decodeURIComponent(user.replace(/\+/g, " ")); + username = username.replace(/</g, "<"); + username = username.replace(/>/g, ">"); + username = username.replace(/:/g, ':'); + username = username.replace(/./g, '.'); + username = username.replace(/&/g, '&'); + username = username.replace(/"/g, '"'); + document.getElementById('mChatMessage').value += 'Like\'s this post.[quote="' + username + '"]' + ' ' + quote + '[/quote]'; + document.getElementById('mChatMessage').focus(); + } // ]]>