YesYo.com MintState Forums
뒤로    YesYo.com MintState BBS > Miscellaneous > Q&A
검색
멤버이름    오토
비밀번호 
 

토렌토 소스중 질문이요 ㅠ

페이지 정보

작성자 no_profile 푸푸 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 댓글 1건 조회 12,402회 작성일 11-11-01 11:32

본문

<?
require_once ("torrent.php");
for ($i=0; $i<=count($view[file]); $i++) {
if (torrent_getExt($view[file][$i][source]) == "torrent") {
$file_full_path = $view[file][$i][path]."/".$view[file][$i][file];
if (file_exists($file_full_path)) {
$torrent_file = file_get_contents($file_full_path);
$torrent_array = BDecode($torrent_file);
$torrent_hash=sha1(BEncode($torrent_array['info']));

echo "<table width=".(int)$board[bo_image_width]." border=0 cellpadding=5 cellspacing=1 bgcolor='#DDDDDD' style='margin-bottom:10px'>";
echo "<tr><td colspan=2 align=center bgcolor='#FFD48E'><strong>".iconv("UTF-8","EUC-KR",$torrent_array['info']['name'])."</strong></td></tr>";
echo "<tr><td width=100 bgcolor='#D7D3CF'>마그넷</td><td bgcolor='#FFFFFF'>magnet:?xt=urn:btih:".$torrent_hash."</td></tr>";
echo "<tr><td bgcolor='#D7D3CF'>트래커</td><td bgcolor='#FFFFFF'>";
$announce_list_cnt = count($torrent_array['announce-list']);
for ($al=0;$al < $announce_list_cnt;$al++) {
echo $torrent_array['announce-list'][$al][0]."<br />";
}
echo "</td></tr>";
if ($torrent_array['comment']) {
echo "<tr><td bgcolor='#D7D3CF'>코멘트</td><td bgcolor='#FFFFFF'>".iconv("UTF-8","EUC-KR",$torrent_array['comment'])."</td></tr>";
}
echo "<tr><td bgcolor='#D7D3CF'>생성일</td><td bgcolor='#FFFFFF'>".date("Y-m-d",$torrent_array['creation date'])."</td></tr>";
echo "<tr><td bgcolor='#D7D3CF'>파일</td><td bgcolor='#FFFFFF'>";

if ($torrent_array['info']['length']) {
echo iconv("UTF-8","EUC-KR",$torrent_array['info']['name']);
echo " (".get_filesize($torrent_array['info']['length']).")";
} else {
$torrent_total_size = 0;
for ($tf=0;$tf <  count($torrent_array['info']['files']);$tf++) {
$info_file_path_cnt = count($torrent_array['info']['files'][$tf]['path']);
echo ($tf+1).": ";
for ($j=0;$j < $info_file_path_cnt;$j++) {
echo iconv("UTF-8","EUC-KR",$torrent_array['info']['files'][$tf]['path'][$j]);
if ($j < $info_file_path_cnt-1) echo "/";
}
echo " (".get_filesize($torrent_array['info']['files'][$tf]['length']).")";
echo "<br />";
$torrent_total_size = $torrent_total_size + $torrent_array['info']['files'][$tf]['length'];
}
echo "총 파일 사이즈 : ".get_filesize($torrent_total_size);
}
echo "</td></tr>";
echo "</table>";
}
}
}

// 확장자 알아오기
function torrent_getExt($str) {
$f = explode(".", $str);
$l=sizeof($f);
if($l>1) {
return strtolower($f[$l-1]);
} else {
return '';
}
}
?>

게시판 리스트에 파일 용량을 표시하려고 합니다

어떤 부분을 빼내야 될지 궁금하네요~

도움좀 주세요~

감사합니다.

댓글목록

MintState님의 댓글

no_profile MintState 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 작성일

보기 페이지가 아닌 리스트 페이지 말씀 하시는 건가요???
음...
그렇다면 리스트 루프 돌때 토런트 파일 가져와서 분석 하시면 됩니다.

활용만 하시면 쉽게 만드실수 있을건데요...

Total 49건 3 페이지
Q&A 목록
번호 제목 글쓴이 조회 날짜
9 no_profile 명예 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13894 04-27
8 no_profile orange 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 13182 01-31
7 no_profile MintState 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 14409 02-01
6 no_profile 수리매니아 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 15245 02-06
5 no_profile 신재영 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 13703 04-25
4 no_profile 밤일기 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13658 08-30
열람중 no_profile 푸푸 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 12403 11-01
2 no_profile 라아 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13009 11-13
1 no_profile nick1224 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13355 05-25
게시물 검색
모바일 버전으로 보기
CopyRight ©2004 - 2024, YesYo.com MintState. ™