로그인 했을 때만 원본그림보기 > 그누3 팁자료실

그누3 팁자료실

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

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

본문

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

<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
추천
0
  • 복사

댓글 전체

© SIRSOFT
현재 페이지 제일 처음으로