kkhk
Advanced Member | Редактировать | Профиль | Сообщение | ICQ | Цитировать | Сообщить модератору Kurt был хак для версии 1.0.1 и не для меню быстрого ответа, а просто для формы ответа, когда нажимаешь кнопку ответить, вот привожу код, может кто сможет сделать для формы быстрого ответа для версии 1.1 Описание: Этот хак добавляет возможность подписаться на уведомление о новых ответах в теме сразу при создании или ответе в теме 1) Откройте Skins/skin_post.php и найдите: Код: <tr> <td><input type='checkbox' name='enablesig' value='yes' checked></td> <td width="100%">{$ibforums->lang['enable_sig']}</td> </tr> Ниже добавте: Код: <tr> <td><input type='checkbox' name='enabletra' value='yes'></td> <td width="100%">{$ibforums->lang['enable_tra']}</td> </tr> | 2) Откройте lang/name/lang_post.php и найдите: Код: enable_emo => "<b>Разрешить</b> отображение иконок в сообщении?", | Ниже добавте: Код: enable_tra => "<b>Присылать</b> уведомление на e-mail о новых сообщениях?", | 3) Откройте sources/Post.php и найдите: Код: $ibforums->input['enableemo'] = $ibforums->input['enableemo'] == 'yes' ? 1 : 0; | Ниже добавте: Код: $ibforums->input['enabletra'] = $ibforums->input['enabletra'] == 'yes' ? 1 : 0; | 4) Найдите: Код: if (strlen( $HTTP_POST_VARS['Post'] ) > ($ibforums->vars['max_post_length']*1024)) { $std->Error( array( LEVEL => 1, MSG => 'post_too_long') ); } | Ниже добавте: Код: // Do we want this post to be tracked? if ($ibforums->input['enabletra']&&$tid!="" ) { // Is it already in the database? $DB->query("SELECT trid from ibf_tracker WHERE topic_id='".$tid."' AND member_id='".$ibforums->member['id']."'"); if ( $DB->get_num_rows() ) { if ($is_sub != 1) { $std->Error( array( LEVEL => 1, MSG => 'already_sub') ); } else { return; } } //------------------------------------------------------ // Add it to the DB //------------------------------------------------------ $db_string = $DB->compile_db_insert_string( array ( 'member_id' => $ibforums->member['id'], 'topic_id' => $tid, 'start_date' => time(), ) ); $DB->query("INSERT INTO ibf_tracker (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); } | 5) Откройте sources/lib/post_new_post.php и найдите: Код: $this->post['topic_id'] = $DB->get_insert_id(); $this->topic['tid'] = $this->post['topic_id']; | Ниже добавте: [code]// Do we want this new post to be tracked? if ($ibforums->input['enabletra'] ) { // Skip step one of checking if its already in the DB, since its a new post // Add it to the DB $db_string = $DB->compile_db_insert_string( array ( 'member_id' => $ibforums->member['id'], 'topic_id' => $this->topic['tid'], 'start_date' => time(), ) ); $DB->query("INSERT INTO ibf_tracker (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); } | не забываем это хак для формы ответа, но не для формы быстрого ответа и версии 1.0.1 кто переделает для версии 1.1 и формы быстрого ответа, ящик пива с меня!
---------- infix* - зашибательский weblog Говори кратко, проси мало, уходи борзо |
| Всего записей: 930 | Зарегистр. 12-10-2001 | Отправлено: 07:26 01-02-2003 | Исправлено: kkhk, 07:28 01-02-2003 |
|