고수님들 도와주세요~ 이 오류 어떻게 해결해야 되나요? > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

고수님들 도와주세요~ 이 오류 어떻게 해결해야 되나요? 정보

고수님들 도와주세요~ 이 오류 어떻게 해결해야 되나요?

본문

http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=89063 < 불량 감자님 최신글 스킨 사용하려고 하는데 document.all[...].length 은(는) null 이거나 개체가 아닙니다. 라고 에러나오고 정상 작동이 안되네요...

어떻게 해결해야 정상작동 할까요???
  • 복사

댓글 전체

스킨 소스를 정확히 보질 않아서 섣불리 단정짓기는 어렵지만..

아마도 [...] 안에 들어있는 자바스크립트 변수, 또는 php변수가 제대로 접근을 못해서 나는 에러 부분이리라 생각 되네요.

[ ] 안에 있는 변수의 엘리먼트의 갯수를 세어서 작동을 하는 부분인거 같은데..(스킨상 화면에 뿌려지는 부분이 아닐까 생각 됩니다.)

해당 스킨의 list페이지 또는 view페이지(에러 부분이 리스트에서 나는지 뷰에서 나는지 적어주시지 않아서..)에서 document.all[변수] 에 해당하는 엘리먼트 아이디를 ctrl+f로 찾아보셔서(변수명을) 확인해 보도록 하세요..

p.s 혹시 테스트 하신 환경이 ie가 아니라면,
document.all 부분을 document.getElementById(변수).length로 바꿔주셔야 됩니다. document.all은..ie 전용인지라..
ie 가 인터넷 익스프로러 말씀하시는거맞죠? 파이어폭스나 그런거 말구요?
맞다면 저도 ie인데 작동을 안하네요 ㅠㅠ
아래 소스인데 한번만 봐주시면 안될까요??
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//$width=700; //테이블 전체폭
//$height=120; //테이블 전체높이
$mod=3; //몫

$img_width = 130;
$img_height = 90;
$img_quality = 100;

if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");

$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
$ym = date("ym", $g4[server_time]);

@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<script language=javascript>
<!--
var DownLayer<?=$bo_table?>Id<?=$bo_table?>;
var dropDegree<?=$bo_table?> = 2000 //스크롤 속도
var doDirect<?=$bo_table?>;
var DirectTerm<?=$bo_table?> = 5000; //스크롤 지연시간
var curDropIdx<?=$bo_table?> = 11; // 이미지가 최근것부터 안 나오면 이부분 수정
// 보여줄총갯수 60개 한번에 보여줄갯수 5일때 11  60/5=12-1=11의 형식임

