<?php
if (basename($GLOBALS['PHP_SELF']) == "dlformat.php") {
	exit();
}
echo "<tr>";
if ( $mydownloads_useshots ) {
	$tablewidth = $mydownloads_shotwidth+10;
	echo "<td width='".$tablewidth."' align='center'";
	if ( $logourl ) {
		echo "><a href='".XOOPS_URL."/modules/mydownloads/visit.php?lid=".$lid."' target='_blank'><img src='".XOOPS_URL."/modules/mydownloads/images/shots/".$logourl."' width='".$mydownloads_shotwidth."' border='0'></a></td><td>";
        } else {
        	echo " style='display: none'></td><td colspan='2'>";
        }
//	echo "</td>";
} else {
	echo "<td>";
}
$path = $mytree->getPathFromId($cid, "title");
$path = substr($path, 1);
$path = str_replace("/"," <img src='".XOOPS_URL."/modules/mydownloads/images/arrow.gif' board='0' alt=''> ",$path);
echo "<table width='100%' border='0' cellspacing='1' cellpadding='0' class='bg2'><tr><td>";
echo "<table width='100%' border='0' cellspacing='1' cellpadding='4' class='bg1'><tr><td colspan='2'>";

echo "<b>"._MD_CATEGORYC."</b>".$path."";
echo "</td></tr>";

echo "<tr><td class='bg1' width='200'><b><a href='".XOOPS_URL."/modules/mydownloads/visit.php?lid=$lid' target='_blank'><img src='images/download.gif' border='0' alt='"._MD_DLNOW."'></a>&nbsp;<a href='".XOOPS_URL."/modules/mydownloads/visit.php?lid=$lid' target='_blank'>".$dtitle."</a></b>";

newdownloadgraphic($time, $status);
popgraphic($hits);
echo"</td><td class='bg1' align='right'><b>"._MD_VERSION.":</b>&nbsp;$version&nbsp;&nbsp;<b>"._MD_SUBMITDATE.":</b>&nbsp;".$datetime."&nbsp;</td></tr>";
echo "<tr><td colspan='2' class='bg4'>";
echo "<img src='".XOOPS_URL."/modules/mydownloads/images/decs.gif' board='0' width='14' height='14' align='buttom' alt='"._MD_DESCRIPTION."' />&nbsp;:&nbsp; $description<br>";
echo "</td></tr>";
echo "<tr><td colspan='2' class='bg3' align='right'>";
echo "<img src='".XOOPS_URL."/modules/mydownloads/images/counter.gif' width='14' height='14' border='0' align='absmiddle' alt='".sprintf(_MD_DLTIMES,$hits)."' />&nbsp;".$hits."&nbsp;&nbsp;<img src='".XOOPS_URL."/modules/mydownloads/images/size.gif' width='14' height='14' border='0' align='absmiddle' alt='"._MD_FILESIZE."' />&nbsp;".PrettySize($size)."&nbsp;&nbsp;<img src='".XOOPS_URL."/modules/mydownloads/images/platform.gif' width='14' height='14' border='0' align='absmiddle' alt='"._MD_SUPPORTEDPLAT."' />&nbsp;&nbsp;".$platform."&nbsp;&nbsp;<img src='".XOOPS_URL."/modules/mydownloads/images/home.gif' width='14' height='14' border='0' align='absmiddle' alt='"._MD_HOMEPAGE."' />&nbsp;<a href='".$homepage."' target='_blank'>".$homepage."</a>";


echo" </td></tr>";
echo "<tr><td colspan='2' class='bg2' align='center'>";
//voting & comments stats
        
if ( $rating!="0" || $rating!="0.0" ) {
	if ($votes == 1) {
		$votestring = _MD_ONEVOTE;
	} else {
		$votestring = sprintf(_MD_NUMVOTES,$votes);
	}
	echo "<b>"._MD_RATINGC."</b>$rating ($votestring)";
}
if ($comments != 0) {
	if ($comments == 1) {
		$poststring = _MD_ONEPOST;
	} else {
		$poststring = sprintf(_MD_NUMPOSTS,$comments);
	}
	echo "<b>"._MD_COMMENTSC."</b>$poststring";
}
echo "<br><a href='".XOOPS_URL."/modules/mydownloads/ratefile.php?lid=".$lid."'>"._MD_RATETHISFILE."</a>";
echo " | <a href='".XOOPS_URL."/modules/mydownloads/modfile.php?lid=".$lid."'>"._MD_MODIFY."</a>";
echo " | <a href='".XOOPS_URL."/modules/mydownloads/brokenfile.php?lid=".$lid."'>"._MD_REPORTBROKEN."</a>";
echo " | <a target='_top' href='mailto:?subject=".rawurlencode(sprintf(_MD_INTFILEAT,$xoopsConfig['sitename']))."&body=".rawurlencode(sprintf(_MD_INTFILEFOUND,$xoopsConfig['sitename']).":  ".XOOPS_URL."/modules/mydownloads/singlefile.php?lid=".$lid)."'>"._MD_TELLAFRIEND."</a>";
//echo " | <a href>"._MD_VSCOMMENTS."</a>";
global $xoopsUser;
if ( $xoopsUser ) {
	if ( $xoopsUser->isAdmin($xoopsModule->mid()) ) {
		echo " | <a href='".XOOPS_URL."/modules/mydownloads/admin/index.php?lid=".$lid."&fct=mydownloads&op=modDownload'>"._MD_EDIT."</a>";
	}
}

echo "</td></tr></table>";
echo "</td></tr></table>";
echo "</td></tr>";
?>