gbview.skin.php 수정 방법에 대해서 .... > 그누3질답

그누3질답

gbview.skin.php 수정 방법에 대해서 .... 정보

그누보드 gbview.skin.php 수정 방법에 대해서 ....

본문

꽃집남자님 께서 원하시는것 같아서 글 올립니다.
우선 루트님(root님)께 감사를 드립니다.

올릴까 말까하는 망설임은 완전한 완성작이 아니기
때문입니다. 잘 읽어 보시고 사용여부를 판단 하시기
바랍니다.

먼저 변경을 원하는 해당 스킨폴더의 gbview.skin.php 를
엽니다.

제일 상단부 1번 Line 에 아래 소스를 삽입 합니다.

<!------- 1. 아래의 스크립트를 HEAD 부분에 복사해 넣으세요 ----->


<SCRIPT LANGUAGE="JavaScript">
<!--
var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;
function hidelayer(lay) {
if (ie4) {document.all[lay].style.visibility = "hidden";}
if (ns4) {document.layers[lay].visibility = "hide";}
if (ns6) {document.getElementById([lay]).style.display = "none";}
}
function showlayer(lay) {
if (ie4) {document.all[lay].style.visibility = "visible";}
if (ns4) {document.layers[lay].visibility = "show";}
if (ns6) {document.getElementById([lay]).style.display = "block";}
}
function writetolayer(lay,txt) {
if (ie4) {
document.all[lay].innerHTML = txt;
}
if (ns4) {
document[lay].document.write(txt);
document[lay].document.close();
}
if (ns6) {
over = document.getElementById([lay]);
range = document.createRange();
range.setStartBefore(over);
domfrag = range.createContextualFragment(txt);
while (over.hasChildNodes()) {
over.removeChild(over.lastChild);
}
over.appendChild(domfrag);
 &nbsp;}
}
// -->
</script>


<!------- 여기까지 ----->

삽입 후 ....

아래 소스가 있는곳으로 이동 하신 후 (Line 의 변형이
많았기 때문에 몇번 라인 이라고 설명을 드리기가 어렵네요)

여기서 부터

