Мод за бърз отговор 2
Автор: djvato
Здравейте … това не е целия мод за бърз отговор а само добавка преди да почнете да правите този урок трябва да имате инсталиран този :
след направата на този урок който е малко по надолу ще добавите и smiles да се виждат при бързия отговор 😛
#
#-----[ отваряте ]---------------------------------------------
#You should modify all the templates that you have
template/XXX/viewtopic_body.tpl
#
#-----[ намирате ]---------------------------------------------
#
{QUICK_REPLY_FORM}
#
#-----[ след него добавяте ]--------------------------------------
#
<script language='JavaScript'>
function openAllSmiles(){
smiles = window.open('posting.php?mode=smilies', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');
smiles.focus();
return false;
}
function quoteSelection() {
theSelection = false;
theSelection = document.selection.createRange().text; // Get text selection
if (theSelection) {
// Add tags around selection
emoticon( '[quote]\n' + theSelection + '\n[/quote]\n');
document.post.message.focus();
theSelection = '';
return;
}else{
alert('Select a text anywhere on a page and try again');
}
}
function storeCaret(textEl) {
if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}
function emoticon(text) {
if (document.post.message.createTextRange && document.post.message.caretPos) {
var caretPos = document.post.message.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
document.post.message.focus();
} else {
document.post.message.value += text;
document.post.message.focus();
}
}
</script>
#
#-----[ отваряте ]---------------------------------------------
#This is for if you have installed quick reply with quotes (I have tested on version 1.1.3) but it should work on all.
viewtopic.php
#
#-----[ намирате ]---------------------------------------------
#
if (!$userdata['session_logged_in'])
{
$quick_reply_form .= $lang['Username'] . ":&<input class='post' type='text' name='username' size='25' maxlength='25' value='' /><br />";
}
$quick_reply_form .= "<textarea name='input' rows='10' cols='50' wrap='virtual' class='post''></textarea><br />
#
#-----[ след него добавяте ]--------------------------------------
#
<input type='button' name='quoteselected' class='liteoption' value='Quote selected' onclick='javascript:quoteSelection()'>& & & & & & & & & & & & & & & & &
<input type='button' name='SmilesButt' class='liteoption' value='Smilies' onclick='openAllSmiles();'><br/>
#
#-----[ отваряте ]---------------------------------------------
#
viewtopic.php
#
#-----[ намирате ]---------------------------------------------
#
if (!$userdata['session_logged_in'])
{
$quick_reply_form .= $lang['Username'] . ":&<input class='post' type='text' name='username' size='25' maxlength='25' value='' /><br />";
}
$quick_reply_form .= "
<textarea class='post' name='message' rows='10' cols='50' wrap='virtual'></textarea><br />
#
#-----[ след него добавяте ]--------------------------------------
#
<input type='button' name='quoteselected' class='liteoption' value='Quote selected' onclick='javascript:quoteSelection()'>& & & & & & & & & & & & & & & & &
<input type='button' name='SmilesButt' class='liteoption' value='Smilies' onclick='openAllSmiles();'><br/>
#
#-----[ Успех ]--------------------------------------
#


