Поиск:

Ответ в темуСоздание новой темы Создание опроса
> Форма быстрого ответа, Может, несколько изменить 
:(
    Опции темы
Borland_Delphi_6
Дата 30.3.2003, 22:30 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


LoneLINEss
****


Профиль
Группа: Участник Клуба
Сообщений: 2509
Регистрация: 5.11.2002
Где: in fortune dreams ...

Репутация: 4
Всего: 20



Предлогаю изменить форму быстрого ответа, а именно вставить туда смайлики. Если что, вот код:
Код
Название: Quick Reply Hack with IBCode and Smilies for IBF 1.1
Автор: Palom
Описание: форма быстрого ответа с кодами Invision Board и кликабельными смайликами.
Установка: Откройте sources/Topics.php и найдите:
CODE  
//-------------------------------------
// Compile the language file
//-------------------------------------

$ibforums->lang = $std->load_words($ibforums->lang, 'lang_topic', $ibforums->lang_id);

Ниже добавте:
CODE  
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_post', $ibforums->lang_id);

Найдите:
CODE  
$this->output .= $this->html->RenderRow( array( 'POST' => $row, 'POSTER' => $poster ) );
 
 $post_count++;
 
}

Ниже добавте:
CODE  
//-------------------------------------
// Quick Reply Hack with Smilies
//-------------------------------------

if ($this->topic['reply_perms'] != '*')
{
 $perms = explode(",", $this->topic['reply_perms']);
 foreach ($perms as $k)
 {
  if ($ibforums->member['mgroup'] == $k)
  {
   $allow = 1;
  }
 }
}
 if ($this->topic['reply_perms'] == '*')
{
 $allow = 1;
}

if ($this->topic['state'] != 'open' && $ibforums->member['g_post_closed'] != 1)
{
 $allow = 0;
}
if ($this->topic['poll_state'] == 'closed' && $ibforums->member['g_post_closed'] != 1)
{
 $allow = 0;
}
 if ($this->topic['starter_id'] == $ibforums->member['id'] && $ibforums->member['g_reply_own_topics'] != 1)
{
 $allow = 0;
}
if ($ibforums->member['g_reply_other_topics'] != 1)
{
 $allow = 0;
}
if ($ibforums->member['id'] == "" AND $allow != 1)
{
 $allow = 0;
}

if($allow == 1)
{
 $show_table = 0;
 $count      = 0;
 $smilies    = "<tr align='center'>\n";

 // Get the smilies from the DB

 $DB->query("SELECT * FROM ibfemoticons WHERE clickable='1'");

 while ($elmo = $DB->fetch_row() )
 {
  $show_table++;
  $count++;
 
  $smilies .= "<td><a href=\"javascript:emoticon('".$elmo['typed']."')\"><img src=\"".$ibforums->vars['EMOTICONS_URL']."/".$elmo['image']."\" alt='smilie' border='0'></a>&nbsp;</td>\n";
 
  if ($count == $ibforums->vars['emo_per_row'])
  {
   $smilies .= "</tr>\n\n<tr align='center'>";
   $count = 0;
  }
 }

 if ($count != $ibforums->vars['emo_per_row'])
 {
  for ($i = $count; $i < $ibforums->vars['emo_per_row']; ++$i)
  {
   $smilies .= "<td>&nbsp;</td>\n";
  }
  $smilies .= "</tr>";
 }

 $table = $this->html->smilie_table();

 if (!$ibforums->member['id'])
 {
  $data['guest_box'] = "<tr><td class='row1'><b>Enter your name</b></td><td class='row1'><input type='text' size='40' maxlength='50' name='UserName' value='Unregistered' tabindex='1' class='forminput' onMouseOver='this.focus()'></td></tr>";
 }

 $data['f'] = $this->forum['id'];
 $data['t'] = $this->topic['tid'];
 $ibforums->lang['the_max_length'] = $ibforums->vars['max_post_length'] * 1024;
}

Найдите:
CODE  
$this->output .= $this->html->TableFooter( array( 'TOPIC' => $this->topic, 'FORUM' => $this->forum ) );

