Перейти к контенту

Премодерация коментраиев


Рекомендуемые сообщения

Использую галерею 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

 

Подскажите как бороться....

Ссылка на комментарий
Поделиться на других сайтах

Говорю же... Если так сделать, коментарии хоть и показываются всем, но ставятся в очередь((

 

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}" );

}

 

 

Поменял что-то местами, чесно говоря, слабо понимая что именно - и все стало на свои места. Премодерация отключена, а добавленый коментарий добавляется в счетчик коментариев...

 

Теперь вопрос: Что я сделал и не станет ли от этого хуже?

Ссылка на комментарий
Поделиться на других сайтах

А в настройках категории галереи было слабо флажок переключить? :D Или виноваты вредные американцы, которые не перевели настройки на русский? ;)
Ссылка на комментарий
Поделиться на других сайтах

Sannis

Ёклмн!!! Не, ну надо же её туда засунуть!

 

Была бы тут система репутации - поставил бы вам +30!!!

 

Теперь сижу и возвращаю оригинальные файлы на место)))

;):D

 

Закрывайте тему)))))

Ссылка на комментарий
Поделиться на других сайтах

Логика наше всё :D +30 можно отправить в рублях, на полбутылки пЫва хватит.
Ссылка на комментарий
Поделиться на других сайтах

Гость
Эта тема закрыта для публикации сообщений.
×
×
  • Создать...

Важная информация

Находясь на нашем сайте, вы соглашаетесь на использование файлов cookie, а также с нашим положением о конфиденциальности Политика конфиденциальности и пользовательским соглашением Условия использования.