<?php
// $Id: singlefile.php,v 1.1 2004/07/11 10:28:18 Farsus Exp $
// -------------------------------------------------------------------------//
//			                 RUNCMS                                         //
//                                                                          //
//	 reliable - Unique - Nocost &  Simplicity & ease off use                //
//                       < http://www.runcms.org >                          //
// -------------------------------------------------------------------------//
// Original Author: James Knickelbein
// Author Website : http://www.journeymilwaukee.com
// License Type   : GPL: See /manual/LICENSES/GPL.txt
// ------------------------------------------------------------------------- //

include_once("header.php");

$mytree = new XoopsTree($db->prefix("mydownloads_cat"), "cid", "pid");
$lid    = intval($HTTP_GET_VARS['lid']);
$sql    = "
		SELECT
		lid,
		cid,
		title,
		url,
		homepage,
		version,
		size,
		platform,
		logourl,
		status,
		date,
		hits,
		rating,
		votes,
		comments,
		description
		FROM
		".$db->prefix("mydownloads_downloads")."
		WHERE
		lid=$lid
		AND
		status>0";

$result = $db->query($sql);

if ($db->num_rows($result) != 1) {
	redirect_header('index.php');
	exit();
}

include_once(XOOPS_ROOT_PATH."/header.php");
OpenTable();
mainheader();

list($lid, $cid, $title, $url, $homepage, $version, $size, $platform, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description) = $db->fetch_row($result);
echo "<table width='100%' cellspacing='0' cellpadding='3' border='0'><tr><td>";

$pathstring  = "<a href=index.php>"._MD_MAIN."</a> : ";
$nicepath    = $mytree->getNicePathFromId($cid, "title", "viewcat.php?");
$pathstring .= $nicepath;

echo "<b>".$pathstring."</b></td></tr></table><br />";

$rating      = number_format($rating, 2);
$dtitle      = $myts->makeTboxData4Show($title);
$url         = $myts->makeTboxData4Show($url);
$homepage    = $myts->makeTboxData4Show($homepage);
$version     = $myts->makeTboxData4Show($version);
$size        = $myts->makeTboxData4Show($size);
$platform    = $myts->makeTboxData4Show($platform);
$logourl     = $myts->makeTboxData4Show($logourl);
$datetime    = formatTimestamp($time, "s");
$description = $myts->makeTareaData4Show($description, 1, 1, 1);
include("include/dlformat.php");

CloseTable();
include_once("footer.php");
?>