Ниже добавте:
CODE  
if ($allow == 1)
{
 if ($show_table != 0)
 {
  $table = preg_replace( "/<!--THE SMILIES-->/", $smilies, $table );
  $table_two = preg_replace( "/<!--SMILIE TABLE-->/", $table, $this->html->quickreply($data) );
  $this->output = preg_replace( "/<!--QUICK REPLY BOX-->/", $table_two, $this->output );
 }
 else
 {
  $this->output = preg_replace( "/<!--QUICK REPLY BOX-->/", $this->html->quickreply($data), $this->output );
 }
}


Закройте и сохраните Topics.php и откройте Skin/s#/skin_topic.php, найдите:
CODE  
function TableFooter($data) {
global $ibforums;
return <<<EOF

    </table></td>

И замените на:
CODE  
function TableFooter($data) {
global $ibforums;
return <<<EOF

<!--QUICK REPLY BOX-->
    </table></td>

Перейдите в конец файла и над:
CODE  
}
?>

Добавте:
CODE  
function smilie_table() {
global $ibforums;
return <<<EOF
  <table align="center" cellspacing='1' cellpadding='3' border='0' class='row2' style="border-width:1px; border-color:<{tbl_border}>; border-style:solid; width:95%" align='left'>
  <tr>
      <td colspan='{$ibforums->vars['emo_per_row']}' align='center'>{$ibforums->lang['click_smilie']}</td>
  </tr>
  <!--THE SMILIES-->
  <tr>
      <td colspan='{$ibforums->vars['emo_per_row']}' class='row1' align='center'><a href='javascript:emo_pop()'>{$ibforums->lang['all_emoticons']}</a></td>
  </tr>
  </table>
EOF;
}

function quickreply($data) {
global $ibforums;
return <<<EOF
<script language="javascript1.2">
<!--

var MessageMax  = "{$ibforums->lang['the_max_length']}";
var Override    = "{$ibforums->lang['override']}";


function emo_pop()
{

window.open('index.{$ibforums->vars['php_ext']}?act=legends&CODE=emoticons&s={$ibforums->session_id}','Legends','width=250,height=500,resizable=yes,scrollbars=yes');
   
}
function CheckLength() {
MessageLength  = document.REPLIER.Post.value.length;
message  = "";

if (MessageMax !=0) {
 message = "{$ibforums->lang['js_post']}:\\n{$ibforums->lang['js_max_length']} " + MessageMax + " {$ibforums->lang['js_characters']}.";
} else {
 message = "";
}
alert(message + "\\n{$ibforums->lang['js_used']} " + MessageLength + " {$ibforums->lang['js_characters']}.");
}

function ValidateForm(isMsg) {
MessageLength  = document.REPLIER.Post.value.length;
errors = "";

if (isMsg == 1)
{
 if (document.REPLIER.msg_title.value.length < 2)
 {
  errors = "{$ibforums->lang['msg_no_title']}";
 }
}

if (MessageLength < 2) {
  errors = "{$ibforums->lang['js_no_message']}";
}
if (MessageMax !=0) {
 if (MessageLength > MessageMax) {
  errors = "{$ibforums->lang['js_max_length']} " + MessageMax + " {$ibforums->lang['js_characters']}. {$ibforums->lang['js_current']}: " + MessageLength;
 }
}
if (errors != "" && Override == "") {
 alert(errors);
 return false;
} else {
 document.REPLIER.submit.disabled = true;
 return true;
}
}



// IBC Code stuff
var text_enter_url      = "{$ibforums->lang['jscode_text_enter_url']}";
var text_enter_url_name = "{$ibforums->lang['jscode_text_enter_url_name']}";
var text_enter_image    = "{$ibforums->lang['jscode_text_enter_image']}";
var text_enter_email    = "{$ibforums->lang['jscode_text_enter_email']}";
var text_enter_flash    = "{$ibforums->lang['jscode_text_enter_flash']}";
var text_code           = "{$ibforums->lang['jscode_text_code']}";
var text_quote          = "{$ibforums->lang['jscode_text_quote']}";
var error_no_url        = "{$ibforums->lang['jscode_error_no_url']}";
var error_no_title      = "{$ibforums->lang['jscode_error_no_title']}";
var error_no_email      = "{$ibforums->lang['jscode_error_no_email']}";
var error_no_width      = "{$ibforums->lang['jscode_error_no_width']}";
var error_no_height     = "{$ibforums->lang['jscode_error_no_height']}";
var prompt_start        = "{$ibforums->lang['js_text_to_format']}";

var help_bold           = "{$ibforums->lang['hb_bold']}";
var help_italic         = "{$ibforums->lang['hb_italic']}";
var help_under          = "{$ibforums->lang['hb_under']}";
var help_font           = "{$ibforums->lang['hb_font']}";
var help_size           = "{$ibforums->lang['hb_size']}";
var help_color          = "{$ibforums->lang['hb_color']}";
var help_close          = "{$ibforums->lang['hb_close']}";
var help_url            = "{$ibforums->lang['hb_url']}";
var help_img            = "{$ibforums->lang['hb_img']}";
var help_email          = "{$ibforums->lang['hb_email']}";
var help_quote          = "{$ibforums->lang['hb_quote']}";
var help_list           = "{$ibforums->lang['hb_list']}";
var help_code           = "{$ibforums->lang['hb_code']}";
var help_click_close    = "{$ibforums->lang['hb_click_close']}";
var list_prompt         = "{$ibforums->lang['js_tag_list']}";


//-->
</script>
<form action='{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}' method='POST' name='REPLIER' onSubmit='return ValidateForm()'>
<input type='hidden' name='st' value='0'>
<input type='hidden' name='act' value='Post'>
<input type='hidden' name='f' value='$data[f]'>
<input type='hidden' name='CODE' value='03'>
<input type='hidden' name='t' value='$data[t]'>
<input type='hidden' name='enableemo' value='yes'>
<input type='hidden' name='enablesig' value='yes'>
      <tr>
        <td class="postfoot" colspan="2">Quick Reply</td>
      </tr>
$data[guest_box]
      <tr>
        <td class='row1'>
         <input type='radio' name='bbmode' value='ezmode' onClick='setmode(this.value)'>&nbsp;<b>{$ibforums->lang['bbcode_guided']}</b><br>
         <input type='radio' name='bbmode' value='normal' onClick='setmode(this.value)' checked>&nbsp;<b>{$ibforums->lang['bbcode_normal']}</b>
        </td>
        <script language='Javascript' src='html/ibfcode.js'></script>
        <td class='row1' width="100%" valign="top">
 <table cellpadding='2' cellspacing='2' width='100%' align='center'>
                <tr>
                 <td nowrap width='10%'>
       <input type='button' accesskey='b' value=' B '       onClick='simpletag("B")' class='codebuttons' name='B' style="font-weight:bold" onMouseOver="hstat('bold')">
       <input type='button' accesskey='i' value=' I '       onClick='simpletag("I")' class='codebuttons' name='I' style="font-style:italic" onMouseOver="hstat('italic')">
       <input type='button' accesskey='u' value=' U '       onClick='simpletag("U")' class='codebuttons' name='U' style="text-decoration:underline" onMouseOver="hstat('under')">
       
       <select name='ffont' class='codebuttons' onchange="alterfont(this.options[this.selectedIndex].value, 'FONT')"  onMouseOver="hstat('font')">
       <option value='0'>{$ibforums->lang['ct_font']}</option>
       <option value='Arial' style='font-family:Arial'>{$ibforums->lang['ct_arial']}</option>
       <option value='Times' style='font-family:Times'>{$ibforums->lang['ct_times']}</option>
       <option value='Courier' style='font-family:Courier'>{$ibforums->lang['ct_courier']}</option>
       <option value='Impact' style='font-family:Impact'>{$ibforums->lang['ct_impact']}</option>
       <option value='Geneva' style='font-family:Geneva'>{$ibforums->lang['ct_geneva']}</option>
       <option value='Optima' style='font-family:Optima'>Optima</option>
       </select><select name='fsize' class='codebuttons' onchange="alterfont(this.options[this.selectedIndex].value, 'SIZE')" onMouseOver="hstat('size')">
       <option value='0'>{$ibforums->lang['ct_size']}</option>
       <option value='1'>{$ibforums->lang['ct_sml']}</option>
       <option value='7'>{$ibforums->lang['ct_lrg']}</option>
       <option value='14'>{$ibforums->lang['ct_lest']}</option>
       </select><select name='fcolor' class='codebuttons' onchange="alterfont(this.options[this.selectedIndex].value, 'COLOR')" onMouseOver="hstat('color')">
       <option value='0'>{$ibforums->lang['ct_color']}</option>
       <option value='blue' style='color:blue'>{$ibforums->lang['ct_blue']}</option>
       <option value='red' style='color:red'>{$ibforums->lang['ct_red']}</option>
       <option value='purple' style='color:purple'>{$ibforums->lang['ct_purple']}</option>
       <option value='orange' style='color:orange'>{$ibforums->lang['ct_orange']}</option>
       <option value='yellow' style='color:yellow'>{$ibforums->lang['ct_yellow']}</option>
       <option value='gray' style='color:gray'>{$ibforums->lang['ct_grey']}</option>
       <option value='green' style='color:green'>{$ibforums->lang['ct_green']}</option>
       </select>
       &nbsp; <a href='javascript:closeall();' onMouseOver="hstat('close')">{$ibforums->lang['js_close_all_tags']}</a>
     </td>
     </tr>
     <tr>
        <td align='left'>
       <input type='button' accesskey='h' value=' http:// ' onClick='tag_url()'            class='codebuttons' name='url' onMouseOver="hstat('url')">
       <input type='button' accesskey='g' value=' IMG '     onClick='tag_image()'          class='codebuttons' name='img' onMouseOver="hstat('img')">
       <input type='button' accesskey='e' value='  @  '     onClick='tag_email()'          class='codebuttons' name='email' onMouseOver="hstat('email')">
       <input type='button' accesskey='q' value=' QUOTE '   onClick='simpletag("QUOTE")'   class='codebuttons' name='QUOTE' onMouseOver="hstat('quote')">
       <input type='button' accesskey='p' value=' CODE '    onClick='simpletag("CODE")'    class='codebuttons' name='CODE' onMouseOver="hstat('code')">
       <input type='button' accesskey='l' value=' LIST '     onClick='tag_list()'          class='codebuttons' name="LIST" onMouseOver="hstat('list')">
       <!--<input type='button' accesskey='l' value=' SQL '     onClick='simpletag("SQL")'     class='codebuttons' name='SQL'>
       <input type='button' accesskey='t' value=' HTML '    onClick='simpletag("HTML")'    class='codebuttons' name='HTML'>-->
     </td>
    </tr>
    <tr>
    <!-- Help Box -->
     <td align='left' valign='middle'>
     {$ibforums->lang['hb_open_tags']}:&nbsp;<input type='text' name='tagcount' size='3' maxlength='3' style='font-size:10px;font-family:verdana,arial;border:0px;font-weight:bold;' readonly class='row1' value="0">
      &nbsp;<input type='text' name='helpbox' size='50' maxlength='120' style='width:80%;font-size:10px;font-family:verdana,arial;border:0px' readonly class='row1' value="{$ibforums->lang['hb_start']}">
     </td>
    </tr>
   </table>
        </td>
      </tr>
      <tr>
        <td class='row1' rowspan='2'>(<a href='javascript:CheckLength()'>{$ibforums->lang['check_length']}</a>)<br><br><!--SMILIE TABLE--><img src="{$ibforums->vars['img_url']}/spacer.gif" alt="" width="180" height="1"></td>
        <td class='row1' width='100%' valign='top'><textarea cols='60' style='width:95%' rows='15' wrap='soft' name='Post' tabindex='3' class='textinput'></textarea><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><input type='checkbox' name='enableemo' value='yes' checked></td>
              <td width="100%">{$ibforums->lang['enable_emo']}</td>
            </tr>
            <tr>
              <td><input type='checkbox' name='enablesig' value='yes' checked></td>
              <td width="100%">{$ibforums->lang['enable_sig']}</td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td class='row1' width='100%' align='center'><input type='submit' name='submit' value='Ответить' tabindex='4' class='forminput'>&nbsp;
             <input type='submit' name='preview' value='Предварительный просмотр' tabindex='5' class='forminput'></td>
      </tr>
</form>
EOF;
}

Закрывайте и сохраняйте файл, хак быстрого ответа установлен.



--------------------
Blind Guardian Fan :: BMSTU Student :: A polar bear is a rectangular bear after a coordinate transform.

Мои фотографии
PM MAIL WWW   Вверх
Wowa
Дата 31.3.2003, 01:07 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
Group Icon


Профиль
Группа: Админ
Сообщений: 15017
Регистрация: 14.9.2000
Где: Винград

Репутация: 79
Всего: 290



Спасибо, но смайлы нам не нужны в форме быстрого ответа.
PM WWW   Вверх
  
Ответ в темуСоздание новой темы Создание опроса
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | Обсуждение форума | Следующая тема »


 




[ Время генерации скрипта: 0.0628 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.