Перейти к публикации
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.

Ошибки Illegal string offset (3.1.4)

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

Уважаемые гуру, прошу вашей помощи. Появились ошибки при поиске по форумам и пользователям. Думаю, что после обновления PHP до версии 5.4, но откатываться назад никак нельзя. Поэтому если есть решение прошу помочь.

 

Поиск по форумам выдает ошибку:

 

Warning: Illegal string offset 'contentOnly' in /www/site.ru/forum/admin/applications/forums/extensions/search/engines/sql.php on line 1055

Warning: Illegal string offset 'noPreview' in /www/site.ru/forum/admin/applications/forums/extensions/search/engines/sql.php on line 1049

Warning: Illegal string offset 'pCount' in /www/site.ru/forum/admin/applications/forums/extensions/search/engines/sql.php on line 1061

Warning: Illegal string offset 'pViews' in /www/site.ru/forum/admin/applications/forums/extensions/search/engines/sql.php on line 1067

 

При поиске среди пользователей:

 

Warning: Illegal string offset 'searchInKey' in /www/site.ru/forum/admin/applications/members/extensions/search/engines/sql.php on line 391

 

Версия IP.Board v3.1.4 PHP 5.4.4-14

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

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

Открыть /admin/applications/forums/extensions/search/engines/sql.php

Найти

		foreach( $data as $field => $_data )
		{
			/* CONTENT ONLY */
			if ( $field == 'noPreview' AND $_data['noPreview'] == 0 )
			{
				IPSSearchRegistry::set( 'opt.noPostPreview', false );
			}

			/* CONTENT ONLY */
			if ( $field == 'contentOnly' AND $_data['contentOnly'] == 1 )
			{
				IPSSearchRegistry::set( 'opt.onlySearchPosts', true );
			}

			/* POST COUNT */
			if ( $field == 'pCount' AND intval( $_data['pCount'] ) > 0 )
			{
				$return[] = array( 'column' => 't.posts', 'operator' => '>=', 'value' => intval( $_data['pCount'] ) );
			}

			/* TOPIC VIEWS */
			if ( $field == 'pViews' AND intval( $_data['pViews'] ) > 0 )
			{
				$return[] = array( 'column' => 't.views', 'operator' => '>=', 'value' => intval( $_data['pViews'] ) );
			}
		}

Заменить на

 

		foreach( $data as $field => $_data )
		{
			/* CONTENT ONLY */
			if ( $field == 'noPreview' AND $_data == 0 )
			{
				IPSSearchRegistry::set( 'opt.noPostPreview', false );
			}

			/* CONTENT ONLY */
			if ( $field == 'contentOnly' AND $_data == 1 )
			{
				IPSSearchRegistry::set( 'opt.onlySearchPosts', true );
			}

			/* POST COUNT */
			if ( $field == 'pCount' AND intval( $_data ) > 0 )
			{
				$return[] = array( 'column' => 't.posts', 'operator' => '>=', 'value' => intval( $_data ) );
			}

			/* TOPIC VIEWS */
			if ( $field == 'pViews' AND intval( $_data ) > 0 )
			{
				$return[] = array( 'column' => 't.views', 'operator' => '>=', 'value' => intval( $_data ) );
			}
		}

 

Открыть /admin/applications/members/extensions/search/engines/sql.php

 

Найти

			if ( $field == 'searchInKey' AND $_data['searchInKey'] == 'members' )

Заменить на

 

			if ( $field == 'searchInKey' AND $_data == 'members' )

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

Спасибо! Как всегда всё чётко и оперативно :)

Если не сложно, что мы убрали из кода?

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

Сейчас на странице 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.