Код: Выделить всё
##############################################################
## MOD Title: Russian Keyboard
## MOD Author: [R: R@m$e$ :U] < Ramses@FromRU.com > (Ramses) http://www.phpbbguru.net
## MOD Description: Adds buttons with russian alphabet
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: ~5 Minutes
## Files To Edit:
## language/lang_english/lang_main.php
## language/lang_russian/lang_main.php
## templates/subSilver/posting_body.tpl
## posting.php
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbbguru.net/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum.
##############################################################
## Author Notes:
## This needed in russian forums, where many people from other countrys,
## and they haven't russian keyboards =)
##
## Thanks to Kiba from 95.ru for idea...
## But version for 95.ru i lose...
## And write new... New version you can see... =)
##
## Find bug? Write here - http://www.phpbbguru.net/community/viewtopic.php?t=1980
## plz =)
##
##############################################################
## MOD History:
##
## 2005-03-01 - Version 1.0.0
## - First version =)))
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Russian Keyboard
$lang['Caps'] = 'Caps';
$lang['Scroll'] = 'Scroll';
// [end] Russian Keyboard
#
#-----[ OPEN ]------------------------------------------
#
language/lang_russian/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Russian Keyboard
$lang['Caps'] = 'Строчные';
$lang['Scroll'] = 'Прописные';
// [end] Russian Keyboard
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/posting_body.tpl
#
#-----[ FIND ]------------------------------------------
#
// Insert at Claret position. Code from
// http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
function storeCaret(textEl) {
if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
keys_caps = new Array('А','Б','В','Г','Д','Е','Ё','Ж','З','И','Й','К','Л','М','Н','О','П','Р','С','Т','У','Ф','Х','Ц','Ч','Ш','Щ','Ъ','Ы','Ь','Э','Ю','Я');
keys_scroll = new Array('а','б','в','г','д','е','ё','ж','з','и','й','к','л','м','н','о','п','р','с','т','у','ф','х','ц','ч','ш','щ','ъ','ы','ь','э','ю','я');
function letters(letter) {
for(i = 0; i < 33; i++) {
if (letter == 'caps'){j = keys_caps[i];}
else if (letter == 'scroll'){j = keys_scroll[i];}
if ((i == 11) || (i == 22)){document.write('</tr><tr>');}
document.write('<td><input type="button" class="mainoption" style="width: 25px;" value="' + j + '" onClick="javascript:translit(\'' + j + '\')" /></td>');
}
}
function translit(text) {
var txtarea = document.post.message;
text = text;
if (txtarea.createTextRange && txtarea.caretPos) {
var caretPos = txtarea.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
txtarea.focus();
} else {
txtarea.value += text;
txtarea.focus();
}
}
#
#-----[ FIND ]------------------------------------------
#
<td colspan="9"><span class="gen">
<textarea name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{MESSAGE}</textarea>
</span></td>
</tr>
</table>
</span></td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1" valign="top"><span class="genmed">{L_CAPS}</span></td>
<td class="row2"><span class="gen"><table border="0" cellpadding="0" cellspacing="0"><tr><script language="JavaScript"><!--
letters('caps');
--></script></tr></table></span></td>
</tr>
<tr>
<td class="row1" valign="top"><span class="genmed">{L_SCROLL}</span></td>
<td class="row2"><span class="gen"><table border="0" cellpadding="0" cellspacing="0"><tr><script language="JavaScript"><!--
letters('scroll');
--></script></tr></table></span></td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
'L_DELETE_POST' => $lang['Delete_post'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
// [start] Russian Keyboard
'L_CAPS' => $lang['Caps'],
'L_SCROLL' => $lang['Scroll'],
// [end] Russian Keyboard
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM