Hello everyone, I have a script that shows the news posted on my website in a bigger format with comments ect... but it gives me the error
Parse error: syntax error, unexpected '}' in /home/stormgc/public_html/sources/news_view.php on line 50
I reviewed the code, I know what the error fix would be, but I cannot find the proper place to put it.
If someone could please review the script and help that would be awesome!
-->
<?
$id = $_GET['id'];
$news = mysql_query("SELECT * FROM `news` WHERE id='$id'");
if(mysql_num_rows($news) > 0){
$newz = mysql_fetch_array($news);
loadHeader($newz['title']);
}
if($_GET['update'] == 1){
confirm('You have successfully updated this news.');
}
?>
<br />
<div class="title"><? echo $newz['title']; ?><span class="options"><a href="index.php">Home</a> / <? echo $newz['title']; ?></span></div>
<div class="content">
<?
$username = $newz['username'];
?>
<div class="category"><a href="index.php?action=news_view&id=<? echo $newz['id']; ?>"><? echo $newz['title']; ?></a> posted on <? displayTime($newz['time'], 'F jS, Y \a\t g:i a'); ?>
<span class="options">By
<?
$accounts = mysql_query("SELECT * FROM accounts JOIN profiles ON accounts.username=profiles.username WHERE accounts.username='$username'");
if(mysql_num_rows($accounts) > 0){
$account = mysql_fetch_array($accounts);
?>
<a href="index.php?action=profile&user=<? echo $account['username']; ?>">{<? } echo $account['display_name']; ?></a>
<?
} else {
echo $username;
}
?>
</span></div>
<div class="cell1">
<?
echo parseText($newz['message']);
?>
<br /><br />
<a href="index.php?action=forums">Discuss this in the forums...</a>
<?
if($cur_account['staff'] == "on" || $cur_admin == 1){
?>
<br />
<br />
<a href="index.php?action=news_modify&id=<? echo $newz['id']; ?>">Modify</a> | <a href="" onClick="if(confirm('Are you sure you want to delete this news?')){ location.href='index.php?action=news_delete&id=<? echo $newz['id']; ?>'; } return false;">Delete</a>
<?
}
?>
</div>
<?
loadFooter();
} else {
fatalError('The news article you are trying to view does not exist.');
}
?>
Thanks,
NW