민망하지만 연속질문입니다;; 정보
민망하지만 연속질문입니다;;본문
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.
오류 주소 : http://www.ican2080.com/bbs/m2.php
메인에 출력되기까진 했는데 어딘가 문제가 있는것 같습니다.
제가 원하는건
http://billwscott.com/carousel/carousel_dhtml_load_bounded_wrap.html
이런건데 말이죠;;
<?=latest("carousel","teachclip",16,30);?><?=latest("carousel","clips",16,30);?>
이런식으로 두개 넣어준 상태인데요
latest.lib.php의 내용은
<?
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $brch="")
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$list = array();
$sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
// 위의 코드 보다 속도가 빠름
if ($brch == "H") // 넘어온 값이 "H" 즉 hit 일때
$brch = "wr_hit"; // hit 순으로 쿼리
elseif ($brch == "C") // 넘어온 값이 "C" 즉 comment 일때
$brch ="wr_comment"; // comment 순으로 쿼리
elseif ($brch == "R") //넘온값이 "R" 즉 random 일때
$brch = "rand()"; // 랜덤 쿼리
elseif ($brch == "G") //넘온값이 "G" 즉 추천 일때
$brch = "wr_good"; // 추천 쿼리
elseif ($brch == "N") //넘온값이 "N" 즉 공지wr_4 일때
$brch = "wr_4"; // 공지 쿼리
else // 넘어온값이 없거나 그이외 일때
$brch = "wr_id"; // 걍 최근순으로 쿼리
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by $brch desc limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
이런데요..
새로 만들어서 넣어줘야하나요?
오류 주소 : http://www.ican2080.com/bbs/m2.php
메인에 출력되기까진 했는데 어딘가 문제가 있는것 같습니다.
제가 원하는건
http://billwscott.com/carousel/carousel_dhtml_load_bounded_wrap.html
이런건데 말이죠;;
<?=latest("carousel","teachclip",16,30);?><?=latest("carousel","clips",16,30);?>
이런식으로 두개 넣어준 상태인데요
latest.lib.php의 내용은
<?
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $brch="")
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$list = array();
$sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
// 위의 코드 보다 속도가 빠름
if ($brch == "H") // 넘어온 값이 "H" 즉 hit 일때
$brch = "wr_hit"; // hit 순으로 쿼리
elseif ($brch == "C") // 넘어온 값이 "C" 즉 comment 일때
$brch ="wr_comment"; // comment 순으로 쿼리
elseif ($brch == "R") //넘온값이 "R" 즉 random 일때
$brch = "rand()"; // 랜덤 쿼리
elseif ($brch == "G") //넘온값이 "G" 즉 추천 일때
$brch = "wr_good"; // 추천 쿼리
elseif ($brch == "N") //넘온값이 "N" 즉 공지wr_4 일때
$brch = "wr_4"; // 공지 쿼리
else // 넘어온값이 없거나 그이외 일때
$brch = "wr_id"; // 걍 최근순으로 쿼리
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by $brch desc limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
이런데요..
새로 만들어서 넣어줘야하나요?
댓글 전체
latest.skin.php 내용이 문제 해결에 도움이 될 거 같습니다.
------------------------------latest.skin.php의 내용입니다.--------------------------------
<? if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$g4['yui'] = "/script/yui/build";
?>
<script type="text/javascript" src="<?=$g4['yui']?>/utilities/utilities.js"></script>
<script type="text/javascript" src="<?=$g4['yui']?>/container/container_core.js"></script>
<script type="text/javascript" src="<?=$g4['yui']?>/carousel/scripts/carousel.js"></script>
<link rel="stylesheet" type="text/css" href="<?=$g4['yui']?>/grids/grids.css">
<link rel="stylesheet" type="text/css" href="<?=$g4['yui']?>/fonts/fonts.css">
<link href="<?=$g4['yui']?>/carousel/css/carousel.css" rel="stylesheet" type="text/css">
<style type="text/css">
.carousel-component .carousel-list li {width:130px;margin-top:8px;} /* 이미지 width 설정*/
.carousel-component .carousel-list li a {display:block; border:2px solid #e2edfa;outline:none;-moz-outline:none; }
.carousel-component .carousel-list li a:hover {border: 2px solid #87bf4e;}
.carousel-component .carousel-list li.active a {border:2px solid #708fc7;}
.carousel-component .carousel-list li img {border:1px solid #999;display:block;}
.carousel-component .carousel-list li strong {display:block;}
.carousel-component .carousel-prev {position:absolute;top:40px;z-index:3;cursor:pointer;left:5px;}
.carousel-component .carousel-next {position:absolute;top:40px;z-index:3;cursor:pointer;right:5px;}
</style>
<script type="text/javascript">
var handlePrevButtonState = function(type, args) {
var enabling = args[0];
var leftImage = args[1];
if(enabling) {
leftImage.src = "<?=$g4['yui']?>/carousel/images/left-enabled.gif";
} else {
leftImage.src = "<?=$g4['yui']?>/carousel/images/left-disabled.gif";
}
};
var handleNextButtonState = function(type, args) {
var enabling = args[0];
var rightImage = args[1];
if(enabling) {
rightImage.src = "<?=$g4['yui']?>/carousel/images/right-enabled.gif";
} else {
rightImage.src = "<?=$g4['yui']?>/carousel/images/right-disabled.gif";
}
};
var pageLoad = function()
{
var carousel = new YAHOO.extension.Carousel("mycarousel",
{
//latest("carousel","photo",16,30);
//위와 같이 스킨을 삽입할때 최근글 뽑아올 수를 아래의 size값가 같게 해주세요.
numVisible: 4, //한화면에 출력될 이미지 갯수
animationSpeed: .50, //스크롤 속도
scrollInc: 4, //한번에 스크롤될 이미지 갯수
navMargin: 40, //네비게이션 버튼 마진
prevElement: "prev-arrow",
nextElement: "next-arrow",
size: 16, //이미지 갯수
prevButtonStateHandler: handlePrevButtonState,
nextButtonStateHandler: handleNextButtonState
}
);
};
YAHOO.util.Event.addListener(window, 'load', pageLoad);
</script>
<div id="mycarousel" class="carousel-component">
<div style=" text-align:center">
<div class="carousel-prev"> <img id="prev-arrow" class="left-button-image" src="<?=$g4['yui']?>/carousel/images/left-enabled.gif"/> </div>
<div class="carousel-next"> <img id="next-arrow" class="right-button-image" src="<?=$g4['yui']?>/carousel/images/right-enabled.gif"/> </div>
<div class="carousel-clip-region">
<ul class="carousel-list">
<? for ($i=0; $i < count($list); $i++) {
$file_url = $g4[url].'/'.$list[$i][file][0][path] .'/'. $list[$i][file][0][file];
$file_url = urlencode($file_url);
// 아래 변수값중 h=120은 썸네일 이미지 height값, w는 width. w값을 수정하였을 경우 11라인의 스타일중 width값을 w값 + 10정도로 해주세요
$thumfile = "<img src=\"{$g4[path]}/phpthumb/phpThumb.php?src=$file_url&h=120&w=120\">";
?>
<li id="mycarousel-item-<?=$i?>"><a href="<?=$list[$i][href]?>"><?=$thumfile?></a>
<a href="<?=$list[$i][href]?>" style=" font-size:12px;"><?=$list[$i][subject]?>
<? if ($list[$i][comment_cnt])
echo "<span style='font-family:돋움; font-size:12px; color:#000000;'>{$list[$i][comment_cnt]}</span>";
?></a>
<br>
<font style="font-family:돋움; color:#666666; font-weight:bold; font-size:11px;"><?=$list[$i][wr_name]?></font></li>
<? } ?>
</ul>
</div>
</div>
</div>
----------------------------------------------------------------------------------------
<? if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$g4['yui'] = "/script/yui/build";
?>
<script type="text/javascript" src="<?=$g4['yui']?>/utilities/utilities.js"></script>
<script type="text/javascript" src="<?=$g4['yui']?>/container/container_core.js"></script>
<script type="text/javascript" src="<?=$g4['yui']?>/carousel/scripts/carousel.js"></script>
<link rel="stylesheet" type="text/css" href="<?=$g4['yui']?>/grids/grids.css">
<link rel="stylesheet" type="text/css" href="<?=$g4['yui']?>/fonts/fonts.css">
<link href="<?=$g4['yui']?>/carousel/css/carousel.css" rel="stylesheet" type="text/css">
<style type="text/css">
.carousel-component .carousel-list li {width:130px;margin-top:8px;} /* 이미지 width 설정*/
.carousel-component .carousel-list li a {display:block; border:2px solid #e2edfa;outline:none;-moz-outline:none; }
.carousel-component .carousel-list li a:hover {border: 2px solid #87bf4e;}
.carousel-component .carousel-list li.active a {border:2px solid #708fc7;}
.carousel-component .carousel-list li img {border:1px solid #999;display:block;}
.carousel-component .carousel-list li strong {display:block;}
.carousel-component .carousel-prev {position:absolute;top:40px;z-index:3;cursor:pointer;left:5px;}
.carousel-component .carousel-next {position:absolute;top:40px;z-index:3;cursor:pointer;right:5px;}
</style>
<script type="text/javascript">
var handlePrevButtonState = function(type, args) {
var enabling = args[0];
var leftImage = args[1];
if(enabling) {
leftImage.src = "<?=$g4['yui']?>/carousel/images/left-enabled.gif";
} else {
leftImage.src = "<?=$g4['yui']?>/carousel/images/left-disabled.gif";
}
};
var handleNextButtonState = function(type, args) {
var enabling = args[0];
var rightImage = args[1];
if(enabling) {
rightImage.src = "<?=$g4['yui']?>/carousel/images/right-enabled.gif";
} else {
rightImage.src = "<?=$g4['yui']?>/carousel/images/right-disabled.gif";
}
};
var pageLoad = function()
{
var carousel = new YAHOO.extension.Carousel("mycarousel",
{
//latest("carousel","photo",16,30);
//위와 같이 스킨을 삽입할때 최근글 뽑아올 수를 아래의 size값가 같게 해주세요.
numVisible: 4, //한화면에 출력될 이미지 갯수
animationSpeed: .50, //스크롤 속도
scrollInc: 4, //한번에 스크롤될 이미지 갯수
navMargin: 40, //네비게이션 버튼 마진
prevElement: "prev-arrow",
nextElement: "next-arrow",
size: 16, //이미지 갯수
prevButtonStateHandler: handlePrevButtonState,
nextButtonStateHandler: handleNextButtonState
}
);
};
YAHOO.util.Event.addListener(window, 'load', pageLoad);
</script>
<div id="mycarousel" class="carousel-component">
<div style=" text-align:center">
<div class="carousel-prev"> <img id="prev-arrow" class="left-button-image" src="<?=$g4['yui']?>/carousel/images/left-enabled.gif"/> </div>
<div class="carousel-next"> <img id="next-arrow" class="right-button-image" src="<?=$g4['yui']?>/carousel/images/right-enabled.gif"/> </div>
<div class="carousel-clip-region">
<ul class="carousel-list">
<? for ($i=0; $i < count($list); $i++) {
$file_url = $g4[url].'/'.$list[$i][file][0][path] .'/'. $list[$i][file][0][file];
$file_url = urlencode($file_url);
// 아래 변수값중 h=120은 썸네일 이미지 height값, w는 width. w값을 수정하였을 경우 11라인의 스타일중 width값을 w값 + 10정도로 해주세요
$thumfile = "<img src=\"{$g4[path]}/phpthumb/phpThumb.php?src=$file_url&h=120&w=120\">";
?>
<li id="mycarousel-item-<?=$i?>"><a href="<?=$list[$i][href]?>"><?=$thumfile?></a>
<a href="<?=$list[$i][href]?>" style=" font-size:12px;"><?=$list[$i][subject]?>
<? if ($list[$i][comment_cnt])
echo "<span style='font-family:돋움; font-size:12px; color:#000000;'>{$list[$i][comment_cnt]}</span>";
?></a>
<br>
<font style="font-family:돋움; color:#666666; font-weight:bold; font-size:11px;"><?=$list[$i][wr_name]?></font></li>
<? } ?>
</ul>
</div>
</div>
</div>
----------------------------------------------------------------------------------------