index에 같은최근게시물을 여러개 사용하려면..... > 그누4 질문답변

그누4 질문답변

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

index에 같은최근게시물을 여러개 사용하려면..... 정보

index에 같은최근게시물을 여러개 사용하려면.....

본문

불량감자님이 올려주신것을 나도엔타님이 수정해주신
오토탭무빙을 사용하려고 합니다...
한페이지에 같은 최근게시물을 여러개 사용하려고 하면..

처음에 그냥 폴더명만 바구어서 사용하면 될줄알았는데요...(흑흑~~~ 왕초보라....)
폴더명만을 바꾸어서 사용하니깐...
맨 처음에 출력하는곳에만 제대로 탭이 되고 두번째부터는 잠잠......

아직 초보라서요..
크기를 줄여서 사용하는것 까지는 해결했는데...
같은 스킨을 여러개 적용하려면 어느 부분을 수정해서 사용해야하는걸까요?

<?=latest("news_poto5", "Europepackage", 5, 20); // 최신글 오토탭무빙 ?></p>

<?=latest("news_poto50", "Eastern", 5, 20); // 최신글 오토탭무빙 ?></p>

제가 폴더를 다로 복사하기로 해서 폴더명을 바꾸어서 사용해보았는데..
안되네요..

답변좀 부탁 드려보겠습니다....^^

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$img_width = 200; //큰 썸네일 가로
$img_height = 142; //큰 썸네일 세로

$img_quality = 90; //썸네일 퀄리티

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

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

@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);

//코멘트와 리플글은 제외
$sql = " select * from $tmp_write_table
where wr_comment = '' and wr_reply = ''
order by wr_id DESC LIMIT 0, 1 ";
$result = sql_query($sql);
$last_con = sql_fetch_array($result);
?>
<SCRIPT type=text/javascript>
<!--
old_debate_R='1';
function ComeonR(objid_R){
document.getElementById("debate_R"+old_debate_R).style.display="none";
document.getElementById("debate_R"+old_debate_R+"#1").style.display="";
document.getElementById("debate_R"+objid_R+"#1").style.display="none";
document.getElementById("debate_R"+objid_R).style.display="";
document.getElementById("debate_content_R"+old_debate_R).style.display="none";
document.getElementById("debate_content_R"+objid_R).style.display="";
old_debate_R=objid_R;
}
var objid_R = 1;
var interval_best;

function best_change_R()
{
 if( objid_R == <?=count($list)?> ) // 드렁크수달스님의 팁
  objid_R = 1;
 else
  objid_R++;

 ComeonR(objid_R);
}
function setInterval_best()
{
 interval_best = setInterval("best_change_R()", 5000);//속도조절
}
function clearInterval_best()
{
 clearInterval(interval_best);
}
setInterval_best();
//-->
</SCRIPT>
<SCRIPT type=text/javascript>
// PNG관련
function setPng24(obj) {
        obj.width=obj.height=1;
        obj.className=obj.className.replace(/\bpng24\b/i,'');
        obj.style.filter =
        "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
        obj.src='';
        return '';
    }
</SCRIPT>
<!-- png파일관련-->
<style type="text/css">
.png24 {
  tmp:expression(setPng24(this));
}
</style>
<style type="text/css">
.png24 { tmp:expression(setPng24(this)); }
</style>
<!-- png파일관련 끝 -->

<!-- 게시판명 생략 --
<table width="100%" cellpadding="0" cellspacing="0" border="0" >
<tr><td><img src="<?=$latest_skin_path?>/img/icon_table.gif" width="20" height="18" border="0" align="absmiddle"><STRONG><?=$board[bo_subject]?></STRONG></td>
<td 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>
<tr><td colspan="2" height="1" bgcolor="#eeeeee"></td></tr>
<tr><td colspan="2" height="10"></td></tr>
</table>
-->

