이 코드를 검색에서도 쓸려면 어딜 수정해야 하죠?

이 코드를 검색에서도 쓸려면 어딜 수정해야 하죠?

QA

이 코드를 검색에서도 쓸려면 어딜 수정해야 하죠?

본문

                <!-- 마그넷링크 시작-->
                <?php if($list[$i][file][0]){?>
<?php
    $dest_file = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][0][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 "<a href='".$magnet."'>";
        echo sprintf('<i class="fa fa-magnet"></i>');
        echo "</a> ";

    }
?>
                <?php } ?>
                <!-- 마그넷링크 끝-->
                <!-- 마그넷링크 시작-->
                <?php if($list[$i][file][1]){?>
<?php
    $dest_file = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][1][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 "<a href='".$magnet."'>";
        echo sprintf('<i class="fa fa-magnet"></i>');
        echo "</a> ";

    }
?>
                <?php } ?>
                <!-- 마그넷링크 끝-->
                <!-- 마그넷링크 시작-->
                <?php if($list[$i][file][2]){?>
<?php
    $dest_file = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][2][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 "<a href='".$magnet."'>";
        echo sprintf('<i class="fa fa-magnet"></i>');
        echo "</a> ";

    }
?>
                <?php } ?>
                <!-- 마그넷링크 끝-->
                <!-- 마그넷링크 시작-->
                <?php if($list[$i][file][3]){?>
<?php
    $dest_file = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][3][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 "<a href='".$magnet."'>";
        echo sprintf('<i class="fa fa-magnet"></i>');
        echo "</a> ";

    }
?>
                <?php } ?>
                <!-- 마그넷링크 끝-->
                <!-- 마그넷링크 시작-->
                <?php if($list[$i][file][4]){?>
<?php
    $dest_file = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][4][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 "<a href='".$magnet."'>";
        echo sprintf('<i class="fa fa-magnet"></i>');
        echo "</a> ";

    }
?>
                <?php } ?>
                <!-- 마그넷링크 끝-->
                <!-- 마그넷링크 시작-->
                <?php if($list[$i][file][5]){?>
<?php
    $dest_file = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][5][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 "<a href='".$magnet."'>";
        echo sprintf('<i class="fa fa-magnet"></i>');
        echo "</a> ";

    }
?>
                <?php } ?>
                <!-- 마그넷링크 끝-->
                <!-- 마그넷링크 시작-->
                <?php if($list[$i][file][6]){?>
<?php
    $dest_file = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][6][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 "<a href='".$magnet."'>";
        echo sprintf('<i class="fa fa-magnet"></i>');
        echo "</a> ";

    }
?>
                <?php } ?>
                <!-- 마그넷링크 끝-->
                <!-- 마그넷링크 시작-->
                <?php if($list[$i][file][7]){?>
<?php
    $dest_file = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][7][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 "<a href='".$magnet."'>";
        echo sprintf('<i class="fa fa-magnet"></i>');
        echo "</a> ";

    }
?>
                <?php } ?>
                <!-- 마그넷링크 끝-->
                <!-- 마그넷링크 시작-->
                <?php if($list[$i][file][8]){?>
<?php
    $dest_file = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][8][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 "<a href='".$magnet."'>";
        echo sprintf('<i class="fa fa-magnet"></i>');
        echo "</a> ";

    }
?>
                <?php } ?>
                <!-- 마그넷링크 끝-->
                <!-- 마그넷링크 시작-->
                <?php if($list[$i][file][9]){?>
<?php
    $dest_file = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][9][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 "<a href='".$magnet."'>";
        echo sprintf('<i class="fa fa-magnet"></i>');
        echo "</a> ";

    }
?>
                <?php } ?>
                <!-- 마그넷링크 끝-->
                <!-- 마그넷 시작-->
<?php
    $dest_file = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][0][file];
    $dest_file1 = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][1][file];
    $dest_file2 = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][2][file];
    $dest_file3 = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][3][file];
    $dest_file4 = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][4][file];
    $dest_file5 = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][5][file];
    $dest_file6 = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][6][file];
    $dest_file7 = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][7][file];
    $dest_file8 = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][8][file];
    $dest_file9 = G5_DATA_PATH.'/file/'.$bo_table.'/'.$list[$i][file][9][file];
    if (file_exists($dest_file) && get_extension($dest_file) == 'torrent' || file_exists($dest_file1) && get_extension($dest_file1) == 'torrent' || file_exists($dest_file2) && get_extension($dest_file2) == 'torrent' || file_exists($dest_file3) && get_extension($dest_file3) == 'torrent' || file_exists($dest_file4) && get_extension($dest_file4) == 'torrent' || file_exists($dest_file5) && get_extension($dest_file5) == 'torrent' || file_exists($dest_file6) && get_extension($dest_file6) == 'torrent' || file_exists($dest_file7) && get_extension($dest_file7) == 'torrent' || file_exists($dest_file8) && get_extension($dest_file8) == 'torrent' || file_exists($dest_file9) && get_extension($dest_file9) == 'torrent')
    {
?>

 

위에 소스는 목록에서 마그넷 링크 불러오는 소스입니다.

이걸 마그넷 링크를 검색 결과에서 불러오려고 하는데요.

$list[$i] 를 $list[$idx][$i] 로 고쳐도 안되네요.

뭘 수정해야 할까요?

이 질문에 댓글 쓰기 :

답변 1

답변을 작성하시기 전에 로그인 해주세요.
전체 3

회원로그인

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