function DirectRight<?=$bo_table?>(keys)
{
        clearInterval(doDirect<?=$bo_table?>);
        clearInterval(DownLayer<?=$bo_table?>Id<?=$bo_table?>);


        for(i = curDropIdx<?=$bo_table?> ;i < document.all["DropHit<?=$bo_table?>"+keys].length + curDropIdx<?=$bo_table?>;i++){
                document.all["DropHit<?=$bo_table?>"+keys][i%document.all["DropHit<?=$bo_table?>"+keys].length].style.posLeft = document.all["DropHit<?=$bo_table?>"+keys][i%document.all["DropHit<?=$bo_table?>"+keys].length].style.posWidth * (-1*((i-curDropIdx<?=$bo_table?>)%document.all["DropHit<?=$bo_table?>"+keys].length));
        }
        var temp = 'setInterval("DownLayer<?=$bo_table?>('+keys+')",20)';
        DownLayer<?=$bo_table?>Id<?=$bo_table?> = eval(temp);
        direction = "left";
}
function DownLayer<?=$bo_table?>(keys)
{
        if(document.all["DropHit<?=$bo_table?>"+keys][curDropIdx<?=$bo_table?>].style.posLeft < document.all["DropHit<?=$bo_table?>"+keys][curDropIdx<?=$bo_table?>].style.posWidth){
                for(j = curDropIdx<?=$bo_table?> ;j < document.all["DropHit<?=$bo_table?>"+keys].length + curDropIdx<?=$bo_table?>;j++){
                        document.all["DropHit<?=$bo_table?>"+keys][j%document.all["DropHit<?=$bo_table?>"+keys].length].style.posLeft += dropDegree<?=$bo_table?>;
                }
        }else{
                clearInterval(DownLayer<?=$bo_table?>Id<?=$bo_table?>);
                for(j = curDropIdx<?=$bo_table?> ;j < document.all["DropHit<?=$bo_table?>"+keys].length + curDropIdx<?=$bo_table?>;j++){
                        document.all["DropHit<?=$bo_table?>"+keys][j%document.all["DropHit<?=$bo_table?>"+keys].length].style.posLeft = document.all["DropHit<?=$bo_table?>"+keys][j%document.all["DropHit<?=$bo_table?>"+keys].length].style.posWidth *((-1*((j-curDropIdx<?=$bo_table?>)%document.all["DropHit<?=$bo_table?>"+keys].length))+1);
                }
                curDropIdx<?=$bo_table?> = (curDropIdx<?=$bo_table?> + 1) ;
                curDropIdx<?=$bo_table?> = curDropIdx<?=$bo_table?> > document.all["DropHit<?=$bo_table?>"+keys].length-1 ? curDropIdx<?=$bo_table?>%document.all["DropHit<?=$bo_table?>"+keys].length:curDropIdx<?=$bo_table?>;
                var temp = 'setInterval("DirectRight<?=$bo_table?>('+keys+')",DirectTerm<?=$bo_table?>)';
                doDirect<?=$bo_table?> = eval(temp);
        }
}
function DirectLeft<?=$bo_table?>(keys)
{
        clearInterval(doDirect<?=$bo_table?>);
        clearInterval(DownLayer<?=$bo_table?>Id<?=$bo_table?>);
        var tempIdx = 0;
        for(i = 0;i<document.all["DropHit<?=$bo_table?>"+keys].length;i++){
                tempIdx = (document.all["DropHit<?=$bo_table?>"+keys].length + curDropIdx<?=$bo_table?> - i) %document.all["DropHit<?=$bo_table?>"+keys].length;
                document.all["DropHit<?=$bo_table?>"+keys][tempIdx].style.posLeft = i*document.all["DropHit<?=$bo_table?>"+keys][tempIdx].style.posWidth;
        }
        var temp = 'setInterval("UpLayer<?=$bo_table?>('+keys+')",20)';
        DownLayer<?=$bo_table?>Id<?=$bo_table?> = eval(temp);
        direction = "up";
}
function UpLayer<?=$bo_table?>(keys)
{
        var tempIdx = 0;
        if(document.all["DropHit<?=$bo_table?>"+keys][curDropIdx<?=$bo_table?>].style.posLeft < document.all["DropHit<?=$bo_table?>"+keys][curDropIdx<?=$bo_table?>].style.posWidth && document.all["DropHit<?=$bo_table?>"+keys][curDropIdx<?=$bo_table?>].style.posLeft > document.all["DropHit<?=$bo_table?>"+keys][curDropIdx<?=$bo_table?>].style.posWidth * (-1)){
                for(j = 0 ;j < document.all["DropHit<?=$bo_table?>"+keys].length;j++){
                        tempIdx = (document.all["DropHit<?=$bo_table?>"+keys].length + curDropIdx<?=$bo_table?> - j) %document.all["DropHit<?=$bo_table?>"+keys].length;
                        document.all["DropHit<?=$bo_table?>"+keys][tempIdx].style.posLeft -= dropDegree<?=$bo_table?>;
                }
        }else{
                clearInterval(DownLayer<?=$bo_table?>Id<?=$bo_table?>);
                for(j = 0;j<document.all["DropHit<?=$bo_table?>"+keys].length;j++){
                        tempIdx = (document.all["DropHit<?=$bo_table?>"+keys].length + curDropIdx<?=$bo_table?> - j) % document.all["DropHit<?=$bo_table?>"+keys].length;
                        document.all["DropHit<?=$bo_table?>"+keys][tempIdx].style.posLeft = (j-1)*(document.all["DropHit<?=$bo_table?>"+keys][tempIdx].style.posWidth);
                }
                curDropIdx<?=$bo_table?> = (curDropIdx<?=$bo_table?> - 1) ;
                curDropIdx<?=$bo_table?> = curDropIdx<?=$bo_table?> < 0 ? document.all["DropHit<?=$bo_table?>"+keys].length-1:curDropIdx<?=$bo_table?>;
                var temp = 'setInterval("DirectLeft<?=$bo_table?>('+keys+')",DirectTerm<?=$bo_table?>)';
                doDirect<?=$bo_table?> = eval(temp);
        }
}
//-->
</script>
<table width="100%" cellpadding="0" cellspacing="0"><tr><td width="80%"><img src="<?=$latest_skin_path?>/img/icon_table.gif" width="20" height="18" border="0" align="absmiddle"><strong><?=$board[bo_subject]?></strong></td><td  width="20%" align="right"><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src="<?=$latest_skin_path?>/img/icon_more.gif" width="40" height="12" border="0" align="absmiddle"></a></td></tr></table>
<table style="border:1px #eee solid; padding:10px 0 10px 0" width="100%" cellpadding="0" cellspacing="0">
  <tr>
    <td style="padding-left:5px" width="24" align="center" valign="middle"><a href="javascript:DirectLeft<?=$bo_table?>(3)"><img src="<?=$latest_skin_path?>/img/left_btn.gif" width="20" height="41" border="0"></a>
    </td>
    <td align="center" valign="middle">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td><table width="100%"  border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td valign="middle">

