Parse error in search.php

Probleme bei der regulären Arbeiten mit phpBB, Fragen zu Vorgehensweisen oder Funktionsweise sowie sonstige Fragen zu phpBB im Allgemeinen.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.1, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
Danielsun
Mitglied
Beiträge: 23
Registriert: 19.01.2006 01:56

Parse error in search.php

Beitrag von Danielsun »

Hi,

wenn ich in meinem Forum oben rechts den Link "Beiträge seit dem letzten Besuch anzeigen" anklicke, bekomme ich folgende Fehlermeldung:

Parse error: parse error, unexpected T_IF in /www/htdocs/naga/phpBB2/search.php on line 1370

Ich benutze die version phpBB 2.0.19 und habe dieses ganz frisch installiert. Danach hatte ich ein Backup meines Forums (version phpBB 2.0.15) aufgespielt.

Woran könnte es liegen?

Vielen dank für Hilfe,
Mfg
Daniel
Benutzeravatar
hagily
Mitglied
Beiträge: 1139
Registriert: 25.08.2005 22:05
Wohnort: Schweinfurt
Kontaktdaten:

Beitrag von hagily »

Hi!
hast du die update_to_latest.php ausgeführt?

Felix
Danielsun
Mitglied
Beiträge: 23
Registriert: 19.01.2006 01:56

Beitrag von Danielsun »

Ja, die hab ich ausgeführt, der Fehler kommt leider trotzdem.
Benutzeravatar
hagily
Mitglied
Beiträge: 1139
Registriert: 25.08.2005 22:05
Wohnort: Schweinfurt
Kontaktdaten:

Beitrag von hagily »

verlinke mal deine search.php KB:datei
Danielsun
Mitglied
Beiträge: 23
Registriert: 19.01.2006 01:56

Beitrag von Danielsun »

Benutzeravatar
hagily
Mitglied
Beiträge: 1139
Registriert: 25.08.2005 22:05
Wohnort: Schweinfurt
Kontaktdaten:

Beitrag von hagily »

HI.
Sind irgendwelche mods eingebaut?

Felix
Danielsun
Mitglied
Beiträge: 23
Registriert: 19.01.2006 01:56

Beitrag von Danielsun »

Ja, ich habe den "Regmod" in der neusten Version installiert (http://www.regmod.clancodes.com/viewtopic.php?t=308) und folgende Änderungen in der search.php vorgenommen:

Code: Alles auswählen

#-----[ OPEN ]------------------------------------------
#
search.php


#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'includes/functions_search.'.$phpEx);


#
#-----[ AFTER, ADD ]------------------------------------------
#
// RegMod-Begin
include($phpbb_root_path . 'includes/functions_regmod.'.$phpEx);
// RegMod-End


#
#-----[ FIND ]------------------------------------------
#
				{
					$topic_type = '';
				}

#
#-----[ AFTER, ADD ]------------------------------------------
#
// RegMod-Begin
		if( ( $searchset[$i]['topic_reg']) && check_reg_active($topic_id) )
		{
			$regoption_array = array();
			if( $userdata['user_id'] )
			{
				$sql = "SELECT registration_status FROM ".REGISTRATION_TABLE." WHERE topic_id = $topic_id AND registration_user_id =".$userdata['user_id'];
				if ( !($result = $db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
				}

				if( $regrow = $db->sql_fetchrow($result) )
				{
					$status = $regrow['registration_status'];
					if( $status == REG_OPTION1 )
					{
						$topic_type .= '<span class="genoption1">&#149;</span>' . ' ';
					}
					else if( $status == REG_OPTION2 )
					{
						$topic_type .= '<span class="genoption2">&#149;</span>' . ' ';
					}
					else if( $status == REG_OPTION3 )
					{
						$topic_type .= '<span class="genoption3">&#149;</span>' . ' ';
					}
					else
					{
						$topic_type .= '<span class="genoption0">&#149;</span>' . ' ';
					}
				}
				else if( empty($regrow) && $topic_rowset[$i]['topic_reg'] )
				{
					$topic_type .= '<span class="genoption0">&#149;</span>' . ' ';
				}
				else
				{
					$topic_type .= '';
				}

				$db->sql_freeresult($result);
			}
			else
			{
				$topic_type .= $lang['Topic_RegLogin'] . ' ';
			}

			$sql = "SELECT u.username, u.user_id, r.registration_time, r.registration_confirm_time, r.registration_status FROM ".REGISTRATION_TABLE." r, ".USERS_TABLE." u WHERE r.topic_id=$topic_id AND r.registration_user_id = u.user_id ORDER BY registration_status,registration_time";

			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, "Could not obtain registration data for this topic", '', __LINE__, __FILE__, $sql);
			}
			$reg_info = $db->sql_fetchrowset($result);

			$db->sql_freeresult($result);
			$numregs = count($reg_info);
			$option1_count = 0;
			$option2_count = 0;
			$option3_count = 0;

			for( $u = 0; $u < $numregs; $u ++ )
			{
				if( $reg_info[$u]['registration_status'] == REG_OPTION1 )
				{
					$option1_count ++;
				}
				else if( $reg_info[$u]['registration_status'] == REG_OPTION2 )
				{
					$option2_count++;
				}
				else if( $reg_info[$u]['registration_status'] == REG_OPTION3 )
				{
					$option3_count ++;
				}
			}

			if (true === check_option_exists($topic_id,1))
			{
				$option1_count = '<span class="genoption1">'.(0+$option1_count).'</span>';
				array_push($regoption_array, $option1_count);
			}
			if (true === check_option_exists($topic_id,2))
			{
				$option2_count = '<span class="genoption2">'.(0+$option2_count).'</span>';
				array_push($regoption_array, $option2_count);
			}
			if (true === check_option_exists($topic_id,3))
			{
				$option3_count = '<span class="genoption3">'.(0+$option3_count).'</span>';
				array_push($regoption_array, $option3_count);
			}
			$regoptions_count = count($regoption_array);

			$v = 0;
			while ( $v < $regoptions_count-1 )
			{
				$regoptions .= $regoption_array[$v].'-';
				$v++;
			}
			$regoptions .= array_pop($regoption_array);
		}
