SLASH_id Опубликовано 10 Февраля 2009 Жалоба Поделиться Опубликовано 10 Февраля 2009 Использую галерею 2.2.4. Возник вопрос: Как отключить премодерацию коментариев к фоткам??? Нигде не нашел... Отредактировал $insert = array( 'author_id' => $this->ipsclass->member['id'], 'author_name' => $this->ipsclass->member['members_display_name'], 'use_sig' => $this->ipsclass->input['enablesig'], 'use_emo' => $this->ipsclass->input['enableemo'], 'ip_address' => $this->ipsclass->input['IP_ADDRESS'], 'post_date' => time(), 'comment' => $comment, 'approved' => ( $autoapprove ) ? 1 : 0, [b]//(Вместо 0 : 1)[/b] 'img_id' => $img, ); Но теперь коментарии хоть и показываются, но ставятся в очередь(( http://i045.radikal.ru/0902/55/32aec021ed47.jpg Подскажите как бороться.... Ссылка на комментарий Поделиться на других сайтах Прочее
Arhar Опубликовано 10 Февраля 2009 Жалоба Поделиться Опубликовано 10 Февраля 2009 'approved' => 1че, не труъ? Ссылка на комментарий Поделиться на других сайтах Прочее
SLASH_id Опубликовано 10 Февраля 2009 Автор Жалоба Поделиться Опубликовано 10 Февраля 2009 Говорю же... Если так сделать, коментарии хоть и показываются всем, но ставятся в очередь(( http://i045.radikal.ru/0902/55/32aec021ed47.jpg Разве отключение премодерации не предусмотрено штатными средствами? Вобщем.... Решил проблему таким образом: Было:// Update some stats //--------------------------------------- $msg = 'comment_moderated'; if( $this->cat ) { if( ! $this->cat['approve_comments'] ) { $msg = 'comment_added'; $this->ipsclass->DB->simple_update( 'gallery_images', 'comments=comments+1, lastcomment='.time(), "id={$img}", 1 ); $this->ipsclass->DB->simple_exec(); $this->glib->resynch_everything( $this->img['category_id'] ); if( $this->cat['inc_post_count'] ) { $this->ipsclass->DB->simple_update( 'members', 'posts=posts+1', "id={$this->ipsclass->member['id']}", 1 ); $this->ipsclass->DB->simple_exec(); } require_once( GALLERY_LIBS . 'lib_notifications.php' ); $notify = new lib_notifications(); $notify->ipsclass =& $this->ipsclass; $notify->category =& $this->category; $notify->glib =& $this->glib; $notify->send_comment_notifications( $img ); } else { $this->ipsclass->DB->simple_update( 'gallery_images', 'comments_queued=comments_queued+1', "id={$img}", 1 ); $this->ipsclass->DB->simple_exec(); $this->glib->resynch_everything( $this->img['category_id'] ); } } else { if( ! $catdata['approve_comments'] ) { $msg = 'comment_added'; $this->ipsclass->DB->simple_update( 'gallery_images', 'comments=comments+1, lastcomment='.time(), "id={$img}", 1 ); $this->ipsclass->DB->simple_exec(); $this->glib->resynch_everything( 0, $this->img['album_id'] ); if( $catdata['inc_post_count'] ) { $this->ipsclass->DB->simple_update( 'members', 'posts=posts+1', "id={$this->ipsclass->member['id']}", 1 ); $this->ipsclass->DB->simple_exec(); } require_once( GALLERY_LIBS . 'lib_notifications.php' ); $notify = new lib_notifications(); $notify->ipsclass =& $this->ipsclass; $notify->category =& $this->category; $notify->glib =& $this->glib; $notify->send_comment_notifications( $img ); } else { $this->ipsclass->DB->simple_update( 'gallery_images', 'comments_queued=comments_queued+1', "id={$img}", 1 ); $this->ipsclass->DB->simple_exec(); $this->glib->resynch_everything( 0, $this->img['album_id'] ); } } $this->ipsclass->DB->do_insert( 'gallery_comments', $insert ); $this->glib->rebuild_stats_cache(); $this->ipsclass->print->redirect_screen( $this->ipsclass->lang[$msg], "autocom=gallery&req=si&img={$img}" ); } Стало:// Update some stats //--------------------------------------- $msg = 'comment_moderated'; if( $this->cat ) { if( ! $this->cat['approve_comments'] ) { $this->ipsclass->DB->simple_update( 'gallery_images', 'comments_queued=comments_queued+1', "id={$img}", 1 ); $this->ipsclass->DB->simple_exec(); $this->glib->resynch_everything( $this->img['category_id'] ); $msg = 'comment_added'; $this->ipsclass->DB->simple_update( 'gallery_images', 'comments=comments+1, lastcomment='.time(), "id={$img}", 1 ); $this->ipsclass->DB->simple_exec(); $this->glib->resynch_everything( $this->img['category_id'] ); if( $this->cat['inc_post_count'] ) { $this->ipsclass->DB->simple_update( 'members', 'posts=posts+1', "id={$this->ipsclass->member['id']}", 1 ); $this->ipsclass->DB->simple_exec(); } require_once( GALLERY_LIBS . 'lib_notifications.php' ); $notify = new lib_notifications(); $notify->ipsclass =& $this->ipsclass; $notify->category =& $this->category; $notify->glib =& $this->glib; $notify->send_comment_notifications( $img ); } else { $msg = 'comment_added'; $this->ipsclass->DB->simple_update( 'gallery_images', 'comments=comments+1, lastcomment='.time(), "id={$img}", 1 ); $this->ipsclass->DB->simple_exec(); $this->glib->resynch_everything( $this->img['category_id'] ); if( $this->cat['inc_post_count'] ) { $this->ipsclass->DB->simple_update( 'members', 'posts=posts+1', "id={$this->ipsclass->member['id']}", 1 ); $this->ipsclass->DB->simple_exec(); } require_once( GALLERY_LIBS . 'lib_notifications.php' ); $notify = new lib_notifications(); $notify->ipsclass =& $this->ipsclass; $notify->category =& $this->category; $notify->glib =& $this->glib; $notify->send_comment_notifications( $img ); } } else { if( ! $catdata['approve_comments'] ) { $this->ipsclass->DB->simple_update( 'gallery_images', 'comments_queued=comments_queued+1', "id={$img}", 1 ); $this->ipsclass->DB->simple_exec(); $this->glib->resynch_everything( 0, $this->img['album_id'] ); } else { $msg = 'comment_added'; $this->ipsclass->DB->simple_update( 'gallery_images', 'comments=comments+1, lastcomment='.time(), "id={$img}", 1 ); $this->ipsclass->DB->simple_exec(); $this->glib->resynch_everything( 0, $this->img['album_id'] ); if( $catdata['inc_post_count'] ) { $this->ipsclass->DB->simple_update( 'members', 'posts=posts+1', "id={$this->ipsclass->member['id']}", 1 ); $this->ipsclass->DB->simple_exec(); } require_once( GALLERY_LIBS . 'lib_notifications.php' ); $notify = new lib_notifications(); $notify->ipsclass =& $this->ipsclass; $notify->category =& $this->category; $notify->glib =& $this->glib; $notify->send_comment_notifications( $img ); } } $this->ipsclass->DB->do_insert( 'gallery_comments', $insert ); $this->glib->rebuild_stats_cache(); $this->ipsclass->print->redirect_screen( $this->ipsclass->lang[$msg], "autocom=gallery&req=si&img={$img}" ); } Поменял что-то местами, чесно говоря, слабо понимая что именно - и все стало на свои места. Премодерация отключена, а добавленый коментарий добавляется в счетчик коментариев... Теперь вопрос: Что я сделал и не станет ли от этого хуже? Ссылка на комментарий Поделиться на других сайтах Прочее
Sannis Опубликовано 10 Февраля 2009 Жалоба Поделиться Опубликовано 10 Февраля 2009 А в настройках категории галереи было слабо флажок переключить? Или виноваты вредные американцы, которые не перевели настройки на русский? Ссылка на комментарий Поделиться на других сайтах Прочее
SLASH_id Опубликовано 10 Февраля 2009 Автор Жалоба Поделиться Опубликовано 10 Февраля 2009 SannisЁклмн!!! Не, ну надо же её туда засунуть! Была бы тут система репутации - поставил бы вам +30!!! Теперь сижу и возвращаю оригинальные файлы на место))) Закрывайте тему))))) Ссылка на комментарий Поделиться на других сайтах Прочее
Sannis Опубликовано 10 Февраля 2009 Жалоба Поделиться Опубликовано 10 Февраля 2009 Логика наше всё +30 можно отправить в рублях, на полбутылки пЫва хватит. Ссылка на комментарий Поделиться на других сайтах Прочее
Рекомендуемые сообщения