<table width="100%" height="<?=$height?>" cellspacing=0 cellpadding=0 border=0>
<tr><td valign="middle">
<div style="left:0px; overflow:hidden; width:<?=$width?>px;height:<?=$height?>px;position:relative; top:0px;">
<?
for ($i=0; $i<count($list); $i++){
if ($i% $mod==0 || $mod==1) {
?>
<div id=DropHit<?=$bo_table?>3 style="width:<?=$width?>px; height:<?=$height?>px; position:absolute; left:0px; top:0px; z-index:1; visibility:visible;">
<?
echo "<table cellspacing=0 cellpadding=0 border=0 align='center' width='100%'><tr>";
}

//썸네일 생성
 $thumfile = "";
    $thumb = $thumb_path.'/'.$list[$i][wr_id];
    // 썸네일 이미지가 존재하지 않는다면
    if (!file_exists($thumb)) {
        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
        // 업로드된 파일이 이미지라면
        if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file)) {
            $size = getimagesize($file);
            if ($size[2] == 1)
                $src = imagecreatefromgif($file);
            else if ($size[2] == 2)
                $src = imagecreatefromjpeg($file);
            else if ($size[2] == 3)
                $src = imagecreatefrompng($file);
            else
                break;

            $rate = $img_width / $size[0];
            $height = (int)($size[1] * $rate);

            // 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
            if ($height < $img_height)
                // 계산된 이미지 높이로 복사본 이미지 생성
                $dst = imagecreatetruecolor($img_width, $height);
            else
                // 설정된 이미지 높이로 복사본 이미지 생성
                $dst = imagecreatetruecolor($img_width, $img_height);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
            imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
            chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
        } else { //게디터에서 삽입한 이미지 뽑자ㅠㅠ
$edit_img = $list[$k]['wr_content'];
if (eregi("data/cheditor4/{$ym}/[^<>]*\.(gif|jpg|png|bmp)", $edit_img, $tmp)) { // data/geditor------
$file = './' . $tmp[0]; // 파일명
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
break;

$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);

// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
    }
}

    if (file_exists($thumb))
        $thumfile = "<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}' title='{$list[$i][subject]}'><img src='$thumb' width='{$img_width}' height='{$img_height}' border='0' style='border:0 #eee solid' onmouseover=this.style.filter='alpha(opacity=80)' onmouseout=this.style.filter=''></a>";
