mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 02:27:34 -07:00
Удаление системы транслитерации из движка.
Отсутствует возможность поддерживать сложную систему транслитерации, тем более на нескольких языках. Пользователям следует посоветовать использование сайтов наподобие http://translit.net/ для этой цели.
This commit is contained in:
parent
d3b8049006
commit
cd8c7aa4b0
12 changed files with 14 additions and 281 deletions
|
@ -69,8 +69,8 @@ $domain_name = 'torrentpier.me'; // enter here your primary domain name of your
|
|||
$domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $domain_name;
|
||||
|
||||
// Version info
|
||||
$bb_cfg['tp_version'] = '2.1.2';
|
||||
$bb_cfg['tp_release_date'] = '20-10-2014';
|
||||
$bb_cfg['tp_version'] = '2.1.3';
|
||||
$bb_cfg['tp_release_date'] = '**-10-2014';
|
||||
$bb_cfg['tp_release_state'] = 'ALPHA';
|
||||
|
||||
// Database
|
||||
|
|
|
@ -1966,17 +1966,6 @@ function topic_attachment_image($switch_attachment)
|
|||
return '<img src="styles/images/icon_clip.gif" alt="" border="0" /> ';
|
||||
}
|
||||
|
||||
function transliterate ($str)
|
||||
{
|
||||
static $translit_table;
|
||||
|
||||
if (!isset($translit_table))
|
||||
{
|
||||
require(DEFAULT_LANG_DIR .'translit_table.php');
|
||||
}
|
||||
return strtr($str, $translit_table);
|
||||
}
|
||||
|
||||
/**
|
||||
* array_combine()
|
||||
*
|
||||
|
|
|
@ -109,7 +109,7 @@ class upload_common
|
|||
$this->errors[] = sprintf($lang['UPLOAD_ERROR_NOT_ALLOWED'], htmlCHR($this->file_ext));
|
||||
return false;
|
||||
}
|
||||
$this->file_ext_id = @$this->ext_ids[$this->file_ext];
|
||||
$this->file_ext_id = $this->ext_ids[$this->file_ext];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1325,7 +1325,6 @@ $lang['BOT_AFTER_SPLIT_TO_NEW'] = 'Add bot-message about split to <b>new topic</
|
|||
$lang['QUICK_REPLY'] = 'Quick Reply';
|
||||
$lang['INS_NAME_TIP'] = 'Insert name or selected text.';
|
||||
$lang['QUOTE_SELECTED'] = 'Quote selected';
|
||||
$lang['TRANSLIT_RULES'] = 'Translit rules';
|
||||
$lang['QR_ATTACHSIG'] = 'Attach signature';
|
||||
$lang['QR_NOTIFY'] = 'Notify on reply';
|
||||
$lang['QR_DISABLE'] = 'Disable';
|
||||
|
@ -1517,8 +1516,6 @@ $lang['LIST'] = 'List';
|
|||
$lang['LIST_TITLE'] = 'List: [list]text[/list] (Ctrl+l)';
|
||||
$lang['LIST_ITEM'] = 'Ordered list: [list=]text[/list] (Ctrl+O)';
|
||||
$lang['QUOTE_SEL'] = 'Quote selected';
|
||||
$lang['TRANSLIT'] = 'Translit';
|
||||
$lang['TRANSLIT_TITLE'] = 'Translit selected to russian';
|
||||
$lang['JAVASCRIPT_ON'] = 'Heads necessary to send messages to enable JavaScript';
|
||||
|
||||
$lang['NEW'] = 'New';
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
<?php
|
||||
|
||||
$translit_table = array(
|
||||
# 'from' => 'to',
|
||||
);
|
|
@ -1325,7 +1325,6 @@ $lang['BOT_AFTER_SPLIT_TO_NEW'] = 'Добавить сообщение о раз
|
|||
$lang['QUICK_REPLY'] = 'Быстрый ответ';
|
||||
$lang['INS_NAME_TIP'] = 'Вставить имя или выделенный кусок сообщения.';
|
||||
$lang['QUOTE_SELECTED'] = 'Цитировать выделенный текст';
|
||||
$lang['TRANSLIT_RULES'] = 'Правила транслита';
|
||||
$lang['QR_ATTACHSIG'] = 'Присоединить подпись';
|
||||
$lang['QR_NOTIFY'] = 'Уведомлять об ответах';
|
||||
$lang['QR_DISABLE'] = 'Отключить';
|
||||
|
@ -1517,8 +1516,6 @@ $lang['LIST'] = 'Список';
|
|||
$lang['LIST_TITLE'] = 'Список: [list]текст[/list] (Ctrl+L)';
|
||||
$lang['LIST_ITEM'] = 'Нумерованный список: [list=]текст[/list] (Ctrl+O)';
|
||||
$lang['QUOTE_SEL'] = 'Цит.выдел';
|
||||
$lang['TRANSLIT'] = 'Транслит';
|
||||
$lang['TRANSLIT_TITLE'] = 'Перевести выделение из транслита на русский';
|
||||
$lang['JAVASCRIPT_ON'] = 'Для отправки сообщений необходимо включить JavaScript';
|
||||
|
||||
$lang['NEW'] = 'Новое';
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
<?php
|
||||
|
||||
$translit_table = array(
|
||||
'ё' => 'e', 'Ё' => 'E',
|
||||
'а' => 'a', 'А' => 'A',
|
||||
'б' => 'b', 'Б' => 'B',
|
||||
'в' => 'v', 'В' => 'V',
|
||||
'г' => 'g', 'Г' => 'G',
|
||||
'д' => 'd', 'Д' => 'D',
|
||||
'е' => 'e', 'Е' => 'E',
|
||||
'ж' => 'zh', 'Ж' => 'ZH',
|
||||
'з' => 'z', 'З' => 'Z',
|
||||
'и' => 'i', 'И' => 'I',
|
||||
'й' => 'y', 'Й' => 'Y',
|
||||
'к' => 'k', 'К' => 'K',
|
||||
'л' => 'l', 'Л' => 'L',
|
||||
'м' => 'm', 'М' => 'M',
|
||||
'н' => 'n', 'Н' => 'N',
|
||||
'о' => 'o', 'О' => 'O',
|
||||
'п' => 'p', 'П' => 'P',
|
||||
'р' => 'r', 'Р' => 'R',
|
||||
'с' => 's', 'С' => 'S',
|
||||
'т' => 't', 'Т' => 'T',
|
||||
'у' => 'u', 'У' => 'U',
|
||||
'ф' => 'f', 'Ф' => 'F',
|
||||
'х' => 'h', 'Х' => 'H',
|
||||
'ц' => 'c', 'Ц' => 'C',
|
||||
'ч' => 'ch', 'Ч' => 'CH',
|
||||
'ш' => 'sh', 'Ш' => 'SH',
|
||||
'щ' => 'sh', 'Щ' => 'SH',
|
||||
'ъ' => "'", 'Ъ' => "'",
|
||||
'ы' => 'y', 'Ы' => 'Y',
|
||||
'ь' => "'", 'Ь' => "'",
|
||||
'э' => 'e', 'Э' => 'E',
|
||||
'ю' => 'yu', 'Ю' => 'YU',
|
||||
'я' => 'ya', 'Я' => 'YA',
|
||||
);
|
|
@ -1325,7 +1325,6 @@ $lang['BOT_AFTER_SPLIT_TO_NEW'] = 'Додати повідомлення про
|
|||
$lang['QUICK_REPLY'] = 'Швидка відповідь';
|
||||
$lang['INS_NAME_TIP'] = "Вставити ім'я або виділений шматок повідомлення.";
|
||||
$lang['QUOTE_SELECTED'] = 'Цитувати виділений текст';
|
||||
$lang['TRANSLIT_RULES'] = 'Правила трансліту';
|
||||
$lang['QR_ATTACHSIG'] = 'Приєднати підпис';
|
||||
$lang['QR_NOTIFY'] = 'Повідомляти про відповіді';
|
||||
$lang['QR_DISABLE'] = 'Відключити';
|
||||
|
@ -1517,8 +1516,6 @@ $lang['LIST'] = 'Список';
|
|||
$lang['LIST_TITLE'] = 'Список: [list]текст[/list] (Ctrl+L)';
|
||||
$lang['LIST_ITEM'] = 'Нумерований список: [list=]текст[/list] (Ctrl+O)';
|
||||
$lang['QUOTE_SEL'] = 'Цит.виділ';
|
||||
$lang['TRANSLIT'] = 'Трансліт';
|
||||
$lang['TRANSLIT_TITLE'] = 'Перевести виділення з трансліту на українську';
|
||||
$lang['JAVASCRIPT_ON'] = 'Для надсилання повідомлень необхідно включити JavaScript';
|
||||
|
||||
$lang['NEW'] = 'Нове';
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
<?php
|
||||
|
||||
$translit_table = array(
|
||||
'є' => 'ye', 'Є' => 'YE',
|
||||
'а' => 'a', 'А' => 'A',
|
||||
'б' => 'b', 'Б' => 'B',
|
||||
'в' => 'v', 'В' => 'V',
|
||||
'г' => 'g', 'Г' => 'G',
|
||||
'д' => 'd', 'Д' => 'D',
|
||||
'е' => 'e', 'Е' => 'E',
|
||||
'ж' => 'zh', 'Ж' => 'ZH',
|
||||
'з' => 'z', 'З' => 'Z',
|
||||
'и' => 'y', 'И' => 'Y',
|
||||
'i' => 'i', 'I' => 'I',
|
||||
'ї' => 'yi', 'Ї' => 'YI',
|
||||
'й' => 'y', 'Й' => 'Y',
|
||||
'к' => 'k', 'К' => 'K',
|
||||
'л' => 'l', 'Л' => 'L',
|
||||
'м' => 'm', 'М' => 'M',
|
||||
'н' => 'n', 'Н' => 'N',
|
||||
'о' => 'o', 'О' => 'O',
|
||||
'п' => 'p', 'П' => 'P',
|
||||
'р' => 'r', 'Р' => 'R',
|
||||
'с' => 's', 'С' => 'S',
|
||||
'т' => 't', 'Т' => 'T',
|
||||
'у' => 'u', 'У' => 'U',
|
||||
'ф' => 'f', 'Ф' => 'F',
|
||||
'х' => 'h', 'Х' => 'H',
|
||||
'ц' => 'c', 'Ц' => 'C',
|
||||
'ч' => 'ch', 'Ч' => 'CH',
|
||||
'ш' => 'sh', 'Ш' => 'SH',
|
||||
'щ' => 'sh', 'Щ' => 'SH',
|
||||
'ь' => "'", 'Ь' => "'",
|
||||
'ю' => 'yu', 'Ю' => 'YU',
|
||||
'я' => 'ya', 'Я' => 'YA',
|
||||
"'" => "'",
|
||||
);
|
|
@ -453,119 +453,4 @@ function initMedia(context)
|
|||
|
||||
$(document).ready(function(){
|
||||
$('div.post_wrap, div.signature').each(function(){ initPostBBCode( $(this) ) });
|
||||
});
|
||||
|
||||
// One character letters
|
||||
var t_table1 = "ABVGDEZIJKLMNOPRSTUFXHCYWabvgdezijklmnoprstufxhcyw'#";
|
||||
var w_table1 = "АБВГДЕЗИЙКЛМНОПРСТУФХХЦЫЩабвгдезийклмнопрстуфххцыщьъ";
|
||||
|
||||
// Two character letters
|
||||
var t_table2 = "EHSZYOJOZHCHSHYUJUYAJAehszyojozhchshyujuyajaEhSzYoJoZhChShYuJuYaJa";
|
||||
var w_table2 = "ЭЩЁЁЖЧШЮЮЯЯэщёёжчшююяяЭЩЁЁЖЧШЮЮЯЯ";
|
||||
|
||||
var tagArray = [
|
||||
'code', '',
|
||||
'img', '',
|
||||
'quote', "(=[\"']?[^"+String.fromCharCode(92,93)+"]+)?",
|
||||
'email', "(=[\"']?[a-zA-Z0-9_.-]+@?[a-zA-Z0-9_.-]+[\"']?)?",
|
||||
'url', "(=[\"']?[^ \"'"+String.fromCharCode(92,93)+"]*[\"']?)?"
|
||||
];
|
||||
|
||||
function translit2win (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;
|
||||
}
|
||||
}
|
||||
|
||||
/* 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 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;
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
return new_str;
|
||||
}
|
||||
|
||||
function transliterate (msg, e)
|
||||
{
|
||||
if (e) e.disabled = true;
|
||||
setTimeout(function() {
|
||||
if (!bbcode.surround('', '', translit2win)) {
|
||||
msg.value = translit2win(msg.value);
|
||||
}
|
||||
if (e) e.disabled = false;
|
||||
}, 1);
|
||||
}
|
||||
});
|
|
@ -465,16 +465,11 @@ table.pm_box_size { width: 175px; margin: 8px 2px; }
|
|||
.pm_box_size b { font-size: 10px; }
|
||||
.pm_nav td { padding: 4px; font-size: 14px; font-weight: bold; }
|
||||
|
||||
table.translit_expl th {
|
||||
width: 30px; padding-right: 8px; font-weight: bold; text-align: right;
|
||||
}
|
||||
table.translit_expl td { width: 14px; }
|
||||
|
||||
table.user_contacts th { text-align: right; white-space: nowrap; }
|
||||
.user_contacts td { text-align: left; padding: 2px 6px; white-space: nowrap; }
|
||||
.user_contacts td { text-align: left; padding: 2px 6px; white-space: nowrap; }
|
||||
|
||||
table.user_details th { padding: 2px 6px; text-align: right; vertical-align: top; }
|
||||
.user_details td { width: 70%; }
|
||||
.user_details td { width: 70%; }
|
||||
|
||||
table.usercp_register h6 {
|
||||
margin: 0.3em 0.4em; color: #444444; line-height: 100%;
|
||||
|
|
|
@ -85,63 +85,16 @@ ajax.callback.posts = function(data) {
|
|||
<input type="button" value="{L_CODE}" name="codeCode" title="{L_CODE_TITLE}" style="width: 43px;" />
|
||||
<input type="button" value="{L_LIST}" name="codeList" title="{L_LIST_TITLE}" style="width: 60px;"/>
|
||||
<input type="button" value="1." name="codeOpt" title="{L_LIST_ITEM}" style="width: 30px;" />
|
||||
<input type="button" value="{L_QUOTE_SEL}" name="quoteselected" title="{L_QUOTE_SELECTED}" onclick="bbcode.onclickQuoteSel();" />
|
||||
<!-- IF USER_LANG != 'en' -->
|
||||
<input type="button" value="{L_TRANSLIT}" name="Translit" title="{L_TRANSLIT_TITLE}" style="width: 68px;" onclick="transliterate(document.post.message, this);" /> <a href="#" onclick="toggle_block('translit_opt'); return false"><span style="color: darkred"><b>?</b></span></a>
|
||||
<!-- ENDIF -->
|
||||
<input type="button" value="{L_QUOTE_SEL}" name="quoteselected" title="{L_QUOTE_SELECTED}" onclick="bbcode.onclickQuoteSel();" />
|
||||
</div>
|
||||
|
||||
<textarea
|
||||
class="editor mrg_4" name="message" id="message" rows="18" cols="92"
|
||||
onfocus = "storeCaret(this);"
|
||||
onselect = "storeCaret(this);"
|
||||
onclick = "storeCaret(this);"
|
||||
onkeyup = "storeCaret(this);"
|
||||
>{MESSAGE}</textarea>
|
||||
|
||||
<!-- IF USER_LANG != 'en' -->
|
||||
<div id="translit_opt" class="mrg_4" style="display: none;">
|
||||
<table cellspacing="0" class="translit_expl borderless bCenter">
|
||||
<tr>
|
||||
<th>А</th><td>-</td><td>a</td>
|
||||
<th>Д</th><td>-</td><td>d</td>
|
||||
<th>И</th><td>-</td><td>i</td>
|
||||
<th>М</th><td>-</td><td>m</td>
|
||||
<th>Р</th><td>-</td><td>r</td>
|
||||
<th>Ф</th><td>-</td><td>f</td>
|
||||
<th>Ш</th><td>-</td><td>sh</td>
|
||||
<th>Ы</th><td>-</td><td>y</td>
|
||||
</tr><tr>
|
||||
<th>Б</th><td>-</td><td>b</td>
|
||||
<th>Е</th><td>-</td><td>e</td>
|
||||
<th>Й</th><td>-</td><td>j</td>
|
||||
<th>Н</th><td>-</td><td>n</td>
|
||||
<th>С</th><td>-</td><td>s</td>
|
||||
<th>Х</th><td>-</td><td>h,x</td>
|
||||
<th>Щ</th><td>-</td><td>sz,w</td>
|
||||
<th>Э</th><td>-</td><td>eh</td>
|
||||
</tr><tr>
|
||||
<th>В</th><td>-</td><td>v</td>
|
||||
<th>Ж</th><td>-</td><td>zh</td>
|
||||
<th>К</th><td>-</td><td>k</td>
|
||||
<th>О</th><td>-</td><td>o</td>
|
||||
<th>Т</th><td>-</td><td>t</td>
|
||||
<th>Ц</th><td>-</td><td>c</td>
|
||||
<th>Ь</th><td>-</td><td>'</td>
|
||||
<th>Ю</th><td>-</td><td>ju</td>
|
||||
</tr><tr>
|
||||
<th>Г</th><td>-</td><td>g</td>
|
||||
<th>З</th><td>-</td><td>z</td>
|
||||
<th>Л</th><td>-</td><td>l</td>
|
||||
<th>П</th><td>-</td><td>p</td>
|
||||
<th>У</th><td>-</td><td>u</td>
|
||||
<th>Ч</th><td>-</td><td>ch</td>
|
||||
<th>Ъ</th><td>-</td><td>#</td>
|
||||
<th>Я</th><td>-</td><td>ja</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
<textarea
|
||||
class="editor mrg_4" name="message" id="message" rows="18" cols="92"
|
||||
onfocus = "storeCaret(this);"
|
||||
onselect = "storeCaret(this);"
|
||||
onclick = "storeCaret(this);"
|
||||
onkeyup = "storeCaret(this);"
|
||||
>{MESSAGE}</textarea>
|
||||
|
||||
<div class="mrg_8 tCenter">
|
||||
<div id="post-buttons-block" style="display: none;">
|
||||
|
@ -157,7 +110,6 @@ ajax.callback.posts = function(data) {
|
|||
function dis_submit_btn ()
|
||||
{
|
||||
$('#post-submit-btn').attr('disabled', 1);
|
||||
//debounce('post-submit-btn', 3000);
|
||||
}
|
||||
|
||||
function debounce (el_id, time_ms)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue