Show user comments'; } else { $showhidecomments = 'Hide user comments'; } $query = "SELECT title, body, UNIX_TIMESTAMP(created) AS created, UNIX_TIMESTAMP(last_updated) AS last_updated FROM articles WHERE id=$id"; $result = mysql_query($query) or die('Error in MySQL query!
'.$query.'
Error #'.mysql_errno().': '.mysql_error()); if (mysql_num_rows($result) == 1) { if ($_GET['show_comments'] == '') { $subquery = "UPDATE articles SET print_count=print_count+1 WHERE id=$id"; $subresult = mysql_query($subquery) or die('Error in MySQL query!
'.$subquery.'
Error #'.mysql_errno().': '.mysql_error()); } echo ' Printer Friendly Version - Powered by KBase Express '; while ($row = mysql_fetch_object($result)) { echo '
Print options: Print this page | '.$showhidecomments.'
Published on: '.date($cfg['date_format'], $row->created).'
Last updated: '.date($cfg['date_format'], $row->last_updated).'
Document link: '.$cfg['script_url'].'/article.php?action=view&id='.$id.'

'; echo '

'.$row->title.'

'; echo nl2br($row->body); if ($show_comments == 1) { echo '
'; echo '

Comments

'; $comments = getComments($id); while ($comment = mysql_fetch_object($comments)) { echo '
'.$comment->name.' on '.date($cfg['date_format'], $comment->postdate).'
'.$comment->comment.'

'; } } echo '
'; echo 'Powered by Magneticka Ltd
Copyright © 2007 Magneticka Ltd. All rights reserved.
'; } echo ' '; } else { $errmsg = 'Invalid article Id specified!'; require($cfg['tpl_dir'].'/error.php'); die(); } ?>