########################################################################
# KBase Express #
# http://www.sensationdesigns.com/products/scripts/kbase_express #
# #
# Website: http://www.sensationdesigns.com #
# Contact: sales@sensationdesigns.com #
# Support: support@sensationdesigns.com #
# #
# KBase Express is NOT free software. It may NOT be redistributed in #
# any way. Please see the license agreement for further information: #
# http://www.sensationdesigns.com/policies/license.php #
# #
# Copyright (c) 2005 Sensation Designs. All rights reserved. #
########################################################################
require('data/config.php');
require('includes/functions.php');
dbConnect($cfg['db_host'], $cfg['db_user'], $cfg['db_pass'], $cfg['db_name']);
$show_comments = ($_GET['show_comments'] != '') ? $_GET['show_comments'] : $cfg['show_comments'];
$id = $_GET['id'];
if ($id == '') {
$errmsg = 'Invalid action. No article Id specified.';
require($cfg['tpl_dir'].'/error.php');
die();
}
if ($show_comments == 0) { $showhidecomments = '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 '
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.' |