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

Очень много ошибок в topics.php


alextan

Вопрос

Помогите пожалуйста, просмотрел лог ошибок, а там каждые 10 секунд она и та же ошибка:

PHP Warning:  eregi() [<a href='function.eregi'>function.eregi</a>]: REG_EMPTY in /var/www/vhosts/httpdocs/forum/sources/action_public/topics.php on line 829

 

В topics.php в 829 строке:

if (eregi($this->ipsclass->member['members_display_name'], $row['post']))

 

А тут полнее:

 

	function parse_row( $row = array() )
{
	$poster = array();

	//-----------------------------------------
	// Cache member
	//-----------------------------------------

	if ($row['author_id'] != 0)
	{
		//-----------------------------------------
		// Is it in the hash?
		//-----------------------------------------

		if ( isset($this->cached_members[ $row['author_id'] ]) )
		{
			//-----------------------------------------
			// Ok, it's already cached, read from it
			//-----------------------------------------

			$poster = $this->cached_members[ $row['author_id'] ];
			$row['name_css'] = 'normalname';
		}
		else
		{
			$row['name_css'] = 'normalname';
			$poster = $this->parse_member( $row );

			//-----------------------------------------
			// Add it to the cached list
			//-----------------------------------------

			$this->cached_members[ $row['author_id'] ] = $poster;
		}
					$poster['reputation_minus'] = str_replace("{PID}", $row['pid'], $poster['reputation_minus']);
					$poster['reputation_add'] = str_replace("{PID}", $row['pid'], $poster['reputation_add']);

	}
	else
	{
		//-----------------------------------------
		// It's definitely a guest...
		//-----------------------------------------

		$poster = $this->ipsclass->set_up_guest( $row['author_name'] );
		$poster['members_display_name'] = $row['author_name'];
		$row['name_css']				= 'unreg';
	}

	//-----------------------------------------

	if ( $row['queued'] or ($this->topic['topic_firstpost'] == $row['pid'] and $this->topic['approved'] != 1) )
	{
		$row['post_css'] = $this->post_count % 2 ? 'post1shaded' : 'post2shaded';
		$row['altrow']   = 'row4shaded';
	}
	else
	{
СТРОКА 829						 if (eregi($this->ipsclass->member['members_display_name'], $row['post']))
					{
			$row['post_css'] = 'post3';
		}
		else
		{
			$row['post_css'] = $this->post_count % 2 ? 'post1' : 'post2';
		}
		$row['altrow']   = 'row4';
	}

	//-----------------------------------------

	if ( ($row['append_edit'] == 1) and ($row['edit_time'] != "") and ($row['edit_name'] != "") )
	{
		$e_time = $this->ipsclass->get_date( $row['edit_time'] , 'LONG' );

		$row['post'] .= "<br /><br /><span class='edit'>".sprintf($this->ipsclass->lang['edited_by'], $row['edit_name'], $e_time)."</span>";
	}

	//-----------------------------------------

	if (!$this->ipsclass->member['view_img'])
	{
		//-----------------------------------------
		// unconvert smilies first, or it looks a bit crap.
		//-----------------------------------------

		$row['post'] = preg_replace( "#<!--emo&(.+?)-->.+?<!--endemo-->#", "\\1" , $row['post'] );

		$row['post'] = preg_replace( "/<img src=[\"'](.+?)[\"'].+?".">/", "(IMG:<a href='\\1' target='_blank'>\\1</a>)", $row['post'] );
	}


	//-----------------------------------------
	// Highlight...
	//-----------------------------------------

	if ($this->ipsclass->input['hl'])
	{
		$this->ipsclass->input['hl'] = $this->ipsclass->parse_clean_value(urldecode($this->ipsclass->input['hl']));
		$loosematch = strstr( $this->ipsclass->input['hl'], '*' ) ? 1 : 0;
		$keywords   = str_replace( '*', '', str_replace( "+", " ", str_replace( '-', '', trim($this->ipsclass->input['hl']) ) ) );
		$word_array = array();
		$endmatch1  = "";
		# Added '?' to mean 'or not'. Another bug spotted by TheWalrus. :D
		$endmatch2  = "(.)?";

		if ( preg_match("/,(and|or),/i", $keywords) )
		{
			while ( preg_match("/,(and|or),/i", $keywords, $match) )
			{
				$word_array = explode( ",".$match[1].",", $keywords );
				$keywords   = str_replace( $match[0], '' ,$keywords );
			}
		}
		else if ( strstr( $keywords, ' ' ) )
		{
			$word_array = explode( ' ', str_replace( '  ', ' ', $keywords ) );
		}
		else
		{
			$word_array[] = $keywords;
		}

		if ( ! $loosematch )
		{
			$endmatch1 = "(\s|,|\.|!|<br|&|$)";
			$endmatch2 = "(\<|\s|,|\.|!|<br|&|$)";
		}

		if (is_array($word_array))
		{
			foreach ($word_array as $keywords)
			{
				while( preg_match( "/(^|\s|;)(".preg_quote($keywords, '/')."){$endmatch1}/i", $row['post'] ) )
			   {
				   $row['post'] = preg_replace( "/(^|\s|;|\>)(".preg_quote($keywords, '/')."){$endmatch2}/is", "\\1<span class='searchlite'>\\2</span>\\3", $row['post'] );
			   }
			}
		}
	}

	//-----------------------------------------
	// Online, offline?
	//-----------------------------------------

	if ( $row['author_id'] )
	{
		$time_limit = time() - $this->ipsclass->vars['au_cutoff'] * 60;

		$poster['online_status_indicator'] = '<{PB_USER_OFFLINE}>';

		list( $be_anon, $loggedin ) = explode( '&', $row['login_anonymous'] );

		if ( ( $row['last_visit'] > $time_limit or $row['last_activity'] > $time_limit ) AND $be_anon != 1 AND $loggedin == 1 )
		{
			$poster['online_status_indicator'] = '<{PB_USER_ONLINE}>';
		}
	}
	else
	{
		$poster['online_status_indicator'] = '';
	}

	//-----------------------------------------
	// Multi Quoting?
	//-----------------------------------------

	$row['mq_start_image'] = $this->ipsclass->compiled_templates['skin_topic']->mq_image_add($row['pid']);

	if ( $this->qpids )
	{
		if ( strstr( ','.$this->qpids.',', ','.$row['pid'].',' ) )
		{
			$row['mq_start_image'] = $this->ipsclass->compiled_templates['skin_topic']->mq_image_remove($row['pid']);
		}
	}

	//-----------------------------------------
	// Multi PIDS?
	//-----------------------------------------

	if ( $this->ipsclass->member['is_mod'] )
	{
		$row['pid_start_image'] = $this->ipsclass->compiled_templates['skin_topic']->pid_image_unselected($row['pid']);

		if ( $this->ipsclass->input['selectedpids'] )
		{
			if ( strstr( ','.$this->ipsclass->input['selectedpids'].',', ','.$row['pid'].',' ) )
			{
				$row['pid_start_image'] = $this->ipsclass->compiled_templates['skin_topic']->pid_image_selected($row['pid']);
			}

			$this->ipsclass->input['selectedpidcount'] = count( explode( ",", $this->ipsclass->input['selectedpids'] ) );

		}
	}

	//-----------------------------------------
	// Delete button..
	//-----------------------------------------

	if ( $row['pid'] != $this->topic['topic_firstpost'] )
	{
		$row['delete_button'] = $this->delete_button($row['pid'], $poster);
	}
	/*/ -- Thanks (by AVol) - Begin -- /*/
	if ($this->ipsclass->vars['thanks_mod_enable'])
	{
		$member_thanks = explode(',',$row['post_thanks']);

		if (   ( in_array($this->topic['forum_id'], explode(',',$this->ipsclass->vars['thanks_forums'])) or (!$this->ipsclass->vars['thanks_forum_lim']) )
			and ( in_array($this->ipsclass->member['mgroup'], explode(',',$this->ipsclass->vars['thanks_from_groups'])) or (!$this->ipsclass->vars['thanks_from_grp_lim']) )
			and ( in_array($poster['mgroup'], explode(',',$this->ipsclass->vars['thanks_to_groups'])) or (!$this->ipsclass->vars['thanks_to_grp_lim']) )
			and ($this->ipsclass->member['id'])   )
		{
			if ( (!in_array($this->ipsclass->member['id'],$member_thanks)) and ($this->ipsclass->member['id'] != $row['author_id']) )
			{
				$row['thanks_button'] = $this->ipsclass->compiled_templates['skin_topic']->button_thanks($row['pid'] );
			}
		}

		if (   ( in_array($this->ipsclass->member['mgroup'], explode(',',$this->ipsclass->vars['thanks_view_groups'])) or (!$this->ipsclass->vars['thanks_view_grp_lim']) )
			and ( (count($member_thanks) > 0) && ($member_thanks[0] != "") )   )
		{
			$in_thanks = (count($member_thanks)==2) ? $row['post_thanks'] : implode(',',$member_thanks);

			$this->ipsclass->DB->simple_construct( array( 'select' => '`id`, `members_display_name`', 'from' => 'members', 'where' => '`id` IN (' . $in_thanks . ')', 'order' => '`members_display_name` ASC') );
			$this->ipsclass->DB->simple_exec();

			while($who_thanks = $this->ipsclass->DB->fetch_row())
			{
				$show_thanks .= "<a href='{$this->ipsclass->base_url}showuser={$who_thanks['id']}' target='_blank'>" . $who_thanks['members_display_name'] . "</a>" . ', ';
			}
			$row['who_thanks'] = "<br /><br /><div class=\"thin\"><I>{$this->ipsclass->lang['thx_thanks_told']}:</I><div class=\"signature\">" . $show_thanks . "</div></div>";
		}
	}
	/*/ -- Thanks (by AVol) -  End  -- /*/
	$row['edit_button']   = $this->edit_button($row['pid'], $poster, $row['post_date']);

	$row['post_date']	 = $this->ipsclass->get_date( $row['post_date'], 'LONG' );

	$row['post_icon']	 = $row['icon_id']
						  ? $this->ipsclass->compiled_templates['skin_topic']->post_icon( $row['icon_id'] )
						  : "";

	$row['ip_address']	= $this->view_ip($row, $poster);

	$row['report_link']   = (($this->ipsclass->vars['disable_reportpost'] != 1) and ( $this->ipsclass->member['id'] ))
						  ? $this->ipsclass->compiled_templates['skin_topic']->report_link($row)
						  : "";

	//-----------------------------------------
	// Siggie stuff
	//-----------------------------------------

	$row['signature'] = "";

	if ($poster['signature'] and $this->ipsclass->member['view_sigs'])
	{
		if ($row['use_sig'] == 1)
		{
			$this->parser->parse_html  = intval($this->ipsclass->vars['sig_allow_html']);
			$this->parser->parse_nl2br = 1;

			$row['signature'] = $this->ipsclass->compiled_templates['skin_global']->signature_separator( $this->parser->pre_display_parse($poster['signature']) );
		}
	}

	//-----------------------------------------
	// Fix up the membername so it links to the members profile
	//-----------------------------------------

//AJAX +Quote by Sannis
$quick_quote_name = str_replace( array(" ", "'"), array(" ", "\'"), $poster['members_display_name'] );
$row['quick_quote_link'] = "<a href=\"java script:ajax_quick_quote('{$quick_quote_name}', '{$row['post_date']}', '{$row['pid']}');\">Быстрая цитата</a>";
//AJAX +Quote by Sannis

	if ( $poster['id'] )
	{
		//$poster['members_display_name'] = "<a href='{$this->base_url}showuser={$poster['id']}'>{$poster['members_display_name']}</a>";

		$poster['members_display_name'] = "<a href=\"java script:Show('qr_open','qr_closed');java script:ins('".str_replace( array(" ", "'"),array(" ", "'"),
		$poster['members_display_name'] )."');java script:MySetFocus(REPLIER.fastreplyarea)\">{$this->ipsclass->cache['group_cache'][ $poster['mgroup'] ]['prefix']}{$poster['members_display_name']}{$ibforums->cache['group_cache'][ $poster['mgroup'] ]['suffix']}</a>";



	}

	//-----------------------------------------
	// Parse HTML tag on the fly
	//-----------------------------------------

	$this->parser->parse_html  = ( $this->forum['use_html'] and $this->ipsclass->cache['group_cache'][ $poster['mgroup'] ]['g_dohtml'] and $row['post_htmlstate'] ) ? 1 : 0;
	$this->parser->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0;

	$row['post'] = $this->parser->pre_display_parse( $row['post'] );
		if ($this->topic['topic_firstpost'] == $row['pid'] && $row['topic_move_note'])
		{
			$row['post'] .= $row['topic_move_note'];
		}
	//-----------------------------------------
	// A bit hackish - but there are lots of <br> => <br /> changes to make
	//-----------------------------------------

	//$row['post']	  = str_replace( "<br>", "<br />", $row['post'] );
	//$row['signature'] = str_replace( "<br>", "<br />", $row['signature'] );

	//-----------------------------------------
	// Post number
	//-----------------------------------------

	if ( $this->topic_view_mode == 'linearplus' and $this->topic['topic_firstpost'] == $row['pid'])
	{
		$row['post_count'] = 1;

		if ( ! $this->first )
		{
			$this->post_count++;
		}
		$row['post_count_link'] = intval($this->ipsclass->input['st']) + $this->post_count + 1;
	}
	else
	{
		$this->post_count++;

		$row['post_count'] = intval($this->ipsclass->input['st']) + $this->post_count;
		$row['post_count_link'] = $row['post_count'] + 1;
	}

	$row['forum_id'] = $this->topic['forum_id'];

	return array( 'row' => $row, 'poster' => $poster );
}

 

 

