You dont have the function mksize in your bittorrent.php
Code:
function mksize($size)
{
static $unit = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
$size/=1+(pow(1024,($idx=floor(log($size)/log(1024)))));
return number_format($size,2)." ".$unit[$idx];
}
Or change
$size = mksize($totallen); to
$size = prefixed($totallen);