<table  width="450" height="185" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td background="<?=$latest_skin_path?>/img/allbg.jpg">

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td>
<? for ($i=0; $i<count($list); $i++) {
$j = $i + 1; 
if ($j == "1") {
echo "<DIV>";
echo "<DIV id=debate_content_R$j onmouseover=clearInterval_best() onmouseout=setInterval_best()>"; }
else { echo "<DIV id=debate_content_R$j onmouseover=clearInterval_best() onmouseout=setInterval_best() style='DISPLAY: none;'>\n"; }
?>
<div style="float:left;width:200px;padding:13px 0 0 13px;">
<?
//썸네일 생성
$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[$i]['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 = "<img src='$thumb' width='{$img_width}' height='{$img_height}' border='0' style='border:0px #ccc solid'></a>";
else
//이미지가 없으면
$thumfile="<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>"; }

?>
<!--------PNG 사용하기 ----------->



<style type="text/css">
.png24 {
  tmp:expression(setPng24(this));
}



</style>
            <table align="center" cellpadding="0" cellspacing="0" width="200">
                <tr>
                    <td width="200" height="140" background="<?=$thumb?>">
<a href='<?=$list[$i][href]?>'><img src="<?=$latest_skin_path?>/img/layer_bg.png"  align="absmiddle" class="png24"  width="200" height="142" border="0"></a>
                    </td>
                </tr>
            </table>
<!--------PNG 사용하기 ----------->

 </div>
 <div style="float:right; width:230px; height:130px; padding:25px 10px 0 0;">
 
 <span style="font-size:17px; letter-spacing:-1px; line-height:19px;"><a href='<?=$list[$i][href]?>'><strong><font color="black"><?=$list[$i][subject]?></font></strong></a></span>
 <br />
 <span style="padding-top:12px; font-size:11px; font-family:굴림; letter-spacing:-1px; line-height:15px; color:#999;"><?=cut_str(strip_tags($list[$i][wr_content]),130,"...more")?></span>
 </div>

<?
echo "</DIV>";
 }
?>
<div style="float:right; width:230px; padding:0 0 0 0px;">
<? for ($i=0; $i<count($list); $i++) {
$k = $i + 1;
$img_width_s = 37; //작은 썸네일 가로
$img_height_s = 31; //작은 썸네일 세로
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
$thumb2 = $thumb_path.'/'.$list[$i][wr_id];
 ?>

<a href='<?=$list[$i][href]?>' onmouseover="javascript:ComeonR('<?=$k?>')"><img src="<?=$thumb2?>" width="<?=$img_width_s?>" height="<?=$img_height_s?>" hspace="0"  id="debate_R<?=$k?>" onmouseover="clearInterval_best()" onmouseout="setInterval_best()" <? if($k == "1") { echo "style='border:2px solid #FF6319;' ";} else { echo "style='DISPLAY: none; border:2px solid #FF6319;' ";} ?>><img src="<?=$thumb2?>"  width="<?=$img_width_s?>" height="<?=$img_height_s?>" hspace="0"  border="0"  id="debate_R<?=$k?>#1" <? if($k == "1") { echo "style='DISPLAY: none; border:2px solid #FFFFFF;'"; } else { echo "style='border:2px solid #FFFFFF;'";} ?>></a><? } ?>
</div>
</td></tr></table></td></tr></table>
  • 복사

댓글 전체

old_debate_R='1';
function ComeonR(objid_R){
.....

소스에서
대문자 R을 다른 문자로 전체 바꿔서 해보세요... (대문자 R만)
A, B, C 등으로..
같은 펑션 두개이상 사용시 충돌때문에..
제가 몰 잘못했을까요?
이렇게 수정해서 올렸더니만 처음것도 멈추어 버리네요...
죄송하지만 한번만 살펴 보아 주세요....^^
<SCRIPT type=text/javascript>
<!--
old_debate_A='1';
function ComeonR(objid_A){
document.getElementById("debate_A"+old_debate_A).style.display="none";
document.getElementById("debate_A"+old_debate_A+"#1").style.display="";
document.getElementById("debate_A"+objid_A+"#1").style.display="none";
document.getElementById("debate_A"+objid_A).style.display="";
document.getElementById("debate_content_A"+old_debate_A).style.display="none";
document.getElementById("debate_content_A"+objid_A).style.display="";
old_debate_A=objid_A;
}
var objid_A = 1;
var interval_best;

function best_change_A()
{
 if( objid_A == <?=count($list)?> ) // 드렁크수달스님의 팁
  objid_A = 1;
 else
  objid_A++;

 ComeonR(objid_A);
}
function setInterval_best()
{
 interval_best = setInterval("best_change_A()", 5000);//속도조절
}
function clearInterval_best()
{
 clearInterval(interval_best);
}
setInterval_best();
//-->
</SCRIPT>
수정이 덜되었네요
>> function ComeonR(objid_A){
 function ComeonA(objid_A){
>> ComeonR(objid_A);
ComeonA(objid_A);

수정후 호출할때는
function ComeonA  - 이 펑션이름으로 바꿔 줘야합니다.

<a href='<?=$list[$i][href]?>' onmouseover="javascript:ComeonR('<?=$k?>')"><img src="
->
<a href='<?=$list[$i][href]?>' onmouseover="javascript:ComeonA('<?=$k?>')"><img src="
먼저 감사인사드립니다...^^
아직 해결을 다 못했습니다....흑~~
수정을 다 한다고 했는데.. 아직 에러가 나네요..
좀만 더 해보려구요..
이렇게 친절하게 답변 주셔서 너무 감사드립니다...꾸벅~
© SIRSOFT
현재 페이지 제일 처음으로