Перейти к публикации
View in the app

A better way to browse. Learn more.

Дизайн и модификация Invision Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Вывод изображений из галереи

Опубликовано:

Здравствуйте. Нужно запретить вывод изображений из определенной категории, уже неделю мучаюсь не могу решить проблему.

 

Есть файл в папке хуков(boardIndexGalleryImages_), вот он

 

<?php

class boardIndexGalleryImages
{
public $registry;

public function __construct()
{
	$this->registry = ipsRegistry::instance();
	$this->settings =& $this->registry->fetchSettings();
	$this->DB	   = ipsRegistry::DB();
}

public function getOutput()
{
	/* Setup Gallery Environment */
	require_once( IPSLib::getAppDir( 'gallery' ) . '/app_class_gallery.php' );
	$gallery = new app_class_gallery( $this->registry );

	$this->registry->class_localization->loadLanguageFile( array( 'public_gallery'), 'gallery' );

	/* Image Listing */
	require_once( GALLERY_LIBS .'lib_imagelisting.php' );

	/* Return Output */
	$img_list =  new lib_imagelisting( $this->registry );

	if( $this->settings['gallery_stats_where'] == 'both' OR $this->settings['gallery_stats_where'] == 'cat' )
	{
		$allow_cats = $this->registry->category->getAllowedCats( 1, $this->registry->category->cat_lookup );
	}

	if( !$this->settings['gallery_cache_albums'] AND ( $this->settings['gallery_stats_where'] == 'both' OR $this->settings['gallery_stats_where'] == 'album' ) )
	{
		$allow_albums = true;
	}
	else if( $this->settings['gallery_stats_where'] == 'both' OR $this->settings['gallery_stats_where'] == 'album' )
	{
		$allow_albums = $this->registry->glib->getAllowedAlbums();
	}

	$img_list->getListingData( array(
										'st'		   => 0,
										'show'		 => 6,
										'approve'	  => 1,
										'sort_key'	 => 'i.idate',
										'album'		=> 0,
										'category'	 => 0,
										'allow_cats'   => $allow_cats,
										'allow_albums' => $allow_albums,
							)	);

	/* Found images? */
	if( ! $this->DB->getTotalRows( $img_list->res ) )
	{
		return '';
	}

	/* Build output array */
	$rows = array();

	while( $r = $this->DB->fetch( $img_list->res ) )
	{
		$r['_image'] = $this->registry->glib->makeImageLink( $r, $r['thumbnail'] );
		$rows[] = $r;
	}

	return $this->registry->output->getTemplate( 'boards' )->hookRecentGalleryImages( $rows );
}
}

 

изменять наверно здесь нужно:

 

		$img_list->getListingData( array(
										'st'		   => 0,
										'show'		 => 6,
										'approve'	  => 1,
										'sort_key'	 => 'i.idate',
										'album'		=> 0,
										'category'	 => 3,
										'allow_cats'   => $allow_cats,
										'allow_albums' => $allow_albums,
							)	);

 

Пробовал ставить так 'category' != 3, но не получается, все равно из этой категории показываются изображения.

 

Я не разбираюсь в PHP подскажите пожалуйста как запретить вывод изображений из категории №3.

 

Заранее очень благодарен за помощь!

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

Опубликовано:
изменять наверно здесь нужно:

Не здесь. Если только из 3 галереи, надо было показывать картинки, то да.

 

но не получается, все равно из этой категории показываются изображения.

Ага. Этот мод очень простой и много ждать от него не стоит.

 

Я не разбираюсь в PHP подскажите пожалуйста как запретить вывод изображений из категории №3.

Сегодня не посмотрю, а завтра - послезавтра, постараюсь.

Опубликовано:
  • Автор
Не здесь. Если только из 3 галереи, надо было показывать картинки, то да.

 

 

Ага. Этот мод очень простой и много ждать от него не стоит.

 

 

Сегодня не посмотрю, а завтра - послезавтра, постараюсь.

 

Спасибо большое!!! буду с нетерпением ждать! :)

Опубликовано:
  • Автор

Ph-A Вы про меня не забыли? :rolleyes:

Опубликовано:

Не забыл. :(

Создайте аккаунт или войдите в него для комментирования

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.