목록에서 마그넷 링크를 눌를 수 있게끔 만들고 싶습니다.
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
//ver1.0 150504 @_untitle_d
//토렌트 정보
for ($i=0; $i<=count($view['file']); $i++) {
$dest_file = G5_DATA_PATH.'/file/'.$bo_table.'/'.$view['file'][$i]['file'];
if (file_exists($dest_file) && get_extension($dest_file) == 'torrent')
{
$torrent_array = get_torrent_info($dest_file);
$magnet = "magnet:?xt=urn:btih:".$torrent_array['hash'];
echo "<div style='margin-top:10px;padding:6px;text-align:center;color:#fff;font-weight:bold;background-color:#cc0000'>".$torrent_array['name']."</div>";
echo "<table width='100%' border='0' cellpadding='5' cellspacing='1' bgcolor='#e9e9e9'>";
echo "<tr><td width='100' bgcolor='#f7f7f7'>파일</td><td bgcolor='#FFFFFF'>";
$torrent_total_size = 0;
$torrent_total_size_omitted = 0;
$torrent_file_cnt = count($torrent_array['file']);
for ($tf=0; $tf < $torrent_file_cnt; $tf++){
$torrent_total_size = $torrent_total_size + $torrent_array['file'][$tf]['length'];
if ($torrent_file_cnt == 1){
echo $torrent_array['name']." (<strong>".get_filesize1($torrent_total_size)."</strong>)";
}else{
if ($tf < $file_list_limit_count){
echo ($tf+1).". ".$torrent_array['file'][$tf]['name']." (".get_filesize1($torrent_array['file'][$tf]['length']).")<br>";
$torrent_total_size_omitted = $torrent_total_size_omitted + $torrent_array['file'][$tf]['length'];
}
}
}
if ($torrent_file_cnt != 1){
if ($tf > $file_list_limit_count)
echo "위의 목록에서 생략된 ".number_format(count($torrent_array['file'])-$file_list_limit_count)."개 파일 (".get_filesize1($torrent_total_size-$torrent_total_size_omitted).")<br>";
echo "총 파일 사이즈 : <strong>".get_filesize1($torrent_total_size)."</strong>";
}
echo "</td></tr>";
echo "<tr><td bgcolor='#f7f7f7'>트래커</td><td bgcolor='#FFFFFF'><textarea style='width:99%;height:55px;border:1px solid;border-color:#f5f5f5;'>".substr(str_replace("|", "\n", $torrent_array['trackers']), 0, -1)."</textarea></td></tr>";
echo "<tr><td bgcolor='#f7f7f7'>코멘트</td><td bgcolor='#FFFFFF'>★ 심심할때닷컴 - SimSimHalDddae.com ★</td></tr>";
echo "<tr><td bgcolor='#f7f7f7'>생성일</td><td bgcolor='#FFFFFF'>Created By 째이 The Webmaster.</td></tr>";
echo "</table>";
}
}
?>