else
//이미지가 없으면
$thumfile="<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}' title='{$list[$i][subject]}'><img src='$latest_skin_path/img/noimg.gif' width='{$img_width}' height='{$img_height}' style='border:0 #E7E7E7 solid'></a>";
//이미지가 아니네
        if(preg_match("/\.(swf|wma|asf)$/i","$file") && file_exists($file))
      { $thumfile = "<script>doc_write(flash_movie('$file', 'flash$i', '$img_width', '$img_height', 'transparent'));</script>"; }


echo <<<HEREDOC
<td width='{$width}' align='center' valign='top'><table cellspacing=0 cellpadding=0 border=0 align='center' width='{$img_width}'><tr>
<td  align='center' valign='top' style='padding;5px'>{$thumfile}</td></tr><tr><td style='padding:5px; line-height:14px;'><a href='{$list[$i][href]}'>{$list[$i][subject]}</a>&nbsp;<span style='font-size:11px;color:#E74700; letter-spacing:-1px'>{$list[$i]['comment_cnt']}</span>&nbsp;{$list[$i]['icon_new']}</td></tr></table>


 </td>
HEREDOC;
if ($i% $mod==($mod-1) || $mod==1) {//~~~~~~~~
echo "</tr></table></div>";
}//~~~~~~~
}//#######################################################
?>

 <script language=javascript>
 <? if ($wdirect=="left"){?>
 DirectLeft<?=$bo_table?>(3);
 <?} else  if ($wdirect=="right"){?>
 DirectRight<?=$bo_table?>(3);
<? }?>
 </script>
 </div>
 </td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
</td> 
<td style="padding-right:5px" width="25" align="center" valign="middle"><a href="javascript:DirectRight<?=$bo_table?>(3)"><img src="<?=$latest_skin_path?>/img/right_btn.gif" width="20" height="41" border="0"></a></td>
</tr>
</table></td>
</tr>
</table>
이렇게 통짜 소스를 주시면..
제가 직접 불량감자님의 스킨을 깔아보고 테스트해보면서 하지 않는이상..이 소스만 보고 탁 답나오진 않네요..(제가고수가 아니라서)

대충 훓어보면..
(저도 지금 일하는 중에 머리식힐겸해서 들어오는거라..시간을 내서 확실하게 알려드리기는..^^)

현재 소스가 뿌려주는 역할을 하는 소스인거 같은데..

이 소스만 가지고는 정확하게 어디가 문제인지 답을 내주기 힘듭니다; (경우의 수가 너무 많이 생겨서요..)

딱히 크게 경우의 수를 뽑아보자면..(이런 문제는 대부분 소스상의 오류보다 사용하시려는 환경이나 불러오는곳에서 에러가 날경우가 많습니다.)


이 스킨을 출력하려는 부분쪽에 뭔가 잘못되있을수도 있으니, 출력시키려는 페이지에
<?
include_once("$g4[path]/skin/latest/YS_scroll/inc_config.php");
here_latest("YS_scroll", "fun_07", 60,35," , ,130,90,700,120,5,right"); 
//here_latest("스킨명", "게시판명", 총갯수,글자수," , ,이미지가로,이미지세로,테이블가로길이,테이블세로길이,한번에보여줄갯수,방향"); 
?>
위와 같은 소스를 제대로 넣어주셨는지 확인해주시고요..
참고로 위 소스에 설명 되있듯이 here_latest("YS_scroll", "fun_07", 60,35," , ,130,90,700,120,5,right"); 부분의 fun_07부분에 님이 생성한 게시판 명을 적어주셔아 됩니다.

그리고..문닫어님의 그누보드 설치 파일이 utf8버젼인지 euckr버젼인지도 확인해보세요.

원작자에 의하면 euckr환경이라고 되어있으니..utf8일경우 에러가 생길지도..
© SIRSOFT
현재 페이지 제일 처음으로