로그인 했을 때만 원본그림보기

고수님들이야 금방 쉽게 해결할 수 있는 문제들이겠지만
저같은 초짜야 어렵게 알아낸 힌트입니다.
보통 사용하는 갤러리 게시판에서 섬네일 그림에서 로그인을 안한 상태에서는
원본보기 링크가 걸리지 않도록 처리를 하는 소스입니다.
소스랄 것도 없고 팁앤텍도 아니지만 또는 중복 게시물일 수도 있겠지만
혹 필요로 하는 분이 계실지도 몰라서 올려 봅니다.

<table bgcolor=#ffffff cellpadding=3 cellspacing=12 width="100" height="80" align=center style="border-top-width:1; border-right-width:1; border-bottom-width:1; border-left-width:1; border-color:#cccccc; border-top-style:groove; border-left-style:groove; border-bottom-style:solid; border-right-style:solid;">
<tr><td align=center valign=middle>
<?
// 큰 이미지 사이즈 얻기
$limg = $list[$i][file_image1];
if (file_exists($limg)) {
$size = getimagesize($limg);
echo "<a href=\"javascript:showImgWin('$limg', $size[0], $size[1]);\">";
}
?>
<img src='<?=$list[$i][file_image1]?>' width='<?=$image_width?>' height='<?=$image_height?>' alt='<?=$list[$i][wr_subject]?>' style='border: 2px solid #f5f3ee;' onMouseOver=this.style.borderColor='#ffc0c0'; onMouseOut=this.style.borderColor='#f5f3ee';></a>
</td></tr>
</table>
요기 까지를

이렇게 처리를 하면 간단하네요.

<table bgcolor=#ffffff cellpadding=3 cellspacing=12 width="100" height="80" align=center style="border-top-width:1; border-right-width:1; border-bottom-width:1; border-left-width:1; border-color:#cccccc; border-top-style:groove; border-left-style:groove; border-bottom-style:solid; border-right-style:solid;">
<tr><td align=center valign=middle>
<?
if ($member[mb_id]){?>
<?
// 큰 이미지 사이즈 얻기
$limg = $list[$i][file_image1];
if (file_exists($limg)) {
$size = getimagesize($limg);
echo "<a href=\"javascript:showImgWin('$limg', $size[0], $size[1]);\">";
}
?>
<img src='<?=$list[$i][file_image1]?>' width='<?=$image_width?>' height='<?=$image_height?>' alt='<?=$list[$i][wr_subject]?>' style='border: 2px solid #f5f3ee;' onMouseOver=this.style.borderColor='#ffc0c0'; onMouseOut=this.style.borderColor='#f5f3ee';></a>
<?}else{?>
<img src='<?=$list[$i][file_image1]?>' width='<?=$image_width?>' height='<?=$image_height?>' alt='<?=$list[$i][wr_subject]?>' style='border: 2px solid #f5f3ee;' onMouseOver=this.style.borderColor='#ffc0c0'; onMouseOut=this.style.borderColor='#f5f3ee';>
<?}?>
</td></tr>
</table>


http://marxkim.made.com/main/?doc=bbs/gnuboard.php&bo_table=photo
테스트아이디 : test
비번 : test
|

댓글 4개

&&nbsp;&nbsp;
21년 전
수고 했습니다....^^
감사합니다.
감사합니다!
감사합니다. 적용해 봐야 겠네요
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누3 팁자료실

+
제목 글쓴이 날짜 조회
21년 전 조회 2,534
21년 전 조회 2,249
21년 전 조회 2,653
21년 전 조회 3,359
mmando
21년 전 조회 2,377
21년 전 조회 2,596
21년 전 조회 3,829
21년 전 조회 3,158
21년 전 조회 2,294
21년 전 조회 2,966
21년 전 조회 2,444
21년 전 조회 2,595
21년 전 조회 3,269
21년 전 조회 2,188
21년 전 조회 2,474
21년 전 조회 4,127
21년 전 조회 2,536
21년 전 조회 8,439
21년 전 조회 1.3만
21년 전 조회 2,546
🐛 버그신고