이미지 클릭 시 링크걸어서 넘어가게 하는데요
본문
이미지 클릭 시 링크걸어서 넘어가게 하는데요
아래 코드는 lastest 코드 인데요.
어느 부분이 문제인지
링크가 걸려 있어도
링크가 없다고 나오더라구요...ㅡㅡ;
어느 부분을 수정해야 하는걸까요?>
<?
?>
<table width="200" cellpadding=0 cellspacing=0 border=0><tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<!-- <tr><td height=10></td></tr> -->
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td align="center">
<? // View
$table = "banner";
$wr_id = $list[$i]['wr_id'];
$href = "$g4[bbs_path]/link.php?bo_table={$table}&wr_id=$wr_id&no=1";
sql_query(" update {$g4[write_prefix]}{$table} set wr_3 = wr_3 + 1 where wr_id = '$wr_id' ");
echo "<a href='$href' target='_blank'>";
$image = urlencode($list[$i][file][0][file]); // 첫번째 파일이 이미지라면
if (preg_match("/\.(gif|jpg|png)$/i", $image)) { ?>
<img src='<?=$g4[path]?>/data/file/<?=$bo_table?>/<?=$image?>' width='195' height="90" border='0'></a><br>
<? } else { ?>
<img src='<?=$latest_skin_path?>/img/noimage.gif' width='195' height="90" border='0'></a><br>
<? } ?>
</td>
</tr>
<tr><td height=7></td></tr>
<? } ?>
</table>
</td></tr></table>
!-->
답변 1
12번째줄
$href = "$g4[bbs_path]/link.php?bo_table={$table}&wr_id=$wr_id&no=1";
을 아래처럼 바꿔보세요
$href = "$list[$i][wr_link1]";
첫번째 입력된 링크값으로 이동될겁니다^^
!-->!-->
답변을 작성하시기 전에 로그인 해주세요.