странно, вроде заключил в спойлер, но он все равно растянулся во весь текст ((

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

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

  • 0
какой-то мод, eregi ересь

Какой может быть выход, весь лог только в этих ошибках? Что делать?

 

 

Выяснилось, что именно из-за данной ошибки невозможно прикрепить файлы к постам. Может кто поможет решить проблему, не бесплатно разумеется, за вознаграждение?

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

  • 0

да смысл в том, чтобы заменить эту ересь на более адекватное выражение

смысл мода в чем? подсветить посты, адресованные юзеру, другим светом?

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

  • 0
да смысл в том, чтобы заменить эту ересь на более адекватное выражение

смысл мода в чем? подсветить посты, адресованные юзеру, другим светом?

Именно!, пост адресованный пользователю, становится более темным

Может есть смысл вообще это удалить?

 

 

Было так:

						if (eregi($this->ipsclass->member['members_display_name'], $row['post']))
					{
			$row['post_css'] = 'post3';
		}
		else
		{
			$row['post_css'] = $this->post_count % 2 ? 'post1' : 'post2';
		}

 

Оставить:

				$row['post_css'] = $this->post_count % 2 ? 'post1' : 'post2';

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

  • 0

if (preg_match('#'.$this->ipsclass->member['members_display_name'].'#i', $row['post']))

попробуй вместо этой строчки

 

работать должно также, ошибок должно быть нет (:

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

  • 0
if (preg_match('#'.$this->ipsclass->member['members_display_name'].'#i', $row['post']))

попробуй вместо этой строчки

 

работать должно также, ошибок должно быть нет (:

Arhar, Спасибо тебе огромное, проблема с ошибками решилась.

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

  • 0
preg_quote() забыли :D В именах # как раз можно встретить.
Ссылка на комментарий
Поделиться на других сайтах

Присоединиться к обсуждению

Вы можете ответить сейчас, а зарегистрироваться позже. Если у вас уже есть аккаунт, войдите, чтобы ответить от своего имени.

Гость
Ответить на вопрос...

×   Вы вставили отформатированный текст.   Удалить форматирование

  Допустимо не более 75 смайлов.

×   Ваша ссылка была автоматически заменена на медиа-контент.   Отображать как ссылку

×   Ваши публикации восстановлены.   Очистить редактор

×   Вы не можете вставить изображения напрямую. Загрузите или вставьте изображения по ссылке.

Зарузка...
×
×
  • Создать...

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

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