<?php
// $Id: dlformat.php,v 1.1 2004/07/11 10:28:19 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
// ------------------------------------------------------------------------- //

global $HTTP_SERVER_VARS;
if ( preg_match("/dlformat\.php/i", $HTTP_SERVER_VARS['PHP_SELF']) ) {
	exit();
	}

echo "<table width='100%' cellspacing='0' cellpadding='5' border='0'><tr><td align='center' valign='top'>";

if ($mydownloadsConfig['useshots']) {
	if ($logourl) {
		$logourl = formatURL(XOOPS_URL.'/modules/mydownloads/cache/shots/', $logourl);
		echo "
		<a href='".XOOPS_URL."/modules/mydownloads/visit.php?lid=$lid' target='_blank'><img src='$logourl' border='0' alt='' width='".$mydownloadsConfig['shotwidth']."' /></a>
		</td><td align='center' valign='top' width='100%'>";
	}
}

$str_path = $mytree->getNicePathFromId($cid, "title", "viewcat.php?");
$str_path = substr($str_path, 0, -2);
$str_path = str_replace(":", "<img src='".XOOPS_URL."/modules/mydownloads/images/arrow.gif' border='0' alt=''>", $str_path);

echo "
<table width='100%' border='0' cellspacing='1' cellpadding='0' class='bg2'><tr>
<td>
<table width='100%' border='0' cellspacing='1' cellpadding='4' class='bg1'><tr>
<td colspan='2' class='bg2'>
<b>"._MD_CATEGORYC."</b>".$str_path."
</td>

</tr><tr>

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

newdownloadgraphic($time, $status);
popgraphic($hits);

echo "
</td><td class='bg3' align='right' valign='bottom'><b>"._MD_VERSION.":</b>
".$version."
<img src='".XOOPS_URL."/modules/mydownloads/images/time.gif' border='0' alt='"._MD_SUBMITDATE."'>
".$datetime."</td>
</tr><tr>
<td colspan='2' class='bg1' style='border-bottom:solid 1px;border-top:solid 1px;'>
<img src='".XOOPS_URL."/modules/mydownloads/images/decs.gif' border='0' width='14' height='14' align='buttom' alt='"._MD_DESCRIPTION."' />&nbsp;:&nbsp; $description
</td>
</tr><tr>
<td colspan='2' class='bg3' align='center'>
<img src='".XOOPS_URL."/modules/mydownloads/images/counter.gif' border='0' align='absmiddle' alt='".sprintf(_MD_DLTIMES,$hits)."' />
".$hits."

&nbsp;&nbsp;
<img src='".XOOPS_URL."/modules/mydownloads/images/size.gif' border='0' align='absmiddle' alt='"._MD_FILESIZE."' />
".PrettySize($size)."

&nbsp;&nbsp;
<img src='".XOOPS_URL."/modules/mydownloads/images/platform.gif' border='0' align='absmiddle' alt='"._MD_SUPPORTEDPLAT."' />
".$platform."

&nbsp;&nbsp;
<img src='".XOOPS_URL."/modules/mydownloads/images/home.gif' border='0' align='absmiddle' alt='"._MD_HOMEPAGE."' />
<a href='".$homepage."' title='".$homepage."' target='_blank'>"._MD_HOMEPAGE."</a>
</td></tr><tr><td colspan='2' class='bg2' align='center'>";

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)";
}

global $xoopsUser, $meta;
echo " <a href='".XOOPS_URL."/modules/mydownloads/ratefile.php?lid=$lid'>"._MD_RATETHISFILE."</a>";
if ($xoopsUser) {
	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, $meta['title']))."&body=".rawurlencode(sprintf(_MD_INTFILEFOUND, $meta['title']).":\r\n".XOOPS_URL."/modules/mydownloads/singlefile.php?lid=$lid")."'>"._MD_TELLAFRIEND."</a>";
if ($xoopsUser) {
	if ( $xoopsUser->isAdmin($xoopsModule->mid()) ) {
		echo "&nbsp; &nbsp; <a href='".XOOPS_URL."/modules/mydownloads/admin/index.php?lid=$lid&fct=mydownloads&op=modDownload'><img src='".XOOPS_URL."/modules/mydownloads/images/editicon.gif' border='0' alt='"._MD_EDITTHISDL."' /></a>";
	}
}

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