채택완료

최근게시물 클릭시 링크1로 보내기

2020-12-02 (수) 18:28:41 2,118

수고하십니다.

최신게시물에서 클릭시 링크1로 보내는데 새창으로 띄우는 방법을 모르겠습니다.

조언 좀 부탁드려도 될까요. 

echo "<a href='{$list[$i]['href']}' {$notice_class}>"; 부분을 

echo "<a href="<?php if($list[$i]['wr_link1'])' {$notice_class}>"; 수정해봤는데

안되더라구요.

<code>

        <li class="l_sub">
            <?php
            if ($list[$i]['is_notice']) {
                $notice_class = "class='notice_class' ";
                $txt = "<i class='fa fa-volume-up' aria-hidden='true'></i> ";
            } else {
                $notice_class = "";
                $txt = "";
            }

            echo "<a href='{$list[$i]['href']}' {$notice_class}>";
            echo $txt;
            echo $list[$i]['subject'];
            echo "</a>";

            if ($list[$i]['comment_cnt'])
                echo "<span style='font-size:10px;color:red;'>(".$list[$i]['comment_cnt']." )</span>";

            if (isset($list[$i]['icon_new'])) echo " " . $list[$i]['icon_new'];
            if (isset($list[$i]['icon_hot'])) echo " " . $list[$i]['icon_hot'];
            if (isset($list[$i]['icon_file'])) echo " " . $list[$i]['icon_file'];
            if (isset($list[$i]['icon_link'])) echo " " . $list[$i]['icon_link'];
            if (isset($list[$i]['icon_secret'])) echo " " . $list[$i]['icon_secret'];
             ?>
        </li>

</code>

|

답변 1개 / 댓글 1개

채택된 답변
+20 포인트
2020-12-02 (수) 18:34:07

echo "<a href='{$list[$i]['href']}' {$notice_class}>";

->

echo "<a href='{$list[$i]['wr_link1']}' target='_blank' {$notice_class}>";

답변에 대한 댓글 1개

2020-12-03 (목) 10:09:26
마르스컴퍼니 님 잘됩니다. 감사합니다. (__)

답변을 작성하려면 로그인이 필요합니다.