@@ act=idx source/idx.php .torrent uploader FieldsRequest(array('id','name','md5')); $mysql->QueryRequest("SELECT * FROM torrents WHERE md5='{$torrent['md5']}' LIMIT 1"); if($mysql->outputfields['md5'][0] == $torrent['md5']){ $template['error'] = "Oops!, the file that you are trying to upload already exist in out database under the name outputfields['md5'][0]}\">{$mysql->outputfields['name'][0]}.torrent"; }else{ $mysql = new MySql; $mysql->QueryInsert("INSERT INTO torrents (name,hash,size,md5) VALUES ('{$torrent['name']}','{$torrent['hash']}','{$torrent['size']}','{$torrent['md5']}');"); $template['success'] = "{$torrent['name']}.torrent Succesfully uploaded!"; } }else{ $template['error'] = "Oops!, it seems that the file you are trying to upload is not a .torrent file. Please check the file and try again"; } } ?>
//////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ act=torrent source/torrent.php .torrent downloader FieldsRequest(array('id','name','md5','hash','size')); $mysql->QueryRequest("SELECT * FROM torrents WHERE md5='{$torrent['md5']}' LIMIT 1"); if(isset($mysql->outputfields['md5'][0])){ $torrent['name'] = "{$mysql->outputfields['name'][0]}.torrent"; $torrent['hash'] = $mysql->outputfields['hash'][0]; $torrent['hash'] = base64_decode($torrent['hash']); $torrent['size'] = $mysql->outputfields['size'][0]; if(strlen($torrent['hash']) == $torrent['size']){ header("Content-length: {$torrent['size']}"); header("Content-type: application/x-bittorrent"); header("Content-Disposition: attachment; filename=\"{$torrent['name']}\""); echo $torrent['hash']; }else{ $template['error'] = "There seems to be a problem with {$torrent['name']} it may be corrupted."; } }else{ $template['error'] = "Oops!, it seems that the torrent you requested does not exist in our database."; } }else{ header("Location: index.php?act=idx"); exit; } if(isset($template['error'])){ echo $template['error']; } ?>