Seite 1 von 1
Parse error in search.php
Verfasst: 20.01.2006 18:53
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
Verfasst: 20.01.2006 18:54
von hagily
Hi!
hast du die update_to_latest.php ausgeführt?
Felix
Verfasst: 20.01.2006 18:58
von Danielsun
Ja, die hab ich ausgeführt, der Fehler kommt leider trotzdem.
Verfasst: 20.01.2006 19:01
von hagily
verlinke mal deine search.php KB:datei
Verfasst: 20.01.2006 19:04
von Danielsun
Verfasst: 20.01.2006 19:16
von hagily
HI.
Sind irgendwelche mods eingebaut?
Felix
Verfasst: 20.01.2006 19:19
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">•</span>' . ' ';
}
else if( $status == REG_OPTION2 )
{
$topic_type .= '<span class="genoption2">•</span>' . ' ';
}
else if( $status == REG_OPTION3 )
{
$topic_type .= '<span class="genoption3">•</span>' . ' ';
}
else
{
$topic_type .= '<span class="genoption0">•</span>' . ' ';
}
}
else if( empty($regrow) && $topic_rowset[$i]['topic_reg'] )
{
$topic_type .= '<span class="genoption0">•</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]
Verfasst: 20.01.2006 19:23
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());
}
Verfasst: 20.01.2006 19:29
von Danielsun
Super! Vielen, vielen Dank für deine extrem schnelle Hilfe, klappt einwandfrei!
Blödes Semikolon.
Verfasst: 20.01.2006 19:31
von hagily
Danielsun hat geschrieben:Blödes Semikolon.
Wie auf der Arbeit mit dem Chef: Notwendig aber totaaaal nervig!
Felix