황

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

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

<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
수고 했습니다....^^
감사합니다!
감사합니다. 적용해 봐야 겠네요
댓글을 작성하시려면 로그인이 필요합니다.
+
제목 글쓴이 날짜 조회
mmando
04-10-09 조회 4,156
04-10-04 조회 3,428
04-10-02 조회 4,641
04-10-01 조회 4,044
04-10-01 조회 3,171
04-10-01 조회 3,804
04-09-30 조회 3,259
04-09-30 조회 3,399
04-09-29 조회 4,118
04-09-28 조회 2,998
04-09-27 조회 3,290
04-09-26 조회 4,970
04-09-24 조회 3,330
04-09-24 조회 9,280
04-09-23 조회 1.4만
04-09-23 조회 3,359
04-09-22 조회 3,972
04-09-21 조회 3,479
04-09-21 조회 3,524
04-09-21 조회 3,035