pechalny
Advanced Member | Редактировать | Профиль | Сообщение | ICQ | Цитировать | Сообщить модератору Хе-хе...Тут недавно Аусвайс выкладивал свой хак клика по смайлам, в нем мне не очень понравилась одна фень - когда кликаешь по смайлику, то окно браузера прыгает...Сложно объяснить смотрите здесь Вот сваял свой, выношу на обсуждение :) Установка очень простая, рассмотрю ее на примере topic.cgi в "форме ответа" рубордовской.В принципе, в post.cgi такая же тема, только там надо будет эту операцию 3 раза проделать(или больше, если установлен хак голосовалки) Ну вообщем находим: Код: #################################### Форма ответа ######################### &getforum("$inforum"); if ($allowedentry{$inforum} eq "yes") { $allowed = "yes"; } if (($privateforum eq "yes") && ($allowed ne "yes")) { &error("$ibtxt{'1406'}&$ibtxt{'1407'}"); } if ($threadstate ne "closed" && $threadstate ne 'moved'){ if ($emoticons eq "on") { $emoticonslink = qq~<a href="javascript:openScript('$miscprog?action=showsmilies',300,350)">$ibtxt{'1408'}</a>~; $emoticonsbutton =qq~<input type=checkbox name="inshowemoticons" value="yes" checked>$ibtxt{'1409'}<br>~; } if ($emailfunctions eq "on") { if ($innotify eq "yes") { $requestnotify = qq~<input type=checkbox name="notify" value="yes" checked>$ibtxt{'1411'}<br>~; } else { $requestnotify = qq~<input type=checkbox name="notify" value="yes">$ibtxt{'1411'}<br>~; } } | и сразу после этого вставляем Код: #Let's show some smileys :) $smileys .= qq~ <table width="92" border="0" cellpadding="0" cellspacing="0" bgcolor=black align="center"> <tr> <td width="92" height="203" valign="top" bgcolor=$miscbackone> <table width="100%" border="0" cellpadding="6" cellspacing="1" bgcolor=black> <tr> <td valign="top" height="23" colspan="3" class="smiliestd"> <div align="center"><font face="$font" color=$fontcolormisc size=1>Смайлики</font></div> </td> </tr> <tr> <td height="30" width="16" valign="top" class="smiliestd"><img src="$imagesurl/emoticons/sad.gif" border=0 onClick="document.mt.inpost.value+=':(';" onmouseover="this.style.cursor='hand';"></td> <td width="17" valign="top" class="smiliestd"><img src="$imagesurl/emoticons/smile.gif" border=0 onClick="document.mt.inpost.value+=':)';" onmouseover="this.style.cursor='hand';"></td> <td width="19" valign="top" class="smiliestd"><img src="$imagesurl/emoticons/podmig.gif" border=0 onClick="document.mt.inpost.value+=';)';" onmouseover="this.style.cursor='hand';"></td> </tr> <tr> <td height="30" valign="top"class="smiliestd" ><img src="$imagesurl/emoticons/yellowgrin.gif" border=0 onClick="document.mt.inpost.value+=':yellowgrin:';" onmouseover="this.style.cursor='hand';"></td> <td valign="top" class="smiliestd"><img src="$imagesurl/emoticons/gigi.gif" border=0 onClick="document.mt.inpost.value+=':gigi:';" onmouseover="this.style.cursor='hand';"></td> <td valign="top" class="smiliestd"><img src="$imagesurl/emoticons/lol.gif" border=0 onClick="document.mt.inpost.value+=':lol:';" onmouseover="this.style.cursor='hand';"></td> </tr> <tr> <td height="30" valign="top" class="smiliestd"><img src="$imagesurl/emoticons/good.gif" border=0 onClick="document.mt.inpost.value+=':good:';" onmouseover="this.style.cursor='hand';"></td> <td valign="top" class="smiliestd"><img src="$imagesurl/emoticons/bad.gif" border=0 onClick="document.mt.inpost.value+=':bad:';" onmouseover="this.style.cursor='hand';"></td> <td valign="top" class="smiliestd"><img src="$imagesurl/emoticons/wow.gif" border=0 onClick="document.mt.inpost.value+=':wow:';" onmouseover="this.style.cursor='hand';"></td> </tr> <tr> <td height="30" valign="top" class="smiliestd"><img src="$imagesurl/emoticons/question.gif" border=0 onClick="document.mt.inpost.value+=':question:';"onmouseover="this.style.cursor='hand';" ></td> <td valign="top" class="smiliestd"><img src="$imagesurl/emoticons/yuk.gif" border=0 onClick="document.mt.inpost.value+=':yuk:';" onmouseover="this.style.cursor='hand';"></td> <td valign="top" class="smiliestd"><img src="$imagesurl/emoticons/beast.gif" border=0 onClick="document.mt.inpost.value+=':beast:';" onmouseover="this.style.cursor='hand';"></td> </tr> <tr> <td height="30" valign="top" class="smiliestd"><img src="$imagesurl/emoticons/yes.gif" border=0 onClick="document.mt.inpost.value+=':yes:';" onmouseover="this.style.cursor='hand';"></td> <td valign="top" class="smiliestd"><img src="$imagesurl/emoticons/nope.gif" border=0 onClick="document.mt.inpost.value+=':nope:';" onmouseover="this.style.cursor='hand';"></td> <td valign="top" class="smiliestd"><img src="$imagesurl/emoticons/user.gif" border=0 onClick="document.mt.inpost.value+=':user:';" onmouseover="this.style.cursor='hand';"></td> </tr> <tr> <td height="23" colspan="3" valign="top" class="smiliestd"> <div align="center"><font face="$font" color=$fontcolormisc size=1><a href="javascript:openScript('misc.cgi?action=showsmilies',300,350)"">Все смайлики</a></font></div> </td> </tr> </table> </td> </tr> </table>~; | ПЕРЕД Код: Ну и шаг №2, выводим переменную $smileys.В моем случае пихаем ее после Код: <SCRIPT language=JavaScript> if (navigator.appVersion.indexOf("MSIE")!= -1) document.writeln("Для вставки цитаты, выделите её и <a href='VBScript:paste2(document.selection.createRange().Text)'>нажмите эту ссылку</a><br></span>") </SCRIPT></font><br> | и перед <td> Получится что-то вроде ;) : Код: <SCRIPT language=JavaScript> if (navigator.appVersion.indexOf("MSIE")!= -1) document.writeln("Для вставки цитаты, выделите её и <a href='VBScript:paste2(document.selection.createRange().Text)'>нажмите эту ссылку</a><br></span>") </SCRIPT></font><br>$smileys </td> | И последний шаг - необходимо добавить в settemplate.cgi стиль Код: .smiliestd { background-color: cddbeb} | Это - бэк колор ячеек...В принципе, сюда еще можно будет чего - нибудь напхать :) Ну вот такие пироги...Если проблемы возникнут - обращайтесь ;) Да, и чуть не забыл, названия смайликов вам скорее всего придется поменять на свои.Т.е. вот здесь Код: <td valign="top" class="smiliestd"><img src="$imagesurl/emoticons/beast.gif" border=0 onClick="document.mt.inpost.value+=':beast:';" onmouseover="this.style.cursor='hand';"></td> | необходимо поменять смайлик "beast.gif" на что-то свое ну и соответственно ":beast:" на название смайлика... бррр и это тоже надо сделать Цитата: <form name=mt action="$postprog" method=post> Если у вас name не =mt, то замените выше на свое |
| Всего записей: 1852 | Зарегистр. 29-07-2001 | Отправлено: 12:01 09-12-2001 | Исправлено: pechalny, 12:44 09-12-2001 |
|