Topic: parse error after viewtopic.php modification
i'm trying to generate html on the server for displayin on client browsner using php (with no knowledge of it ...).
my code is build with 'viewtopic.php', 'AP_News_Generator.php' and 'AP_News_Generator\news.tpl' extracts (PunBB v1.2.12)
when running my 'viewtopicnews.php' i get that error mess :
"Parse error: syntax error, unexpected ';' in (...)/forum/viewtopicnews.php on line 59"
does anyone with php knowledge can xplain me where is my mistake and eventually help me fix it?
heres the code:
<?php
/***********************************************************************
Copyright (C) 2002-2005 Rickard Andersson (rickard@punbb.org)
This file is part of PunBB.
PunBB is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
PunBB is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
************************************************************************/
// The forum from which we'll pull the news bits
$forum_id = 5;
// Number of news posts to include in the index
$num_posts_index = 10;
// Path to news item template
$template_path = PUN_ROOT.'plugins/AP_News_Generator/news.tpl';
/***********************************************************************
DO NOT EDIT BELOW THIS LINE
/***********************************************************************/
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'header.php';
require PUN_ROOT.'include/parser.php';
// Generate front page news
$result = $db->query('SELECT id, subject FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id.' ORDER BY sticky DESC, posted DESC LIMIT 0, '.$num_posts_index) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
if (!$db->num_rows($result))
message('There are no topics to generate news based on in forum with ID = '.$forum_id.'.');
while ($cur_topic = $db->fetch_assoc($result))
{
$result2 = $db->query('SELECT posted, poster, message, hide_smilies FROM '.$db->prefix.'posts WHERE topic_id='.$cur_topic['id'].' ORDER BY posted ASC LIMIT 1') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
$cur_post = $db->fetch_assoc($result2);
?>
<div class="newsbox">
<h3><?php echo (pun_htmlspecialchars($cur_topic['subject']) ?></h3>
<div class="item">
<?php echo (parse_message($cur_post['message']) ?>
<p class="newsinfo">Posted by <?php echo (pun_htmlspecialchars($cur_post['poster'])) ?> on <?php echo date('Y-m-d H:i', $cur_post['posted']) ?> | <a href="<?php echo $pun_config['o_base_url']?>/viewtopic.php?id=<?php echo $cur_topic['id']?>">Comments</a></p>
</div>
</div>
<?php
}
require PUN_ROOT.'footer.php';