![]() |
![]() |
ВходЗдравствуйте, Гость ( Вход | Регистрация )
|
![]() ![]() |
![]() |
![]()
Сообщение
#1
|
|
x_X ![]() Группа: Дизайнеры Сообщений: 633 Регистрация: 12.4.2008 Из: :( Украина :( Пользователь №: 3,219 Спасибо сказали: 229 Вставить ник ![]() |
Файлы для изменения:
/sources/action_public/xmlout.php /sources/action_public/post.php /sources/action_public/topics.php /sources/classes/post/class_post_reply.php /sources/ipsclass.php /cache/lang_cache/*/lang_topics.php /cache/lang_cache/*/lang_javascript.js Шаблоны для изменения: - skin_topic->topic_page_top - skin_topic->quick_reply_box_open - skin_topic->TableFooter - skin_topic->RenderRow 1. Загрузить файл sns_ajax_fast_reply.js в папку ./jscripts/ форума. ![]() 2. Загрузить файл sns_ajax_fast_reply.php в папку ./sources/lib/ форума. ![]() 3. Открыть файл ./cache/lang_cache/имя_языка/lang_topics.php, после $lang = array ( добавить: КОД 'sns_afr_use_ajax' => "AJAX?", 'ajax_get_new_posts' => "Загрузить новые сообщения", 4. Открыть файл ./cache/lang_cache/имя_языка/lang_javascript.js, добавить: КОД var afr_lang = { 'posting' : 'Подождите, идёт отправка сообщения...', 'merge_success' : 'Ваше сообщение успешно склеено с предыдущим.', 'moderate' : 'Сообщение отправлено. После проверки модератором оно, возможно, будет добавлено в эту тему.', 'get_new' : 'Подождите, идёт загрузка новых сообщений...', 'get_success' : 'Ok!', 'no_new_posts' : 'Нет новых сообщений.' }; 5. Во всех скинах в шаблоне skin_topics->topic_page_top найти: КОД <script type="text/javascript" src="jscripts/ipb_topic.js"></script> Добавить после КОД <script type="text/javascript" src="jscripts/sns_ajax_fast_reply.js"></script> 6. Во всех скинах в шаблоне skin_topic->quick_reply_box_open найти: КОД <input type="hidden" name="auth_key" value="$key" /> Добавить после: КОД <input type="hidden" name="sns_last_topic_view" value="{$this->ipsclass->input['sns_last_topic_view']}" /> Найти: КОД <input type="checkbox" name="enablesig" value="yes" class="checkbox" checked="checked" /> {$this->ipsclass->lang['qr_add_sig']} Добавить после: КОД | <input type="checkbox" name="use_afr" value="yes" class="checkbox" /> {$this->ipsclass->lang['sns_afr_use_ajax']} <script type="text/javascript"> //<![CDATA[ sns_afr_check_use_afr_checkbox(); //]]> </script> Найти: (ВНИМАНИЕ! ЭТА СТРОКА МОЖЕТ ВСТЕЧАТЬСЯ 2! РАЗА!!!): КОД <input type="submit" name="submit" value="{$this->ipsclass->lang['qr_submit']}" class="button" tabindex="2" accesskey="s" /> Заменить на: КОД <input type="submit" name="submit" value="{$this->ipsclass->lang['qr_submit']}" class="button" tabindex="2" accesskey="s" onclick="return sns_afr_post()" /> ВНИМАНИЕ! ЭТА СТРОКА ВСТЕЧАЕТСЯ 2! РАЗА!!! 7. Во всех скинах в шаблоне skin_topic->TableFooter найти: КОД <!-- END TABLE --> Добавить после: КОД <!--SnS.Ajax.Fast.Reply.Posts--> <div id='sns-afr-posts'></div> <!--SnS.Ajax.Fast.Reply.Msg--> <div id='sns-afr-msg'></div> <!--SnS.Ajax.Fast.Reply.End--> Найти: КОД <input type="submit" value="{$this->ipsclass->lang['search_topic']}" class="button" /> Добавить после: КОД <if="$this->ipsclass->can_use_fancy_js"> <input type="button" name="sns_ajax_get_new" value="{$this->ipsclass->lang['ajax_get_new_posts']}" class="button" onclick="sns_afr_get();" style="margin-left:10px;"/> </if> 8. Во всех скинах в шаблоне skin_topic->RenderRow найти: КОД {$author['member_posts']}<br /> Заменить на: КОД <span id="ajaxpostcount-{$author['id']}">{$author['member_posts']}</span><br /> 9. Во все стили в CSS добавить(используйте расширенный режим редактирования CSS): КОД /* (SnS) AJAX Fast reply */ .afr-msg, .afr-ok, .afr-error { padding: 10px; margin: 4px; text-align: center; font-weight: bold; } .afr-msg { border: 1px solid #5176B5; background-color: #DFE6EF; } .afr-ok { border: 1px solid #00CC00; background-color: #CCFFCC; } .afr-error { border: 1px solid #CC0000; background-color: #FFCCCC; } /* (SnS) AJAX Fast reply [E] */ 10. Открыть файл ./sources/action_public/xmlout.php. Найти: КОД //----------------------------------------- // What shall we do? //----------------------------------------- switch( $this->ipsclass->input['do'] ) { Добавить перед: КОД // (SnS) AJAX Fast Reply $this->ipsclass->class_ajax =& $this->class_ajax; if( in_array( $this->ipsclass->input['do'], array('sns-fast-reply-post', 'sns-fast-reply-get') ) ) { require_once( ROOT_PATH . 'sources/lib/sns_ajax_fast_reply.php' ); $ajax_fast_reply = new ajax_fast_reply(); $ajax_fast_reply->ipsclass =& $this->ipsclass; if( $this->ipsclass->input['do'] == 'sns-fast-reply-post' ) { $ajax_fast_reply->do_post(); } else { $ajax_fast_reply->do_get(); } } // (SnS) AJAX Fast Reply [E] 11. Открыть файл ./sources/action_public/post.php. Найти: КОД 'poll_add_do' => '15' Добавить после(не забудьте запятую, будьте внимательны): КОД , 'sns-fast-reply-post' => '03' 12. Открыть файл ./sources/classes/post/class_post_reply.php, найти: КОД /*-------------------------------------------------------------------------*/ // SHOW FORM /*-------------------------------------------------------------------------*/ function show_form() { Добавить после: КОД // (SnS) AJAX Fast Reply if( $this->ipsclass->input['do'] == 'sns-fast-reply-post' ) { // Do we have any posting errors? if ( isset($this->obj['post_errors']) AND $this->obj['post_errors'] AND !in_array( $this->obj['post_errors'], array( 'err_reg_code', 'reg_code_enter' ) ) ) { $this->ipsclass->class_ajax->return_string('error#'.$this->ipsclass->lang[$this->obj['post_errors']]); exit(); } else // Show form { $this->ipsclass->class_ajax->return_string('show_form'); exit(); } } // (SnS) AJAX Fast Reply [E] Найти: КОД $this->post['pid'] = $last_post['pid']; $this->post['post_key'] = $last_post['post_key']; $post_saved = 1; $this->is_merging_posts = 1; Добавить после: КОД // (SnS) AJAX Fast Reply if( $this->ipsclass->input['do'] == 'sns-fast-reply-post' ) { $this->post['post'] = $new_post; $this->post['post_edit_reason'] = $last_post['post_edit_reason']; return; } // (SnS) AJAX Fast Reply [E] Найти: КОД $this->ipsclass->print->redirect_screen( $this->ipsclass->lang['moderate_post'], "showtopic={$this->topic['tid']}&st=$page" ); Добавить перед: КОД // (SnS) AJAX Fast Reply if( $this->ipsclass->input['do'] == 'sns-fast-reply-post' ) { $this->ipsclass->class_ajax->return_string('moderate'); exit(); } // (SnS) AJAX Fast Reply [E] Найти: КОД //----------------------------------------- // Redirect them back to the topic //----------------------------------------- Добавить перед: КОД // (SnS) AJAX Fast Reply if( $this->ipsclass->input['do'] == 'sns-fast-reply-post' ) { return; } // (SnS) AJAX Fast Reply [E] 13. Открыть файл ./sources/action_public/topics.php, найти: КОД //----------------------------------------- // Update the topic read cookie / counters //----------------------------------------- if ( ! $this->ipsclass->input['view'] ) { $this->read_array[$this->topic['tid']] = time(); $this->ipsclass->my_setcookie('topicsread', serialize($this->read_array), -1 ); } Заменить на: КОД //----------------------------------------- // Update the topic read cookie / counters //----------------------------------------- if ( !$this->ipsclass->input['view'] AND ( $this->ipsclass->input['do'] != 'sns-fast-reply-get' ) ) { $this->read_array[$this->topic['tid']] = time(); $this->ipsclass->my_setcookie('topicsread', serialize($this->read_array), -1 ); } Найти: КОД //----------------------------------------- // New post since last read / not read? // Yes: Update. No: Ignore //----------------------------------------- if ( ( $this->ipsclass->input['view'] != 'getnewpost' ) AND ( ( $time_check <= $this->topic['last_post'] ) OR ( $this->forum['forum_last_deletion'] > $this->db_row['marker_last_update'] ) ) ) Заменить на: КОД //----------------------------------------- // New post since last read / not read? // Yes: Update. No: Ignore //----------------------------------------- if ( ( $this->ipsclass->input['view'] != 'getnewpost' ) AND ( ( $time_check <= $this->topic['last_post'] ) OR ( $this->forum['forum_last_deletion'] > $this->db_row['marker_last_update'] ) ) AND ( $this->ipsclass->input['do'] != 'sns-fast-reply-get' ) ) Найти: КОД //----------------------------------------- // Enable quick reply box? //----------------------------------------- if ( ( $this->forum['quick_reply'] == 1 ) and ( $this->ipsclass->check_perms( $this->forum['reply_perms']) == TRUE ) and ( $this->topic['state'] != 'closed' ) and ( ! $this->poll_only ) ) { $show = "none"; $sqr = isset($this->ipsclass->member['_cache']['qr_open']) ? $this->ipsclass->member['_cache']['qr_open'] : 0; if ( $sqr == 1 ) { $show = "show"; } Добавить после: КОД // (SnS) AJAX Fast Reply $this->ipsclass->input['sns_last_topic_view'] = time(); // (SnS) AJAX Fast Reply [E] 14. Открыть файл ./sources/ipsclass.php, найти: КОД //----------------------------------------- // Showing XML / AJAX functions? //----------------------------------------- if ( $this->input['act'] == 'xmlout' ) { @header( "Content-type: text/plain" ); print 'error'; exit(); } Добавить ВЫШЕ(!): КОД // (SnS) AJAX Fast Reply if( $this->input['do'] == 'sns-fast-reply-post' OR $this->input['do'] == 'sns-fast-reply-get' ) { $this->load_language('lang_error'); $this->class_ajax->return_string('error#'.$this->lang[ $error['MSG'] ]); exit(); } // (SnS) AJAX Fast Reply [E] ВСЁ! ПРИМЕЧАНИЕ: Если у вас наблюдаются проблемы с кодировкой, проверьте, что функция return_string($string) в файле ./ips_kernel/class_ajax.php имеет сл. вид: КОД function return_string($string) { @header( "Content-type: text/plain;charset={$this->ipsclass->vars['gb_char_set']}" ); $this->print_nocache_headers(); print $string; exit(); } © Sannis |
|
|
![]()
Сообщение
#2
|
|
Живу на АС ![]() Группа: Пользователи Сообщений: 752 Регистрация: 11.12.2007 Из: Москва а так по всюду гы Пользователь №: 1,591 Спасибо сказали: 154 Вставить ник ![]() |
это вобще под что???
|
|
|
![]()
Сообщение
#3
|
|
Живу на АС ![]() Группа: Администратор Сообщений: 2,508 Регистрация: 3.4.2007 Из: Эстония, Таллинн Пользователь №: 24 Спасибо сказали: 880 Вставить ник ![]() |
Предположу что как у нас, при добавлении быстрого ответа страница не перезагружается, а всё добавляется и подгружается через Ajax.
|
|
|
![]()
Сообщение
#4
|
|
Я уже люблю АС ![]() Группа: Пользователи Сообщений: 118 Регистрация: 27.3.2008 Пользователь №: 2,942 Спасибо сказали: 10 Вставить ник ![]() |
как я понимаю это под ipb.
|
|
|
![]()
Сообщение
#5
|
|
Приблуда ![]() Группа: [..AS..] Сообщений: 32 Регистрация: 31.7.2007 Из: Москва Пользователь №: 466 Спасибо сказали: 5 Вставить ник ![]() |
а можно одним архивом с инструкцией?
|
|
|
![]()
Сообщение
#6
|
|
А нас мёдом не корми, Дай чего нибуть помалевать. ![]() Группа: Дизайнеры Сообщений: 3,009 Регистрация: 23.9.2007 Из: Казахстан, Жезказган Рядом с Байконуром Пользователь №: 967 Спасибо сказали: 1247 Вставить ник ![]() |
Для этого есть Download Center
Здесь всё это потеряется. |
|
|
![]()
Сообщение
#7
|
|
Фэнат Stamina-ы ![]() Группа: Разработчики Сообщений: 2,470 Регистрация: 6.7.2007 Из: (-: Украина :-) Пользователь №: 268 Спасибо сказали: 992 Вставить ник ![]() |
ЦИТАТА(screatch @ Сегодня, 16:52 ) Предположу что как у нас, при добавлении быстрого ответа страница не перезагружается, а всё добавляется и подгружается через Ajax. Я бы настоятельно рекомендовал обновить этот мод. Хотя бы до того, что у меня на форуме. В текущем есть один очень существенный недостаток: пост, который ты написал тупо приклеивается снизу к текущим сообщениям.. А если до тебя уже отписали? |
|
|
![]() ![]() |
![]() |
Текстовая версия | Сейчас: 30 April 2025 - 16:13 |