최신글 오류 문의드립니다. 정보
최신글 오류 문의드립니다.본문
http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=129503&sca=%EC%B5%9C%EC%8B%A0%EA%B8%80&sfl=wr_subject||wr_content&stx=%EB%A1%A4%EB%A7%81
위에 최신글 스킨을 사용중입니다.
메인에 하나만 사용 했을 경우 아무 문제 없이 나오는데
두개를 사용 했을 경우 하나는 롤링이 되지 않고 멈춰 있네여
관련 글을 찾아 보니 스크립트 id값 문제라고 해서 수정을 해 봐도 답이 나오질 않아 이렇게 도움 구합니다.
밑에는 스킨 코드입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
?>
<script>
/*
rolling page by hong..
*/
var leftCt = 0;
$(function(){
$("#album").attr("top", "0");
$("#imgList").attr("timer", setInterval("imgRight()", 3000)); // 멈춰있는 시간
$("#_sub0").css("color", "ff7200");
$("#_sub4").css("color", "6A6A6A");
});
function imgStart(tp){
clearInterval($("#imgList").attr("timer"));
if(tp == "R"){ // 오른쪽 이동
$("#imgList").attr("timer", setInterval("imgRight()", 3000)); // 멈춰있는 시간
imgRight();
}else{ // 왼쪽이동
if(leftCt == 0){
var leng = $("#imgList div").size();
$("#imgList").css("left",parseInt($("#imgList div").eq(0).width()*-1));
$("#imgList>div").eq(parseInt(leng-1)).clone().prependTo($("#imgList"));
$("#imgList>div").eq(leng).remove();
leftCt = 1;
}
$("#imgList").attr("timer", setInterval("imgLeft()", 3000));
imgLeft();
}
}
function imgRight(){
$("#imgList").animate({
left : parseInt($("#imgList div").eq(0).width() * -1)
},300,function(){
$("#imgList").css("left", "0px");
$("#imgList>div").eq(0).clone().appendTo($("#imgList"));
$("#imgList>div").eq(0).remove();
});
var cnt = parseInt($("#hidd_cnt").val());
var precnt = cnt - 1;
if (cnt==0)
{
$("#_sub0").css("color", "ff7200");
$("#_sub4").css("color", "6A6A6A");
}else{
$("#_sub"+cnt).css("color", "ff7200");
$("#_sub"+precnt).css("color", "6A6A6A");
}
cnt = cnt + 1;
// precnt = cnt - 1;
if (cnt > 4)
{
cnt = 0;
}
$("#hidd_cnt").val(cnt);
}
function imgLeft(){
var leng = $("#imgList div").size();
$("#imgList").animate({
left : 0
},300,function(){
$("#imgList").css("left", "0px");
$("#imgList").css("left",parseInt($("#imgList div").eq(0).width()*-1));
$("#imgList>div").eq(parseInt(leng-1)).clone().prependTo($("#imgList"));
$("#imgList>div").eq(leng).remove();
});
}
</script>
<style>
/*
이미지 사이즈 맞춰서 수정해주세요... (#viewArea)
*/
#back {position:relative; width:170px; height:110px; background-color:#fafafa; border:#e2e6e9 0px solid;}
#viewArea {position:relative; width:150px; height:110px; overflow:hidden; left:0px; top:0px;}
#imgList {position:absolute; width:800px; left:0px; top:0px;}
#imgList div {float:left; padding:0px; }
#btnLeft {position:absolute; left:10px; float:left; z-index:10; top:43px; cursor:hand;}
#btnRight {position:absolute; right:10px; float:right; z-index:10; top:43px; cursor:hand;}
</style>
<input type="hidden" id="hidd_cnt" value="1">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="160" align="center" valign="top">
<div id="back">
<div id="viewArea">
<div id="imgList">
<? for ($i=0; $i<count($list); $i++) {
$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
?>
<div><a href="<?=$list[$i]['href']?>"><img src='<?=$img?>' width="150" height="110" border="0"></a></div>
<? } ?>
</div>
</div>
<!--<div id="btnLeft">
<span onClick="imgStart('L')"><img src='<?=$latest_skin_path?>/img/btn_left.gif' border="0" align=absmiddle></span>
</div>
<div id="btnRight">
<span onClick="imgStart('R')"><img src='<?=$latest_skin_path?>/img/btn_right.gif' border="0" align=absmiddle></span>
</div>-->
</div>
</td>
<td>
<table width=180 cellpadding=0 cellspacing=0>
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td colspan=4 align=center>
<table width=95%>
<tr>
<td height=17><img src='<?=$latest_skin_path?>/img/latest_icon.gif' align=absmiddle>
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}'>";
if ($list[$i]['is_notice'])
echo "<font style='font-family:나눔고딕; font-size:9pt; color:#2C88B9;'><strong>{$list[$i]['subject']}</strong></font>";
else
echo "<font style='font-family:나눔고딕; font-size:9pt; color:#6A6A6A; font:bold;' id='_sub".$i."'>{$list[$i]['subject']}</font>";
echo "</a>";
if ($list[$i]['comment_cnt'])
echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:나눔고딕; font-size:8pt; color:#9A9A9A;'>{$list[$i]['comment_cnt']}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
echo " " . $list[$i]['icon_new'];
echo " " . $list[$i]['icon_file'];
echo " " . $list[$i]['icon_link'];
echo " " . $list[$i]['icon_hot'];
echo " " . $list[$i]['icon_secret'];
?></td></tr>
</table></td>
</tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</table>
</td></tr></table>
위에 최신글 스킨을 사용중입니다.
메인에 하나만 사용 했을 경우 아무 문제 없이 나오는데
두개를 사용 했을 경우 하나는 롤링이 되지 않고 멈춰 있네여
관련 글을 찾아 보니 스크립트 id값 문제라고 해서 수정을 해 봐도 답이 나오질 않아 이렇게 도움 구합니다.
밑에는 스킨 코드입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
?>
<script>
/*
rolling page by hong..
*/
var leftCt = 0;
$(function(){
$("#album").attr("top", "0");
$("#imgList").attr("timer", setInterval("imgRight()", 3000)); // 멈춰있는 시간
$("#_sub0").css("color", "ff7200");
$("#_sub4").css("color", "6A6A6A");
});
function imgStart(tp){
clearInterval($("#imgList").attr("timer"));
if(tp == "R"){ // 오른쪽 이동
$("#imgList").attr("timer", setInterval("imgRight()", 3000)); // 멈춰있는 시간
imgRight();
}else{ // 왼쪽이동
if(leftCt == 0){
var leng = $("#imgList div").size();
$("#imgList").css("left",parseInt($("#imgList div").eq(0).width()*-1));
$("#imgList>div").eq(parseInt(leng-1)).clone().prependTo($("#imgList"));
$("#imgList>div").eq(leng).remove();
leftCt = 1;
}
$("#imgList").attr("timer", setInterval("imgLeft()", 3000));
imgLeft();
}
}
function imgRight(){
$("#imgList").animate({
left : parseInt($("#imgList div").eq(0).width() * -1)
},300,function(){
$("#imgList").css("left", "0px");
$("#imgList>div").eq(0).clone().appendTo($("#imgList"));
$("#imgList>div").eq(0).remove();
});
var cnt = parseInt($("#hidd_cnt").val());
var precnt = cnt - 1;
if (cnt==0)
{
$("#_sub0").css("color", "ff7200");
$("#_sub4").css("color", "6A6A6A");
}else{
$("#_sub"+cnt).css("color", "ff7200");
$("#_sub"+precnt).css("color", "6A6A6A");
}
cnt = cnt + 1;
// precnt = cnt - 1;
if (cnt > 4)
{
cnt = 0;
}
$("#hidd_cnt").val(cnt);
}
function imgLeft(){
var leng = $("#imgList div").size();
$("#imgList").animate({
left : 0
},300,function(){
$("#imgList").css("left", "0px");
$("#imgList").css("left",parseInt($("#imgList div").eq(0).width()*-1));
$("#imgList>div").eq(parseInt(leng-1)).clone().prependTo($("#imgList"));
$("#imgList>div").eq(leng).remove();
});
}
</script>
<style>
/*
이미지 사이즈 맞춰서 수정해주세요... (#viewArea)
*/
#back {position:relative; width:170px; height:110px; background-color:#fafafa; border:#e2e6e9 0px solid;}
#viewArea {position:relative; width:150px; height:110px; overflow:hidden; left:0px; top:0px;}
#imgList {position:absolute; width:800px; left:0px; top:0px;}
#imgList div {float:left; padding:0px; }
#btnLeft {position:absolute; left:10px; float:left; z-index:10; top:43px; cursor:hand;}
#btnRight {position:absolute; right:10px; float:right; z-index:10; top:43px; cursor:hand;}
</style>
<input type="hidden" id="hidd_cnt" value="1">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="160" align="center" valign="top">
<div id="back">
<div id="viewArea">
<div id="imgList">
<? for ($i=0; $i<count($list); $i++) {
$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
?>
<div><a href="<?=$list[$i]['href']?>"><img src='<?=$img?>' width="150" height="110" border="0"></a></div>
<? } ?>
</div>
</div>
<!--<div id="btnLeft">
<span onClick="imgStart('L')"><img src='<?=$latest_skin_path?>/img/btn_left.gif' border="0" align=absmiddle></span>
</div>
<div id="btnRight">
<span onClick="imgStart('R')"><img src='<?=$latest_skin_path?>/img/btn_right.gif' border="0" align=absmiddle></span>
</div>-->
</div>
</td>
<td>
<table width=180 cellpadding=0 cellspacing=0>
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td colspan=4 align=center>
<table width=95%>
<tr>
<td height=17><img src='<?=$latest_skin_path?>/img/latest_icon.gif' align=absmiddle>
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}'>";
if ($list[$i]['is_notice'])
echo "<font style='font-family:나눔고딕; font-size:9pt; color:#2C88B9;'><strong>{$list[$i]['subject']}</strong></font>";
else
echo "<font style='font-family:나눔고딕; font-size:9pt; color:#6A6A6A; font:bold;' id='_sub".$i."'>{$list[$i]['subject']}</font>";
echo "</a>";
if ($list[$i]['comment_cnt'])
echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:나눔고딕; font-size:8pt; color:#9A9A9A;'>{$list[$i]['comment_cnt']}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
echo " " . $list[$i]['icon_new'];
echo " " . $list[$i]['icon_file'];
echo " " . $list[$i]['icon_link'];
echo " " . $list[$i]['icon_hot'];
echo " " . $list[$i]['icon_secret'];
?></td></tr>
</table></td>
</tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</table>
</td></tr></table>
댓글 전체
자바 함수가 중복되는걸로 판단이 됩니다.
function 값이 동일하여 나오는 오류로 판단됩니다
function 값뒤에 변수들의 값을 변경해보시면 2개 쓰실수 잇을겁니다.
function 값뒤에 변수들의 값을 변경해보시면 2개 쓰실수 잇을겁니다.
말씀 하신대로 해 보았는데 정확히 어디를 변경 해야 하는지 몰라서 헤매고 있네여ㅜㅜ
예를 들어 말씀드릴게요
function aa()
이렇게 변수가 aa로설정되있으면
사용하고자 하는곳에서 id값을 aa을 불러오게될겁니다.
이부분을 function aa()
복사후 bb()이렇게 바꺼주시고
출력하고자하는곳 id값을 bb로하면 funtion의 값이 변경되기에 사용할수 있는거구요
function aa()
이렇게 변수가 aa로설정되있으면
사용하고자 하는곳에서 id값을 aa을 불러오게될겁니다.
이부분을 function aa()
복사후 bb()이렇게 바꺼주시고
출력하고자하는곳 id값을 bb로하면 funtion의 값이 변경되기에 사용할수 있는거구요
스크립트중 imgList 요값과imgStart 요값을 검색하셔서 다른 명칭으로바꿔주시구요 그래도문제가되신다면
위에서 말했듯이 어차피 id값만 중복되지않으면 당연히 에러가나지않고 한화면에 2개의 스킨을 사용할수있어요~ id값이나 class값을 바꿔가면서 점검해보시면 될겁니다.
위에서 말했듯이 어차피 id값만 중복되지않으면 당연히 에러가나지않고 한화면에 2개의 스킨을 사용할수있어요~ id값이나 class값을 바꿔가면서 점검해보시면 될겁니다.