diff --git a/contributors.txt b/contributors.txt new file mode 100644 index 000000000..1e7eedc3c --- /dev/null +++ b/contributors.txt @@ -0,0 +1,41 @@ +Уважаемые пользователи TorrentPier II! + +За помощь, оказанную в развитии нашего движка, выражаем особую благодарность нижеперечисленным участникам форума: + +******************************** +** Сборы марта 2013 года ** +******************************** + +emilio13 +UralSOFT +aik +Sarymian +eve +Алексей Письменский +qaqra +rserg99 +leszav +Dr_Brown +Bullit +Triceratop (http://goldenshara.com/) +Ramzess + +******************************** +** Сборы июня 2014 года ** +******************************** + +SamSeGo +alesel (http://sporttracker.kz/) +Bullit +igorsaevets +vasilich619 +wint1000 (http://asmlocator.ru/) + +******************************** +** Прочая информация ** +******************************** + +Большое вам всем спасибо за помощь. + +Если в данных списках кто-то не указан, либо если вы хотите указать дополнительно адрес своего трекера, отправьте письмо по адресу admin@torrentpier.me, +с указанием вашего ника на форуме и адреса вашего трекера, дабы мы могли вас добавить в этот список. \ No newline at end of file diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql index 7d8ec3069..32446cb43 100644 --- a/install/sql/mysql.sql +++ b/install/sql/mysql.sql @@ -590,7 +590,7 @@ INSERT INTO `bb_config` VALUES ('show_network_news', '1'); INSERT INTO `bb_config` VALUES ('max_net_title', '50'); INSERT INTO `bb_config` VALUES ('network_news_count', '5'); INSERT INTO `bb_config` VALUES ('network_news_forum_id', '2'); -INSERT INTO `bb_config` VALUES ('whois_info', 'http://ip-whois.net/ip_geo.php?ip='); +INSERT INTO `bb_config` VALUES ('whois_info', 'http://ip-whois.net/ip_geos.php?ip='); INSERT INTO `bb_config` VALUES ('show_mod_index', '0'); INSERT INTO `bb_config` VALUES ('premod', '0'); INSERT INTO `bb_config` VALUES ('new_tpls', '1'); diff --git a/upload/attach_mod/includes/functions_includes.php b/upload/attach_mod/includes/functions_includes.php index 01c48b5a2..d722b3a39 100644 --- a/upload/attach_mod/includes/functions_includes.php +++ b/upload/attach_mod/includes/functions_includes.php @@ -29,10 +29,7 @@ function attach_build_auth_levels($is_auth, &$s_auth_can) } // If you want to have the rules window link within the forum view too, comment out the two lines, and comment the third line -// $rules_link = '(Rules)'; -// $s_auth_can .= ( ( $is_auth['auth_attachments'] ) ? $rules_link . ' ' . $lang['RULES_ATTACH_CAN'] : $lang['RULES_ATTACH_CANNOT'] ) . '
'; $s_auth_can .= (($is_auth['auth_attachments']) ? $lang['RULES_ATTACH_CAN'] : $lang['RULES_ATTACH_CANNOT'] ) . '
'; - $s_auth_can .= (($is_auth['auth_download']) ? $lang['RULES_DOWNLOAD_CAN'] : $lang['RULES_DOWNLOAD_CANNOT'] ) . '
'; } @@ -206,8 +203,8 @@ function attachment_quota_settings($admin_mode, $submit = false, $mode) DB()->sql_freeresult($result); $template->assign_vars(array( - 'S_SELECT_UPLOAD_QUOTA' => quota_limit_select('group_upload_quota', $upload_quota), - 'S_SELECT_PM_QUOTA' => quota_limit_select('group_pm_quota', $pm_quota), + 'S_SELECT_UPLOAD_QUOTA' => quota_limit_select('group_upload_quota', $upload_quota), + 'S_SELECT_PM_QUOTA' => quota_limit_select('group_pm_quota', $pm_quota), )); } diff --git a/upload/config.php b/upload/config.php index 8f6a7fd09..4ddd077e6 100644 --- a/upload/config.php +++ b/upload/config.php @@ -55,8 +55,8 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do // Increase number of revision after update $bb_cfg['tp_version'] = '2.6 (RC)'; -$bb_cfg['tp_release_date'] = '15-05-2014'; -$bb_cfg['tp_release_state'] = 'R585'; +$bb_cfg['tp_release_date'] = '13-06-2014'; +$bb_cfg['tp_release_state'] = 'R586'; // Database $charset = 'utf8'; @@ -419,8 +419,6 @@ ini_set('error_log', LOG_DIR .'php_err.log'); if (get_magic_quotes_gpc()) die('Set magic_quotes off'); // JSON if (!function_exists('json_encode')) die('Json_encode not installed'); -// Tidy -if (!function_exists('tidy_repair_string')) die('Set $bb_cfg[\'tidy_post\'] = false in config.php'); // Triggers define('BB_ENABLED', TRIGGERS_DIR .'$on'); @@ -500,6 +498,9 @@ $bb_cfg['user_not_active_days_keep'] = 180; // inactive users but only wi // GroupCP $bb_cfg['groupcp_members_per_page'] = 300; +// Tidy +if ($bb_cfg['tidy_post'] && !function_exists('tidy_repair_string') or !extension_loaded('tidy')) die('Set $bb_cfg[\'tidy_post\'] = false in config.php'); + // Ads $bb_cfg['show_ads'] = false; $bb_cfg['show_ads_users'] = array( diff --git a/upload/includes/page_header.php b/upload/includes/page_header.php index 0cff054cd..ecf395504 100644 --- a/upload/includes/page_header.php +++ b/upload/includes/page_header.php @@ -8,8 +8,6 @@ if (defined('PAGE_HEADER_SENT')) return; global $page_cfg, $userdata, $user, $ads, $bb_cfg, $template, $lang, $images; $logged_in = (int) !empty($userdata['session_logged_in']); -$is_admin = ($logged_in && IS_ADMIN); -$is_mod = ($logged_in && IS_MOD); // Generate logged in/logged out status if ($logged_in) @@ -169,7 +167,7 @@ $template->assign_vars(array( 'SIMPLE_HEADER' => !empty($gen_simple_header), 'IN_ADMIN' => defined('IN_ADMIN'), - 'SHOW_ADS' => (!$logged_in || isset($bb_cfg['show_ads_users'][$user->id]) || (!($is_admin || $is_mod) && $user->show_ads)), + 'SHOW_ADS' => (!$logged_in || isset($bb_cfg['show_ads_users'][$user->id]) || (!IS_AM && $user->show_ads)), 'USER_HIDE_CAT' => (BB_SCRIPT == 'index'), 'USER_RUS' => ($userdata['user_lang'] != 'english') ? true : false, diff --git a/upload/language/lang_english/lang_main.php b/upload/language/lang_english/lang_main.php index 1643b58f2..cd98cf45d 100644 --- a/upload/language/lang_english/lang_main.php +++ b/upload/language/lang_english/lang_main.php @@ -1367,7 +1367,7 @@ $lang['DESIGNER'] = 'Designer'; $lang['LAST_IP'] = 'Last IP:'; $lang['REG_IP'] = 'Registration IP:'; $lang['OTHER_IP'] = 'Other IP:'; -$lang['ALREADY_REG_IP'] = 'With your IP-address is already registered user %s. If you have not previously registered on our tracker, mail to Administrator'; +$lang['ALREADY_REG_IP'] = 'With your IP-address is already registered user %s. If you have not previously registered on our tracker, mail to Administrator'; $lang['HIDDEN'] = 'Hidden'; // // That's all, Folks! diff --git a/upload/misc/js/bbcode.js b/upload/misc/js/bbcode.js index 08b555cd8..c6270e9de 100644 --- a/upload/misc/js/bbcode.js +++ b/upload/misc/js/bbcode.js @@ -1,45 +1,45 @@ -// BBCode control. (based on bbcode.js from http://forum.dklab.ru) +// BBCode control function BBCode(obj) { textarea = document.getElementById(obj); this.construct(textarea); } BBCode.prototype = { - VK_TAB: 9, - VK_ENTER: 13, - VK_PAGE_UP: 33, - BRK_OP: '[', - BRK_CL: ']', - textarea: null, - stext: '', - quoter: null, - qouted_pid: null, - collapseAfterInsert: false, - replaceOnInsert: false, + VK_TAB: 9, + VK_ENTER: 13, + VK_PAGE_UP: 33, + BRK_OP: '[', + BRK_CL: ']', + textarea: null, + stext: '', + quoter: null, + qouted_pid: null, + collapseAfterInsert: false, + replaceOnInsert: false, - // Create new BBCode control. - construct: function(textarea) { - this.textarea = textarea - this.tags = new Object(); - // Tag for quoting. - this.addTag( - '_quoter', - function() { return '[quote="'+th.quoter+'"][qpost='+th.qouted_pid+']' }, - '[/quote]\n', - null, - null, - function() { th.collapseAfterInsert=true; return th._prepareMultiline(th.quoterText) } - ); + // Create new BBCode control + construct: function(textarea) { + this.textarea = textarea + this.tags = new Object(); + // Tag for quoting + this.addTag( + '_quoter', + function() { return '[quote="'+th.quoter+'"][qpost='+th.qouted_pid+']' }, + '[/quote]\n', + null, + null, + function() { th.collapseAfterInsert=true; return th._prepareMultiline(th.quoterText) } + ); - // Init events. - var th = this; - addEvent(textarea, 'keydown', function(e) { return th.onKeyPress(e, window.HTMLElement? 'down' : 'press') }); - addEvent(textarea, 'keypress', function(e) { return th.onKeyPress(e, 'press') }); - }, + // Init events + var th = this; + addEvent(textarea, 'keydown', function(e) { return th.onKeyPress(e, window.HTMLElement? 'down' : 'press') }); + addEvent(textarea, 'keypress', function(e) { return th.onKeyPress(e, 'press') }); + }, - // Insert poster name or poster quotes to the text. - onclickPoster: function(name, post_id) { - var sel = this.getSelection()[0]; + // Insert poster name or poster quotes to the text + onclickPoster: function(name, post_id) { + var sel = this.getSelection()[0]; if (sel) { this.quoter = name; this.qouted_pid = post_id; @@ -74,244 +74,244 @@ BBCode.prototype = { return false; }, - // For stupid Opera - save selection before mouseover the button. + // For stupid Opera - save selection before mouseover the button refreshSelection: function(get) { - if (get) this.stext = this.getSelection()[0]; - else this.stext = ''; - }, + if (get) this.stext = this.getSelection()[0]; + else this.stext = ''; + }, - // Return current selection and range (if exists). - // In Opera, this function must be called periodically (on mouse over, - // for example), because on click stupid Opera breaks up the selection. - getSelection: function() { - var w = window; - var text='', range; - if (w.getSelection) { - // Opera & Mozilla? - text = w.getSelection(); - } else if (w.document.getSelection) { - // the Navigator 4.0x code - text = w.document.getSelection(); - } else if (w.document.selection && w.document.selection.createRange) { - // the Internet Explorer 4.0x code - range = w.document.selection.createRange(); - text = range.text; - } else { - return [null, null]; - } - if (text == '') text = this.stext; - text = ""+text; - text = text.replace("/^\s+|\s+$/g", ""); - return [text, range]; - }, + // Return current selection and range (if exists). + // In Opera, this function must be called periodically (on mouse over, + // for example), because on click stupid Opera breaks up the selection. + getSelection: function() { + var w = window; + var text='', range; + if (w.getSelection) { + // Opera & Mozilla? + text = w.getSelection(); + } else if (w.document.getSelection) { + // the Navigator 4.0x code + text = w.document.getSelection(); + } else if (w.document.selection && w.document.selection.createRange) { + // the Internet Explorer 4.0x code + range = w.document.selection.createRange(); + text = range.text; + } else { + return [null, null]; + } + if (text == '') text = this.stext; + text = ""+text; + text = text.replace("/^\s+|\s+$/g", ""); + return [text, range]; + }, - // Insert string at cursor position of textarea. - insertAtCursor: function(text) { - // Focus is placed to textarea. - var t = this.textarea; - t.focus(); - // Insert the string. - if (document.selection && document.selection.createRange) { - var r = document.selection.createRange(); - if (!this.replaceOnInsert) r.collapse(); - r.text = text; - } else if (t.setSelectionRange) { - var start = this.replaceOnInsert? t.selectionStart : t.selectionEnd; - var end = t.selectionEnd; - var sel1 = t.value.substr(0, start); - var sel2 = t.value.substr(end); - t.value = sel1 + text + sel2; - t.setSelectionRange(start+text.length, start+text.length); - } else{ - t.value += text; - } - // For IE. - setTimeout(function() { t.focus() }, 100); - }, + // Insert string at cursor position of textarea. + insertAtCursor: function(text) { + // Focus is placed to textarea. + var t = this.textarea; + t.focus(); + // Insert the string. + if (document.selection && document.selection.createRange) { + var r = document.selection.createRange(); + if (!this.replaceOnInsert) r.collapse(); + r.text = text; + } else if (t.setSelectionRange) { + var start = this.replaceOnInsert? t.selectionStart : t.selectionEnd; + var end = t.selectionEnd; + var sel1 = t.value.substr(0, start); + var sel2 = t.value.substr(end); + t.value = sel1 + text + sel2; + t.setSelectionRange(start+text.length, start+text.length); + } else{ + t.value += text; + } + // For IE. + setTimeout(function() { t.focus() }, 100); + }, - // Surround piece of textarea text with tags. - surround: function(open, close, fTrans) { - var t = this.textarea; - t.focus(); - if (!fTrans) fTrans = function(t) { return t; }; + // Surround piece of textarea text with tags. + surround: function(open, close, fTrans) { + var t = this.textarea; + t.focus(); + if (!fTrans) fTrans = function(t) { return t; }; - var rt = this.getSelection(); - var text = rt[0]; - var range = rt[1]; - if (text == null) return false; + var rt = this.getSelection(); + var text = rt[0]; + var range = rt[1]; + if (text == null) return false; - var notEmpty = text != null && text != ''; + var notEmpty = text != null && text != ''; - // Surround. - if (range) { - var notEmpty = text != null && text != ''; - var newText = open + fTrans(text) + (close? close : ''); - range.text = newText; - range.collapse(); - if (text != '') { - // Correction for stupid IE: \r for moveStart is 0 character. - var delta = 0; - for (var i=0; i= 0) text = "\n" + text + "\n"; - return text; - } + _prepareMultiline: function(text) { + text = text.replace(/\s+$/, ''); + text = text.replace(/^([ \t]*\r?\n)+/, ''); + if (text.indexOf("\n") >= 0) text = "\n" + text + "\n"; + return text; + } } // Emulation of innerText for Mozilla. if (window.HTMLElement && window.HTMLElement.prototype.__defineSetter__) { - HTMLElement.prototype.__defineSetter__("innerText", function (sText) { - this.innerHTML = sText.replace(/\&/g, "&").replace(//g, ">"); - }); - HTMLElement.prototype.__defineGetter__("innerText", function () { - var r = this.ownerDocument.createRange(); - r.selectNodeContents(this); - return r.toString(); - }); + HTMLElement.prototype.__defineSetter__("innerText", function (sText) { + this.innerHTML = sText.replace(/\&/g, "&").replace(//g, ">"); + }); + HTMLElement.prototype.__defineGetter__("innerText", function () { + var r = this.ownerDocument.createRange(); + r.selectNodeContents(this); + return r.toString(); + }); } function AddSelectedText(BBOpen, BBClose) { - if (document.post.message.caretPos) document.post.message.caretPos.text = BBOpen + document.post.message.caretPos.text + BBClose; - else document.post.message.value += BBOpen + BBClose; - document.post.message.focus() + if (document.post.message.caretPos) document.post.message.caretPos.text = BBOpen + document.post.message.caretPos.text + BBClose; + else document.post.message.value += BBOpen + BBClose; + document.post.message.focus() } function InsertBBCode(BBcode) @@ -323,7 +323,164 @@ function storeCaret(textEl) { if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate(); } -// Translit START +function initPostBBCode(context) +{ + $('span.post-hr', context).html('
'); + initCodes(context); + initQuotes(context); + initExternalLinks(context); + initPostImages(context); + initSpoilers(context); + initMedia(context); +} + +function initCodes(context) +{ + $('div.c-body', context).each(function(){ + var $c = $(this); + $c.before('
'+bbl['code']+':
'); + }); +} + +function initQuotes(context) +{ + $('div.q', context).each(function(){ + var $q = $(this); + var name = $(this).attr('head'); + var q_title = (name ? ''+name+' '+bbl['wrote']+':' : ''+bbl['quote']+''); + if ( quoted_pid = $q.children('u.q-post:first').text() ) { + var on_this_page = $('#post_'+quoted_pid).length; + var href = (on_this_page) ? '#'+ quoted_pid : './viewtopic.php?p='+ quoted_pid +'#'+ quoted_pid; + q_title += ' '; + } + $q.before('
'+ q_title +'
'); + }); +} + +function initPostImages(context) +{ + if (hidePostImg) return; + var $in_spoilers = $('div.sp-body var.postImg', context); + $('var.postImg', context).not($in_spoilers).each(function(){ + var $v = $(this); + var src = $v.attr('title'); + var $img = $('pic'); + $img = fixPostImage($img); + var maxW = ($v.hasClass('postImgAligned')) ? postImgAligned_MaxWidth : postImg_MaxWidth; + $img.bind('click', function(){ return imgFit(this, maxW); }); + if (user.opt_js.i_aft_l) { + $('#preload').append($img); + var loading_icon = ''; + $v.html(loading_icon); + if ($.browser.msie) { + $v.after(''); + } + $img.one('load', function(){ + imgFit(this, maxW); + $v.empty().append(this); + }); + } + else { + $img.one('load', function(){ imgFit(this, maxW) }); + $v.empty().append($img); + if ($.browser.msie) { + $v.after(''); + } + } + }); + $('var.posterImg', context).each(function(){ + var $v = $(this); + var src = $v.attr('title'); + var $img = $(''+bbl['loading']+''); + $img = fixPostImage($img); + $v.empty().append($img); + if ($.browser.msie) { + $v.after(''); + } + }); +} + +function initSpoilers(context) +{ + $('div.sp-body', context).each(function(){ + var $sp_body = $(this); + var name = $.trim(this.title) || ''+bbl['spoiler_head']+''; + this.title = ''; + var $sp_head = $('
'+ name +'
'); + $sp_head.insertBefore($sp_body).click(function(e){ + if (!$sp_body.hasClass('inited')) { + initPostImages($sp_body); + var $sp_fold_btn = $('
['+bbl['spoiler_close']+']
').click(function(){ + $.scrollTo($sp_head, { duration:200, axis:'y', offset:-200 }); + $sp_head.click().animate({opacity: 0.1}, 500).animate({opacity: 1}, 700); + }); + $sp_body.prepend('
').append('
').append($sp_fold_btn).addClass('inited'); + } + if (e.shiftKey) { + e.stopPropagation(); + e.shiftKey = false; + var fold = $(this).hasClass('unfolded'); + $('div.sp-head', $($sp_body.parents('td')[0])).filter( function(){ return $(this).hasClass('unfolded') ? fold : !fold } ).click(); + } + else { + $(this).toggleClass('unfolded'); + $sp_body.slideToggle('fast'); + } + }); + }); +} + +function initExternalLinks(context) +{ + var context = context || 'body'; + if (ExternalLinks_InNewWindow) { + $("a.postLink:not([href*='"+ window.location.hostname +"/'])", context).attr({ target: '_blank' }); + } +} + +function fixPostImage ($img) +{ + var banned_image_hosts = /imagebanana|hidebehind/i; + var src = $img[0].src; + if (src.match(banned_image_hosts)) { + $img.wrap('').attr({ src: ""+bb_url+"images/tr_oops.gif", title: ""+bbl['scr_rules']+"" }); + } + return $img; +} + +function initMedia(context) +{ + var apostLink = $('a.postLink', context); + for (var i = 0; i < apostLink.length; i++) { + var link = apostLink[i]; + if (typeof link.href != 'string') { + continue; + } + if (/^http(?:s|):\/\/www.youtube.com\/watch\?(.*)?(&?v=([a-z0-9\-_]+))(.*)?|http:\/\/youtu.be\/.+/i.test(link.href)) { + var a = document.createElement('span'); + a.className = 'YTLink'; + a.innerHTML = ''; + window.addEvent(a, 'click', function (e) { + var vhref = e.target.nextSibling.href.replace(/^http(?:s|):\/\/www.youtube.com\/watch\?(.*)?(&?v=([a-z0-9\-_]+))(.*)?|http:\/\/youtu.be\//ig, "http://www.youtube.com/embed/$3"); + var text = e.target.nextSibling.innerText != "" ? e.target.nextSibling.innerText : e.target.nextSibling.href; + $('#Panel_youtube').remove(); + ypanel('youtube', { + title: '' + text + '', + resizing: 0, + width: 862, + height: 550, + content: '' + }); + }); + link.parentNode.insertBefore(a, link); + a.appendChild(link); + } + } +} + +$(document).ready(function(){ + $('div.post_wrap, div.signature').each(function(){ initPostBBCode( $(this) ) }); +}); // One character letters var t_table1 = "ABVGDEZIJKLMNOPRSTUFXHCYWabvgdezijklmnoprstufxhcyw'#"; @@ -343,91 +500,90 @@ var tagArray = [ function translit2win (str) { - var len = str.length; - var new_str = ""; + var len = str.length; + var new_str = ""; - for (i = 0; i < len; i++) - { - /* non-translatable text must be in ^ */ - if(str.substr(i).indexOf("^")==0){ - end_len=str.substr(i+1).indexOf("^")+2; - if (end_len>1){ - new_str+=str.substr(i,end_len); - i += end_len - 1; - continue; - } - } + for (i = 0; i < len; i++) + { + /* non-translatable text must be in ^ */ + if(str.substr(i).indexOf("^")==0){ + end_len=str.substr(i+1).indexOf("^")+2; + if (end_len>1){ + new_str+=str.substr(i,end_len); + i += end_len - 1; + continue; + } + } - /* Skipping emoticons */ - if(str.substr(i).indexOf(":")==0){ - iEnd = str.substr(i+1).indexOf(":")+2; - if (iEnd > 1 && str.substr(i,iEnd).match("^:[a-zA-Z0-9]+:$")){ - new_str += str.substr(i,iEnd); - i += iEnd - 1; - continue; - } - } + /* Skipping emoticons */ + if(str.substr(i).indexOf(":")==0){ + iEnd = str.substr(i+1).indexOf(":")+2; + if (iEnd > 1 && str.substr(i,iEnd).match("^:[a-zA-Z0-9]+:$")){ + new_str += str.substr(i,iEnd); + i += iEnd - 1; + continue; + } + } - /* Skipping http|news|ftp:/.../ links */ - rExp = new RegExp("^((http|https|news|ftp|ed2k):\\/\\/[\\/a-zA-Z0-9%_?.:;&#|\(\)+=@-]+)","i"); - if (newArr = str.substr(i).match(rExp)){ - new_str += newArr[1]; - i += newArr[1].length - 1; - continue; - } + /* Skipping http|news|ftp:/.../ links */ + rExp = new RegExp("^((http|https|news|ftp|ed2k):\\/\\/[\\/a-zA-Z0-9%_?.:;&#|\(\)+=@-]+)","i"); + if (newArr = str.substr(i).match(rExp)){ + new_str += newArr[1]; + i += newArr[1].length - 1; + continue; + } - /* Skipping FONT, COLOR, SIZE tags */ - rExp = new RegExp("^(\\[\\/?(b|i|u|s|font(=[a-z0-9]+)?|size(=[0-9]+)?|color(=#?[a-z0-9]+)?)\\])","i"); - if (newArr = str.substr(i).match(rExp)){ - new_str += newArr[1]; - i += newArr[1].length - 1; - continue; - } + /* Skipping FONT, COLOR, SIZE tags */ + rExp = new RegExp("^(\\[\\/?(b|i|u|s|font(=[a-z0-9]+)?|size(=[0-9]+)?|color(=#?[a-z0-9]+)?)\\])","i"); + if (newArr = str.substr(i).match(rExp)){ + new_str += newArr[1]; + i += newArr[1].length - 1; + continue; + } - /* Skipping [QUOTE]..[/QUOTE], [IMG]..[/IMG], [CODE]..[/CODE], [SQL]..[/SQL], [EMAIL]..[/EMAIL] tags */ - bSkip = false; - for(j = 0; j < tagArray.length; j += 2){ - rExp = new RegExp("^(\\["+tagArray[j]+tagArray[j+1]+"\\])","i"); - if (newArr = str.substr(i).match(rExp)){ - rExp = new RegExp("\\[\\/" + tagArray[j] + "\\]", "i"); - if (iEnd = str.substr(i + newArr[1].length + 2).search(rExp)){ - end_len = iEnd + newArr[1].length + tagArray[j].length + 4; - new_str += str.substr(i,end_len); - i += end_len - 1; - bSkip = true; - } - } - if(bSkip)break; - } - if(bSkip)continue; + /* Skipping [QUOTE]..[/QUOTE], [IMG]..[/IMG], [CODE]..[/CODE], [SQL]..[/SQL], [EMAIL]..[/EMAIL] tags */ + bSkip = false; + for(j = 0; j < tagArray.length; j += 2){ + rExp = new RegExp("^(\\["+tagArray[j]+tagArray[j+1]+"\\])","i"); + if (newArr = str.substr(i).match(rExp)){ + rExp = new RegExp("\\[\\/" + tagArray[j] + "\\]", "i"); + if (iEnd = str.substr(i + newArr[1].length + 2).search(rExp)){ + end_len = iEnd + newArr[1].length + tagArray[j].length + 4; + new_str += str.substr(i,end_len); + i += end_len - 1; + bSkip = true; + } + } + if(bSkip)break; + } + if(bSkip)continue; - // Check for 2-character letters - is2char=false; - if (i < len-1) { - for(j = 0; j < w_table2.length; j++) - { - if(str.substr(i, 2) == t_table2.substr(j*2,2)) { - new_str+= w_table2.substr(j, 1); - i++; - is2char=true; - break; - } - } - } + // Check for 2-character letters + is2char=false; + if (i < len-1) { + for(j = 0; j < w_table2.length; j++) + { + if(str.substr(i, 2) == t_table2.substr(j*2,2)) { + new_str+= w_table2.substr(j, 1); + i++; + is2char=true; + break; + } + } + } - if(!is2char) { - // Convert one-character letter - var c = str.substr(i, 1); - var pos = t_table1.indexOf(c); - if (pos < 0) - new_str+= c; - else - new_str+= w_table1.substr(pos, 1); - } - } + if(!is2char) { + // Convert one-character letter + var c = str.substr(i, 1); + var pos = t_table1.indexOf(c); + if (pos < 0) + new_str+= c; + else + new_str+= w_table1.substr(pos, 1); + } + } -// document.REPLIER.Post.focus(); - return new_str; + return new_str; } function transliterate (msg, e) @@ -439,5 +595,4 @@ function transliterate (msg, e) } if (e) e.disabled = false; }, 1); -} -// Translit END \ No newline at end of file +} \ No newline at end of file diff --git a/upload/templates/default/page_header.tpl b/upload/templates/default/page_header.tpl index 2e1142425..f1bc37c39 100644 --- a/upload/templates/default/page_header.tpl +++ b/upload/templates/default/page_header.tpl @@ -21,6 +21,9 @@ window.encURL = encodeURIComponent; +