i'm noob and sorry if this is a noob question. i wanna recode this so they'll only result one link and the latest one.
can't any hero wanna help me bout this? i'll very appreciate and sorry for my english. this code from leechviet.
can't any hero wanna help me bout this? i'll very appreciate and sorry for my english. this code from leechviet.
PHP:
function datecmp($a, $b)
{
return ($a[1] < $b[1]) ? 1 : 0;
}
function list_files()
{
$files = array();
foreach ($this->jobs as $job)
{
if ($job['owner']!=$this->owner && !$this->bypass)
{
continue;
}
$files[] = array($job['hash'], $job['mtime'], $job['filename'], $job['msize'], $job['speed']/1024, empty($job['size']) ? 'N/A' : sprintf('%.1f%%', $job['msize']/$job['size']*100), $job['size'], $job['type']);
}
usort($files, array($this, 'datecmp')); //sorting the newest to oldest links
$scheme = "<center><b><a href='?d=%s'>%s</a></b></center>";
$this->CheckMBIP();
$data = "";
$data .= "<center><b>Your downloads: </b></center>";
foreach ($files as $file)
{
if ($file[7] == 'remote')
{
$data .= sprintf($scheme, $file[0], $file[2]);
}
}
$data .= "";
echo $data;
}