Parse error: syntax error

Hello,

I have an Error on the Flight Schedules Page.

The Error: Parse error: syntax error, unexpected ‘}’ in …/core/templates/schedule_results.tpl on line 102

Hey there,

What version?

Hi,

Version 1.2.700

Are you using the default template/have you modified it?

Try re-uploading it from a fresh download, it’s possible it got mangled while uploading

Yes i use the Default template and i have changed the File with an new Download from the PHPVMS site.

The problem is not solved

Can you upload the /core/templates/schedule_results.tpl or paste it into pastebin?

Of Coure.

Thanks for you Help

<?php
if(!$allroutes)
{
echo '<p align="center">No routes have been found!</p>';
return;
}
?>
<table id="tabledlist" class="tablesorter">
<thead>
<tr>
<th>Flight Info</th>
<th>Options</th>
</tr>
</thead>
<tbody>
<?php
foreach($allroutes as $route)
{
/*
Skip over a route if it's not for this day of week
Left this here, so it can be omitted if your VA
 doesn't use this. 

Comment out these two lines if you don't want to.
*/

if(strpos($route->daysofweek, date('w')) === false)
	continue;

/* END DAY OF WEEK CHECK */



/*
This will skip over a schedule if it's been bid on
This only runs if the below setting is enabled

If you don't want it to skip, then comment out
this code below by adding // in front of each 
line until the END DISABLE SCHEDULE comment below

If you do that, and want to show some text when
it's been bid on, see the comment below
*/
if(Config::Get('DISABLE_SCHED_ON_BID') == true && $route->bidid != 0)
{
	continue;
}
/* END DISABLE SCHEDULE ON BID */

/* THIS BEGINS ONE TABLE ROW */
?>
<tr>
<td >
	<a href="<?php echo SITE_URL?>/index.php/schedules/details/<?php echo $route->id?>"><?php echo $route->code . $route->flightnum?><?php echo '('.$route->depicao.' - '.$route->arricao.')'?></a>
	<br />

	<strong>Departure: </strong><?php echo $route->deptime;?>         <strong>Arrival: </strong><?php echo $route->arrtime;?><br />
	<strong>Equipment: </strong><?php echo $route->aircraft; ?> (<?php echo $route->registration;?>)  <strong>Distance: </strong><?php echo $route->distance . Config::Get('UNITS');?>
	<br />
	<strong>Days Flown: </strong><?php echo Util::GetDaysCompact($route->daysofweek); ?><br />
	<?php echo ($route->route=='')?'':'<strong>Route: </strong>'.$route->route.'<br />' ?>
	<?php echo ($route->notes=='')?'':'<strong>Notes: </strong>'.html_entity_decode($route->notes).'<br />' ?>

	<?php
	# Note: this will only show if the above code to
	#	skip the schedule is commented out
	if($route->bidid != 0)
	{
		echo 'This route has been bid on';
	}
	?>
</td>
<td nowrap>
	<a href="<?php echo SITE_URL?>/index.php/schedules/details/<?php echo $route->id?>">View Details</a><br />
	<a href="<?php echo SITE_URL?>/index.php/schedules/brief/<?php echo $route->id?>">Pilot Brief</a><br />

	<?php 
	# Don't allow overlapping bids and a bid exists
	if(Config::Get('DISABLE_SCHED_ON_BID') == true && $route->bidid != 0)
	{
	?>
		<a id="<?php echo $route->id; ?>" class="addbid" 
			href="<?php echo SITE_URL?>/action.php/Schedules/addbid/">Add to Bid</a>
	<?
	}
	else
	{
		if (Auth::LoggedIn())
		{
		 ?>
			<a id="<?php echo $route->id; ?>" class="addbid" 
				href="<?php echo SITE_URL?>/action.php/Schedules/addbid/">Add to Bid</a>
		<?php			 
		}
	}		
	?>
</td>
</tr>
<?php
/* END OF ONE TABLE ROW */
}
?>
</tbody>
</table>
<hr>

Can you me not help?

Sorry, hmm, I don’t see any errors at all. Can you try the beta and see if you still get that error?

I’ve got the same error. solved it just by removing last section of php code in template

<?php

/* END OF ONE TABLE ROW */

}

?>

but error definitely is not here as this way cycle foreach closes not in template but somwhere else.

correction - I’ve just commented like this

<?php

/* END OF ONE TABLE ROW */

/* } */

?>

that helped me to rid of parse error and I got schedules working back, have no idea what and why has happened. maybe reason is what I have moved site from linux to windows xp based server with WAMP server, where php 5.3.0 is used, while phpvms is designed for older version of php. I’m also geting deprecated warnings for some functions like split() and etc..

I haven’t been able to test against 5.3, there’s no Ubuntu package for it yet.

Do you have the list of functions you get depreciated errors for? I was trying to fix all of those (as I encountered them), but haven’t been able to get a full list

mostly it is split()

there was call_user_method_array() couple of times but now I cant find a page where it was, or maybe this warning has gone after upgrade to 808

mostly it is split()

there was call_user_method_array() couple of times but now I cant find a page where it was, or maybe this warning has gone after upgrade to 808

Yeah, I fixed that one. The split error might be in one of the 3rd party libraries I use.

at last I’ve figured out true nature of that parse error.

in fact there is no need to comment string 102 (at least it is 102 in v808) which has only }.

Problem has been caused by Nabeel’s beloved short php at string 85 - it was <?, instead of <?php . I have changed that and template started to work fine. I found this error as I started to search why I can’t get “add to bid” for schedules - that was second cause of this error

D’oh, where was that?

…/core/templates/schedule_results.tpl

line 85, right before last else

Ahh sneaky. Fixed on the dev copy, thanks alot!

you are welcome i’m glad to be able to improve this project.