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

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

<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;
2004-10-03 (일) 11:47:07
수고 했습니다....^^
감사합니다.
2004-10-02 (토) 01:07:53
감사합니다!
감사합니다. 적용해 봐야 겠네요
댓글을 작성하시려면 로그인이 필요합니다.

그누3 팁자료실

1,026건
+
제목 글쓴이 날짜 조회
mmando
04-10-09 조회 4,121
04-10-04 조회 3,376
04-10-02 조회 4,604
04-10-01 조회 4,003
04-10-01 조회 3,121
04-10-01 조회 3,758
04-09-30 조회 3,218
04-09-30 조회 3,364
04-09-29 조회 4,063
04-09-28 조회 2,955
04-09-27 조회 3,237
04-09-26 조회 4,915
04-09-24 조회 3,290
04-09-24 조회 9,224
04-09-23 조회 1.4만
04-09-23 조회 3,320
04-09-22 조회 3,934
04-09-21 조회 3,431
04-09-21 조회 3,478
04-09-21 조회 2,985