갤러리 view.php파일에서 정보
갤러리 view.php파일에서본문
view파일에서 작은 이미지를 클릭하면 큰 이미지가 위에 나오는데요....
그 큰 이미지를 클릭하면 원본 사진이 또 뜨게끔 하려고 합니다.
<?
// 파일 출력
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view])
echo $view[file][$i][view] . "<p>";
}
?> 이걸 넣어봤는데 안돼네요. 제가 프로그램은 잘 몰라서.....; 계속 이 스킨파일 저 스킨 파일 뒤져보고, 삽입해 보다가 안돼서 글 올립니다.
아시는 분, 답 좀 구할수 있을까요; 각 큰 이미지가 다시 클릭하면 원본파일이 뜨게 하려면...
<!-- 갤러리 시작 -->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" valign="top">
<table border="0" cellspacing="1" cellpadding="5" bgcolor="#AAAAAA">
<tr>
<td valign="top" bgcolor="#FFFFFF">
<script>
function chgImg( imgname, dnimgname, imgdesc ) {
var LureExp = /<br>/gi;
document.gallery_img.src=imgname;
//document.f.dnimg.value=dnimgname;
document.descForm.desc.value=imgdesc.replace( LureExp, "\n" );
}
</script>
<? if ($view[file][0][view]) {
for ($i=0; $i<=10; $i++) {
$image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];
}
if ($view[file][0][view]) {
?>
<img src="<?=$image[0]?>" name=gallery_img width="500" border=0 value=0>
<? } else {?>
<img src="<?=$board_skin_path?>/img/noimg.gif" border=0 value=0>
<? } ?>
</td>
</tr>
</table>
</td>
<tr>
<td valign="top">
<form NAME="descForm">
<br>사진설명 :<input name="desc" style="BORDER:0px solid; width:455px; HEIGHT:17px; BACKGROUND-COLOR:#F8F8F9" readonly value="<?=$view[file][0][content]?>"><br><br>
</td>
</form>
</tr>
<tr>
<td>
<?//=$view[file][0][content]?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[0]."','".$image[0]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][0][content]) )."' );\"" ?>> <img src="<?=$image[0]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][1][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[1]."','".$image[1]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][1][content]) )."' );\"" ?>> <img src="<?=$image[1]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][2][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[2]."','".$image[2]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][2][content]) )."' );\"" ?>> <img src="<?=$image[2]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][3][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[3]."','".$image[3]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][3][content]) )."' );\"" ?>> <img src="<?=$image[3]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][4][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[4]."','".$image[4]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][4][content]) )."' );\"" ?>> <img src="<?=$image[4]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][5][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[5]."','".$image[5]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][5][content]) )."' );\"" ?>> <img src="<?=$image[5]?>" width="80" height="60" align="absmiddle" border="0"></a>
<div style="line-height:30%;"><br><? }?>
<? if ($view[file][6][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[6]."','".$image[6]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][6][content]) )."' );\"" ?>> <img src="<?=$image[6]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][7][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[7]."','".$image[7]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][7][content]) )."' );\"" ?>> <img src="<?=$image[7]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][8][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[8]."','".$image[8]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][8][content]) )."' );\"" ?>> <img src="<?=$image[8]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][9][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[9]."','".$image[9]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][9][content]) )."' );\"" ?>> <img src="<?=$image[9]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][10][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[10]."','".$image[10]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][10][content]) )."' );\"" ?>> <img src="<?=$image[10]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][11][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[11]."','".$image[11]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][11][content]) )."' );\"" ?>> <img src="<?=$image[11]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][12][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[12]."','".$image[12]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][12][content]) )."' );\"" ?>> <img src="<?=$image[12]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
</td>
</tr>
<tr>
<td valign="top">
<?if ($view[content]) {?>
<br><?=$view[content];?>
<?}else{?>
<br>
<?}?>
</td>
</tr>
</table>
<!-- 갤러리 끝 -->
그 큰 이미지를 클릭하면 원본 사진이 또 뜨게끔 하려고 합니다.
<?
// 파일 출력
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view])
echo $view[file][$i][view] . "<p>";
}
?> 이걸 넣어봤는데 안돼네요. 제가 프로그램은 잘 몰라서.....; 계속 이 스킨파일 저 스킨 파일 뒤져보고, 삽입해 보다가 안돼서 글 올립니다.
아시는 분, 답 좀 구할수 있을까요; 각 큰 이미지가 다시 클릭하면 원본파일이 뜨게 하려면...
<!-- 갤러리 시작 -->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" valign="top">
<table border="0" cellspacing="1" cellpadding="5" bgcolor="#AAAAAA">
<tr>
<td valign="top" bgcolor="#FFFFFF">
<script>
function chgImg( imgname, dnimgname, imgdesc ) {
var LureExp = /<br>/gi;
document.gallery_img.src=imgname;
//document.f.dnimg.value=dnimgname;
document.descForm.desc.value=imgdesc.replace( LureExp, "\n" );
}
</script>
<? if ($view[file][0][view]) {
for ($i=0; $i<=10; $i++) {
$image[$i] = "$g4[path]/data/file/$bo_table/".$view[file][$i][file];
}
if ($view[file][0][view]) {
?>
<img src="<?=$image[0]?>" name=gallery_img width="500" border=0 value=0>
<? } else {?>
<img src="<?=$board_skin_path?>/img/noimg.gif" border=0 value=0>
<? } ?>
</td>
</tr>
</table>
</td>
<tr>
<td valign="top">
<form NAME="descForm">
<br>사진설명 :<input name="desc" style="BORDER:0px solid; width:455px; HEIGHT:17px; BACKGROUND-COLOR:#F8F8F9" readonly value="<?=$view[file][0][content]?>"><br><br>
</td>
</form>
</tr>
<tr>
<td>
<?//=$view[file][0][content]?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[0]."','".$image[0]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][0][content]) )."' );\"" ?>> <img src="<?=$image[0]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][1][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[1]."','".$image[1]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][1][content]) )."' );\"" ?>> <img src="<?=$image[1]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][2][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[2]."','".$image[2]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][2][content]) )."' );\"" ?>> <img src="<?=$image[2]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][3][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[3]."','".$image[3]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][3][content]) )."' );\"" ?>> <img src="<?=$image[3]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][4][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[4]."','".$image[4]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][4][content]) )."' );\"" ?>> <img src="<?=$image[4]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][5][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[5]."','".$image[5]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][5][content]) )."' );\"" ?>> <img src="<?=$image[5]?>" width="80" height="60" align="absmiddle" border="0"></a>
<div style="line-height:30%;"><br><? }?>
<? if ($view[file][6][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[6]."','".$image[6]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][6][content]) )."' );\"" ?>> <img src="<?=$image[6]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][7][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[7]."','".$image[7]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][7][content]) )."' );\"" ?>> <img src="<?=$image[7]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][8][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[8]."','".$image[8]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][8][content]) )."' );\"" ?>> <img src="<?=$image[8]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][9][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[9]."','".$image[9]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][9][content]) )."' );\"" ?>> <img src="<?=$image[9]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][10][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[10]."','".$image[10]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][10][content]) )."' );\"" ?>> <img src="<?=$image[10]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][11][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[11]."','".$image[11]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][11][content]) )."' );\"" ?>> <img src="<?=$image[11]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][12][file]) {?>
<a href=#1 <? echo "onClick=\"chgImg( '".$image[12]."','".$image[12]."','".ereg_replace("(\r\n|\n|\r)", " ", strip_tags($view[file][12][content]) )."' );\"" ?>> <img src="<?=$image[12]?>" width="80" height="60" align="absmiddle" border="0"></a>
<? }?>
</td>
</tr>
<tr>
<td valign="top">
<?if ($view[content]) {?>
<br><?=$view[content];?>
<?}else{?>
<br>
<?}?>
</td>
</tr>
</table>
<!-- 갤러리 끝 -->
댓글 전체
![](http://sir.kr/data/member_image/yj/yjiandi.gif?1243992182)
<img src="<?=$image[0]?>" name=gallery_img width="500" border=0 value=0>
여기부분에 이미지 변하는건데
여기에 링크를 해주심이
<a href="javascript:document.gallery_img.src;"><img src="<?=$image[0]?>" name=gallery_img width="500" border=0 value=0> </a>
----------------------
이렇게 하면 될지?? 자바스크립트로 해서......... 죄송합니다.될지는 모르겟고 약간의 도움이 되셧으면...
여기부분에 이미지 변하는건데
여기에 링크를 해주심이
<a href="javascript:document.gallery_img.src;"><img src="<?=$image[0]?>" name=gallery_img width="500" border=0 value=0> </a>
----------------------
이렇게 하면 될지?? 자바스크립트로 해서......... 죄송합니다.될지는 모르겟고 약간의 도움이 되셧으면...
정말 감사합니다. 알려주신대로 넣었는데 그 사진의 주소가 그냥 텍스트로 쓰여서 나오네요...이거 이미지로 뜨게 하는 방법이 없을까요?
![](http://sir.kr/data/member_image/yj/yjiandi.gif?1243992182)
텍스트로 나오면 되는거졍 그것을 절대경로를 주시면 될뜻...앞에 http붙여서요