불량감자님이 올린 오토무빙 스킨 인데요...한페이지에 여러개 사용하려면 어디를... > 그누4 질문답변

그누4 질문답변

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

불량감자님이 올린 오토무빙 스킨 인데요...한페이지에 여러개 사용하려면 어디를... 정보

불량감자님이 올린 오토무빙 스킨 인데요...한페이지에 여러개 사용하려면 어디를...

본문

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//$width=560; //테이블 전체폭
//$height=90; //테이블 전체높이
$mod=6; //몫

$img_width = 80;
$img_height = 60;
$img_quality = 99;




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?> = 100 //스크롤 속도
var doDirect<?=$bo_table?>;
var DirectTerm<?=$bo_table?> = 10000; //스크롤 지연시간
var curDropIdx<?=$bo_table?> = 1; // 이미지가 최근것부터 안 나오면 이부분 수정
// 보여줄총갯수 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 align="center" border="0" cellpadding="0" cellspacing="0" width="100%">

<td width="100%" height="50" align="center" bgcolor="ffffff" valign="top">


<table width="100%" cellpadding="0" cellspacing="1" align="center">
<tr>
<td width='75%' height="20"><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src="<?=$latest_skin_path?>/img/title.gif" border="0" align="absmiddle"></b></a></td>
<td width="5%"><a href="javascript:DirectRight<?=$bo_table?>(3)"><img src="<?=$latest_skin_path?>/img/left_btn.gif" width="9" height="9" border="0"></a>
  <a href="javascript:DirectLeft<?=$bo_table?>(3)"><img src="<?=$latest_skin_path?>/img/right_btn.gif" width="9" height="9" border="0"></a></td>

</tr>
<tr><td colspan="4" bgcolor="E9E9E9" height="1"></td></tr>
</table>

<table width="100%" cellpadding="0" cellspacing="5" border="0">

  <tr>

    <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='1' 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>
<tr><td  align='center' valign='top' style='padding;2px'>{$thumfile}</td></tr><tr><td style='padding:2px; line-height:14px;'><a href='{$list[$i][href]}'>{$list[$i][subject]}</a>&nbsp;{$list[$i]['icon_new']}</tr>
<tr><td align='center' valign='top' style='padding;2px'><a href='{$list[$i][href]}'><font color='lightblue'>".number_format($row[wr_4])."</font> </a></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>
 
</tr>
</table>
</td>
</table>

--------------------------------
http://sir.co.kr/bbs/board.php?bo_table=g4_skin_latest&wr_id=17743&sca=&sfl=wr_subject&stx=%BF%C0%C5%E4&sop=and 

불량감자님이 올린 최근스킨인데요 여러게 사용이 안되여서 미치겠습니다 ㅜ
자바스크립트 부분과 테이블을 다르게 수정하면 한페이지에 여러개 사용할수있다고 하는데
도저히 안되어서 도움요청드립니다.  고수님들 소스보시구 어디를 바꾸어야 되는지 답변좀 주세요
부탁드려요~
  • 복사

댓글 전체

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