// RegMod-End


#
#-----[ FIND ]------------------------------------------
#
					'TOPIC_TYPE' => $topic_type,


#
#-----[ AFTER, ADD ]------------------------------------------
#
// RegMod-Begin
			 		'REG_OPTIONS' => $regoptions,
// RegMod-End


#
#-----[ FIND ]------------------------------------------
#
					'U_VIEW_TOPIC' => $topic_url)
				);


#
#-----[ AFTER, ADD ]------------------------------------------
#
// RegMod-Begin
			if( ( $searchset[$i]['topic_reg'] ) && check_reg_active($topic_id) )
			{
				$template->assign_block_vars('searchresults.display_reg', array());
			}
// RegMod-End
[/code]
Benutzeravatar
hagily
Mitglied
Beiträge: 1139
Registriert: 25.08.2005 22:05
Wohnort: Schweinfurt
Kontaktdaten:

Beitrag von hagily »

Hi.

Du hast einen Teil falsch eingebaut:
Suche

Code: Alles auswählen

					'U_VIEW_TOPIC' => $topic_url)
			if( ( $searchset[$i]['topic_reg'] ) && check_reg_active($topic_id) )
			{
				$template->assign_block_vars('searchresults.display_reg', array());
			}
				);
Ersetze mit:

Code: Alles auswählen

					'U_VIEW_TOPIC' => $topic_url)
);
			if( ( $searchset[$i]['topic_reg'] ) && check_reg_active($topic_id) )
			{
				$template->assign_block_vars('searchresults.display_reg', array());
			}
				
Danielsun
Mitglied
Beiträge: 23
Registriert: 19.01.2006 01:56

Beitrag von Danielsun »

Super! Vielen, vielen Dank für deine extrem schnelle Hilfe, klappt einwandfrei!


Blödes Semikolon.
Benutzeravatar
hagily
Mitglied
Beiträge: 1139
Registriert: 25.08.2005 22:05
Wohnort: Schweinfurt
Kontaktdaten:

Beitrag von hagily »

Danielsun hat geschrieben:Blödes Semikolon.
Wie auf der Arbeit mit dem Chef: Notwendig aber totaaaal nervig!

Felix
Antworten

Zurück zu „phpBB 2.0: Administration, Benutzung und Betrieb“