토렌트 게시판에서

토렌트 게시판에서

QA

토렌트 게시판에서

본문

목록에서 마그넷 링크를 눌를 수 있게끔 만들고 싶습니다.

 

<?

$sql = " select * from $g5[board_file_table] where bo_table = '". $bo_table. "' and wr_id = '". $list[$i][wr_id] ."' order by bf_no ";

$result = sql_query($sql);

while ($row = sql_fetch_array($result))

{

$down_link = "download.php?bo_table={$bo_table}&wr_id={$list[$i][wr_id]}&no={$row[bf_no]}";

$file_source = addslashes($row[bf_source]);

$file_type = preg_replace('/^.*\.([^.]+)$/D', '$1', $file_source);

$file_size = get_filesize($row[bf_filesize]);

 

if(!in_array($file_type, array('jpg', 'jpeg', 'gif', 'bmp', 'png'))){ //이미지는 제외

echo "<a href=\"".$down_link."\" title=\"".$file_source."\">";

echo "<img src='https://www.simsimhalddae.com/fun/skin/board/basic_torrent/img/download_1.png' border=0 align='absmiddle' alt=\"".$file_source."\">({$file_size})";

echo "</a> ";

}

}

?>




























<?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'><font color='red' size='3'><b>마그넷  </b></font><img src='https://www.simsimhalddae.com/fun/skin/board/basic_torrent/img/magnet_1.png'></td><td bgcolor='#FFFFFF'><a href='".$magnet."'><font color='red' size='4'><b><u>".$magnet."</u></b></font></a></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>";
}
}


?>

위 두 소스를 합쳐야 될걸로 알고 있는데 어떻게 합쳐야 하나요? 초보라 자세한 설명 부탁드릴께요. 감사합니다. _ _

이 질문에 댓글 쓰기 :

답변을 작성하시기 전에 로그인 해주세요.
전체 9
QA 내용 검색
  • 개별 목록 구성 제목 답변작성자조회작성일
  • 질문이 없습니다.

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT