배너클릭시 해당 사이트로 이동하게 하기
아래 최신글슬라이드를 이용해서 배너최신글로 사용하려 하는데요.
어떻게 하면 ,배너를 클릭하면 해당 사이트로 이동하게 할수있는지요? 현재는 배너를 클릭하면 게시물로 이동이 됩니다.
아래 스킨 소스입니다.
*************************
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$latest_skin_path/skin.lib.php");
$img_width = 175; // 이미지 가로 사이즈
$img_height = 50; // 이미지 세로 사이즈
$frame_width = 780; // 가로길이
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/latest_thumb';
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<!--최신글, 이미지, 내용 시작-->
<!--<script type="text/javascript" src="<?=$latest_skin_path?>/js/jquery-1.4.4.min.js"></script>-->
<script type="text/javascript" src="<?=$latest_skin_path?>/js/jquery.imageScroller.js"></script>
<style type="text/css">
/*스크롤러 스타일*/
div#scroller {background:none; position:relative;height:130px; width:<?=$frame_width?>; padding:0 10px;margin:0;clear:both;overflow:hidden;border:1px #b9c695 solid}
/*좌우버튼*/
div.button {height:30px;}
#btn1, #btn2 {cursor:pointer}
ul#scrollerFrame {width:780px; padding:0;margin:0;list-style:none;}
ul#scrollerFrame li {position:relative;float:left; padding:0px 15px 0px 0px; margin:0 10 0 10px;width:175px;height:130px;}
ul#scrollerFrame li a { color:#666666; font-size:13px; }
ul#scrollerFrame li a:hover {color:#ea6f0b; }
ul#scrollerFrame li img {padding:4px; background:#ffffff; border:1px #b9c695 solid; }
ul#scrollerFrame li img:hover {padding:4px; background:#ffffff; border:1px #ea6f0b solid; }
</style>
<script type="text/javascript">
$(function(){
$("#scroller").imageScroller({
next:"btn1", //다음 버튼 ID값
prev:"btn2", //이전 버튼 ID값
frame:"scrollerFrame", //스크롤러 프레임 ID값
width:175, //이미지 가로 크기
child:"li", //스크롤 지정 태그
auto:true //오토 롤링 (해제는 false)
});
});
</script>
<div id="scroller">
<div class="button">
<a href="board/bbs/board.php?bo_table=banner"><span style="float:left;margin:5px 0 0 0;font-size:13px;font-weight:bold;color:#000000;">링크모음</span></a>
<span id="btn2" style="float:right;margin:5px 0 0 0;"><img src="<?=$latest_skin_path?>/img/next.gif"></span>
<span id="btn1" style="float:right;margin:5px 5px 0 0;"><img src="<?=$latest_skin_path?>/img/prev.gif"></span>
</div>
<ul id="scrollerFrame">
<? for ($i=0; $i<count($list); $i++) { ?>
<li>
<?
if($list[$i][file][0][view]){
$src = $list[$i][file][0][path]."/".$list[$i][file][0][file];
$get_img = getimagesize($src); // 파일정보를 가져옴
// 관리자가 이미지 사이즈를 바꾸었을때를 대비하여 리사이징 크기를 이름에 포함과 이미지 재 첨부시 바뀜
$img_step1 = explode("_",$list[$i][file][0][file]);
$img_step2 = explode(".",$img_step1[1]);
$new_imgname = $img_step2[0];
$thumb_file_list = "{$thumb_path}/{$re_img_width}x{$re_img_height}_{$new_imgname}_{$list[$i][wr_id]}_list";
if(!file_exists($thumb_file_list)){
// gd lib 체크
$gd = gd_info();
$gdversion = substr(preg_replace("/[^0-9]/", "", $gd['GD Version']), 0, 2); // gd 버전이 2.0 이상인지 체크
if(!$gdversion){
$thumb_file_view = $src; // gd 2.0 이하면 강제적으로 줄임
}else{
if($img_width > $get_img[0] || $img_height > $get_img[1]){
$thumb_file_list = $src;
}else{
createThumb_list($img_width,$img_height,$src, $thumb_file_list, $get_img); // list 페이지 썸네일
}
}
}
echo '<div align="center">';
$img = "<a href='{$list[$i]['href']}'><img src=\"$thumb_file_list\" border=\"0\" width=\"$img_width\" height=\"$img_height\"/><br/><span>{$list[$i]['subject']}</span></a>";
}else{
// no 이미지를 비율적으로 만들어났음
$img = "<a class=price' href='{$list[$i]['href']}'><img src=\"$latest_skin_path/img/no_image.gif\" border=\"0\" height=\"{$img_height}\" width=\"{$img_width}\"/><BR><span style=\"font-size:9pt;\"><font face=\"돋움\" color=\"#333333\">{$list[$i]['subject']}</span>*/</a>";
}
echo $img;
echo '</div>';
?>
</li>
<? } ?>
</ul>
</div>
**************************
잘 부탁드립니다.
질문이 많아서....ㅠ ㅠ
어떻게 하면 ,배너를 클릭하면 해당 사이트로 이동하게 할수있는지요? 현재는 배너를 클릭하면 게시물로 이동이 됩니다.
아래 스킨 소스입니다.
*************************
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$latest_skin_path/skin.lib.php");
$img_width = 175; // 이미지 가로 사이즈
$img_height = 50; // 이미지 세로 사이즈
$frame_width = 780; // 가로길이
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/latest_thumb';
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<!--최신글, 이미지, 내용 시작-->
<!--<script type="text/javascript" src="<?=$latest_skin_path?>/js/jquery-1.4.4.min.js"></script>-->
<script type="text/javascript" src="<?=$latest_skin_path?>/js/jquery.imageScroller.js"></script>
<style type="text/css">
/*스크롤러 스타일*/
div#scroller {background:none; position:relative;height:130px; width:<?=$frame_width?>; padding:0 10px;margin:0;clear:both;overflow:hidden;border:1px #b9c695 solid}
/*좌우버튼*/
div.button {height:30px;}
#btn1, #btn2 {cursor:pointer}
ul#scrollerFrame {width:780px; padding:0;margin:0;list-style:none;}
ul#scrollerFrame li {position:relative;float:left; padding:0px 15px 0px 0px; margin:0 10 0 10px;width:175px;height:130px;}
ul#scrollerFrame li a { color:#666666; font-size:13px; }
ul#scrollerFrame li a:hover {color:#ea6f0b; }
ul#scrollerFrame li img {padding:4px; background:#ffffff; border:1px #b9c695 solid; }
ul#scrollerFrame li img:hover {padding:4px; background:#ffffff; border:1px #ea6f0b solid; }
</style>
<script type="text/javascript">
$(function(){
$("#scroller").imageScroller({
next:"btn1", //다음 버튼 ID값
prev:"btn2", //이전 버튼 ID값
frame:"scrollerFrame", //스크롤러 프레임 ID값
width:175, //이미지 가로 크기
child:"li", //스크롤 지정 태그
auto:true //오토 롤링 (해제는 false)
});
});
</script>
<div id="scroller">
<div class="button">
<a href="board/bbs/board.php?bo_table=banner"><span style="float:left;margin:5px 0 0 0;font-size:13px;font-weight:bold;color:#000000;">링크모음</span></a>
<span id="btn2" style="float:right;margin:5px 0 0 0;"><img src="<?=$latest_skin_path?>/img/next.gif"></span>
<span id="btn1" style="float:right;margin:5px 5px 0 0;"><img src="<?=$latest_skin_path?>/img/prev.gif"></span>
</div>
<ul id="scrollerFrame">
<? for ($i=0; $i<count($list); $i++) { ?>
<li>
<?
if($list[$i][file][0][view]){
$src = $list[$i][file][0][path]."/".$list[$i][file][0][file];
$get_img = getimagesize($src); // 파일정보를 가져옴
// 관리자가 이미지 사이즈를 바꾸었을때를 대비하여 리사이징 크기를 이름에 포함과 이미지 재 첨부시 바뀜
$img_step1 = explode("_",$list[$i][file][0][file]);
$img_step2 = explode(".",$img_step1[1]);
$new_imgname = $img_step2[0];
$thumb_file_list = "{$thumb_path}/{$re_img_width}x{$re_img_height}_{$new_imgname}_{$list[$i][wr_id]}_list";
if(!file_exists($thumb_file_list)){
// gd lib 체크
$gd = gd_info();
$gdversion = substr(preg_replace("/[^0-9]/", "", $gd['GD Version']), 0, 2); // gd 버전이 2.0 이상인지 체크
if(!$gdversion){
$thumb_file_view = $src; // gd 2.0 이하면 강제적으로 줄임
}else{
if($img_width > $get_img[0] || $img_height > $get_img[1]){
$thumb_file_list = $src;
}else{
createThumb_list($img_width,$img_height,$src, $thumb_file_list, $get_img); // list 페이지 썸네일
}
}
}
echo '<div align="center">';
$img = "<a href='{$list[$i]['href']}'><img src=\"$thumb_file_list\" border=\"0\" width=\"$img_width\" height=\"$img_height\"/><br/><span>{$list[$i]['subject']}</span></a>";
}else{
// no 이미지를 비율적으로 만들어났음
$img = "<a class=price' href='{$list[$i]['href']}'><img src=\"$latest_skin_path/img/no_image.gif\" border=\"0\" height=\"{$img_height}\" width=\"{$img_width}\"/><BR><span style=\"font-size:9pt;\"><font face=\"돋움\" color=\"#333333\">{$list[$i]['subject']}</span>*/</a>";
}
echo $img;
echo '</div>';
?>
</li>
<? } ?>
</ul>
</div>
**************************
잘 부탁드립니다.
질문이 많아서....ㅠ ㅠ
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기
댓글 3개
이부분에서
$list[$i]['href']이것을
$list[$i][wr_link1]이런식으로 변경하시면됩니다.
target='_new' 해주셔야 새창으로 창뜨구요~
대단히 고맙습니다.ㅎㅎ,자알 됩니다.!!!
이걸 어떻게 말로만 인사를 해서는 알될것 같은데요.ㅎ
보쌈 하나 드릴가요?ㅎㅎ
정말로 감사합니다.^^
보쌈주신다면 거부는안하겠습니다 ㅋㅋ