<?php
defined('DOIT') or die('Restricted access');
include_once(PATH."/core/file.class.php");
$modsettings = explode(",",$modsettings);
$id = $this->id;
$sql = "select * from mod_download where `modid`=$id order by `filename`";
$this->query($sql);
$files = $this->db->getdata_array();
//$files = $this->db->getdata_array("select * from mod_download where `modid`=$id order by `filename`");
echo "<table class='dl_downloadtable' cellspacing='0' border='1' rules='cols'>".
"<tr class='dl_tableheader'>".
"<th style='text-align:left;'>$mod_dl[lbl_fname]</th>";
if ($modsettings[0]=="on") { echo "<th>$mod_dl[lbl_ftype]</th>"; }
if ($modsettings[1]=="on") { echo "<th style='text-align:right;'>$mod_dl[lbl_fsize]</th>"; }
echo "<th>$mod_dl[lbl_downloads]</th>".
"<th>$l_gen[lbl_download]</th>".
"</tr>";
$style="dl_odd";
if (!empty($files)) {
foreach ($files as $f) {
$filefull=PATH."/".$f["location"]."/".$f["filename"];
$file=new File($filefull);
echo "<tr class='$style'>".
"<td style='padding:0 0 0 10px;'>$file->name</td>";
//filetype
if ($modsettings[0]=="on") {
echo "<td style='text-align:center;'>".strtolower($file->ext)."</td>";
}
//filesize
if ($modsettings[1]=="on") {
echo "<td class='dl_filesize'>".filesize_text($file->size)."</td>";
}
echo "<td style='text-align:center;'>$f[downloads]</td>".
"<td style='text-align:center;'>".
//download link
"<form method='post' action=''>".
"<input type='image' class='dl_downloadimage' value='' title='Download $f[filename]' />".
"<input type='hidden' name='downloadid' value='$f[id]'>".
"</form></td></tr>";
if ($style=="dl_odd") { $style="dl_even"; } else { $style="dl_odd"; }
}
}
echo "</table>";
?>