<td style='word-break:break-all;' class='lh' height=100>

 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<?
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for ($i=1; $i<=$cfg[file_count]; $i++) {
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ($file[$i][view]) { echo $file[$i][view]; }
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;?>

 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<!-- 내용 출력 -->
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=content><?=$content?></span>

 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<? if ($is_signature) { echo $signature; } // 서명 출력 ?>

여기까지

아래의 소스로 덮어 쒸우시면 됩니다.

<td style='word-break:break-all;' class='lh' height=100>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=content><?=$content?></span><br><p><p>


<table align="left" style="border-right-color:gray; border-bottom-color:gray; border-collapse:collapse;" cellspacing="0" width="500" bordercolordark="silver">
 &nbsp; &nbsp;<tr>
 &nbsp; &nbsp; &nbsp; &nbsp;<td width="500" style="border-top-width:0; border-bottom-width:1; border-left-width:0; border-top-color:black; border-bottom-color:gray; border-left-color:black; border-top-style:solid; border-bottom-style:solid; border-left-style:solid;">
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[ <a href="javascript:hidelayer('newlayer');">숨기기</a> |
<a href="javascript:showlayer('newlayer');">보이기</a> ]<?
for ($i=1; $i<=$cfg[file_count]; $i++)
{
 &nbsp; if ($file[$i][view])
 &nbsp; {
/*
 &nbsp; &nbsp;echo "<a href=\"javascript:writetolayer('newlayer','";
 &nbsp; &nbsp;echo $file[$i][view];
 &nbsp; &nbsp;echo "');\"> 이미지-$i </a>";
*/
 &nbsp; &nbsp; $file[$i][view] = preg_replace("(')","",$file[$i][view]); &nbsp;
 &nbsp; &nbsp; echo "<a href=\"javascript:writetolayer('newlayer','{$file[$i][view]}');\">&nbsp;<b>사진-$i ::</b>&nbsp;</a>";
 &nbsp; }
}
?>
 &nbsp; &nbsp; &nbsp; &nbsp;</td>
 &nbsp; &nbsp;</tr>
 &nbsp; &nbsp;<tr>
 &nbsp; &nbsp; &nbsp; &nbsp;<td width="500" height="" style="border-top-width:1; border-bottom-width:1; border-left-width:0; border-top-color:black; border-bottom-color:gray; border-left-color:black; border-top-style:solid; border-bottom-style:solid; border-left-style:solid;" background="http://www.slgi.co.kr/image/titlelogo4.jpg">

 &nbsp; &nbsp; &nbsp; &nbsp;<SPAN ID="newlayer" style="position:absolute;">&nbsp;&nbsp;</SPAN>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<br>
</p>
 &nbsp; &nbsp; &nbsp; &nbsp;</td>
 &nbsp; &nbsp;</tr>
</table>

 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <? if ($board[bo_use_signature]) { echo $signature; } // 서명 출력 ?>

-----------------------------------------------------------------------------

background="http://www.slgi.co.kr/image/titlelogo4.jpg 위 소스중 이미지는 적절히
교체해 주시면 되겠습니다.


gnu3/config.php 42 Line 에서

$cfg[large_image_size] = 500; // 이 수치가 넘어가면 이 수치로 게시판 이미지 크기 고정

500 숫자를 변경해 주시고 테이블(제 경우 500) 크기도 임의로 조절해 주시면 됩니다.


gnu3/lib/gnuboard.lib.php 의 511~515 Line 의

 &nbsp; &nbsp;$width &nbsp;= $size[0];
 &nbsp; &nbsp;$height = $size[1]; &nbsp;

 &nbsp; &nbsp;if (preg_match($cfg[image_extension], $file))
 &nbsp; &nbsp; &nbsp; &nbsp;return "<img src='./data/file/$board[bo_table]/$file' width='$width' height='$height' border=0>";

제 경우 size 가 0, 1 로 되어 있습니다. 이대로 해 놓으시고 조절을 해 보시기 바랍니다.
width='$width' height='$height' border=0><p>"; <- 여기 <p> 를 위처럼 삭제를 해 주셔야 합니다.

현재 문제는 0, 1로 조절을 해도 (윗줄에 항목이 몇개 더 있기는 한데 잘 모르겠더라구요.^^) 지금의
상태가 제일 무난한듯 해서 그냥 놔두었습니다. 다른 더 큰 문제는 위의 <P> 삭제를 하면 해당 스킨은
괜찮은데 다른 스킨의 경우 그림이 가로로 주욱~ --------------- 늘어집니다. <P> 그대로 놔두면
이놈의 스크립트 에러를 냅니다. 못 불러 온다는거죠.--;

아무튼 이렇습니다. 제 경우 모든 스킨을 이것으로 통일 했습니다.
참고삼아 해 보시고 수정이 가능하신 분들 계시면 심심 하실때 수정해
주셨으면 합니다. 원래의 의도는 이게 아니였지만 얼추(?) 비스무리 하게
되었습니다.^^;

좋은 밤 보내세요.

적용페이지는 - http://www.slgi.co.kr/cjhp/gnu3/?doc=bbs/gnuboard.php&bo_table=sale 이랍니다.
  • 복사

댓글 전체

혹 몰라서 글 남깁니다. 가로폭은 고정 되었는데 세로폭이 들쭉날쭉 해서 위 기준으로 ....

return "<img src='./data/file/$board[bo_table]/$file' width='$width' height='$height' border=0>";



return "<img src='./data/file/$board[bo_table]/$file' width='500' height='375' border=0>";

로 변경해 주었습니다. 항상 그 틀에만 고정되게 .... 참고하세요.
슬기넷님 감사 합니다
저때문에 이런 수고를 하여 주셔서
몸둘바를 모르겠습니다~~~^^;;
언제고 기회가 온다면
이 웬~~~수~~~???? 는
꼭 갚도록 하겠습니다~~~^^;;
정말로 감사 합니다~~~^^;;
루핑이 한번만 돈다면 이렇게 바꾸세요.(첨에 급하게 답변하느라 올렷던것을... 죄송)
수정전 :
  for ($i=1; $i<=1; $i++) {
    if ($file[$i][view]) { echo $file[$i][view]; }
  }
수정후 :
  if ($file[1][view]) { echo $file[1][view]; }
<SPAN ID="newlayer" style="position:absolute;">  </SPAN>

를 아래처럼 수정해 주시면 올리신 1번 파일이 보여집니다. (클릭 안해도)

      <SPAN ID="newlayer" style="position:absolute;"><?//스크린샷위치에 업로드파일 로드
for ($i=1; $i<=1; $i++) {
if ($file[$i][view]) { echo $file[$i][view]; }
}
?></SPAN>

참고하세요.
© SIRSOFT
현재 페이지 제일 처음으로