Jump to content
Дизайн и модификация IPS Community IPBSkinsBETA
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
VadimD

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

Recommended Posts

Уважаемые гуру, прошу вашей помощи. Появились ошибки при поиске по форумам и пользователям. Думаю, что после обновления 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

Share this post


Link to post
Share on other sites

Открыть /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' )

  • Upvote 2

Share this post


Link to post
Share on other sites

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

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...