롤링 텍스트 - 공지사항에 이용
페이지 정보
작성자 오원장쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 댓글 0건 조회 16,081회 작성일 10-04-28 23:18본문
공지사항등에 이용하면 좋을듯 합니다.
미리보기는 역시 같은 소스로 제로보드와 연동한 페이지로 대신하며
테스트는 익스6과 파폭 2버젼에서 했습니다
http://poshopzil.com/zb_test_bbs/roll_notice2.php
이하 소스입니다. 그럼 수고하세요~
미리보기는 역시 같은 소스로 제로보드와 연동한 페이지로 대신하며
테스트는 익스6과 파폭 2버젼에서 했습니다
http://poshopzil.com/zb_test_bbs/roll_notice2.php
이하 소스입니다. 그럼 수고하세요~
<?
// 본인에 맞게 수정하세요
$_gnu_url = "http://".$_SERVER['HTTP_HOST']."/gnuboard4";
$g4_path = $_SERVER['DOCUMENT_ROOT']."/gnuboard4";
include_once("$g4_path/common.php");
// 본인에 맞게 수정하세요
$aj_bdid = "test_bd1"; // 게시판 아이디
$aj_con = "7"; // 몇개를 뽑을래
$auc_result=mysql_query("select * from g4_write_$aj_bdid where wr_is_comment='0' and wr_option!='secret' order by wr_id desc limit $aj_con"); // 답변글이 아니고 비밀글이 아닌 것만
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">
<head>
<title>rollText</title>
<style type="text/css" media="all">
#rollD_r {position:relative; width:276px; height:25px; overflow:hidden; background-color:#f5f5f5;}
#rollD {clear:both; width:273px; height:22px; overflow:hidden; border:1px solid #e4e4e4; top:-2px; left:-2px;}
#rollD ul{list-style-type:none; padding:0; margin:0;}
#rollD ul li {background-color:#f8f8f8; float:left; height:22px; text-align:center; overflow:hidden; font-size:11px; font-family:'돋움'; color:#999; line-height:200%; border-right:1px solid #e4e4e4;}
#rollD ul li#li01 {background-color:#fff; width:200px; text-align:left; word-spacing:2px; letter-spacing:-1px;}
#rollD ul li#pageShow {width:30px;}
#rollD ul li#li02 {width:20px; cursor:pointer;}
#rollD ul li#li03 {width:20px; border-right:none; cursor:pointer;}
#rollD ul li a{color:#777; text-decoration:none;}
#rollD ul li a:hover{color:#39c; text-decoration:underline;}
#rollD ul li img{width:11px; height:11px; border:0; cursor:pointer; margin:5px auto 0 auto;}
#rollD ul li span{text-indent:3px;}
.dsBlock {display:block;}
.dsNone {display:none;}
</style>
</head>
<body>
<div id="rollD_r">
<div id="rollD">
<ul>
<li id="li01">
<?
$j = '1';
while($auc_data=mysql_fetch_array($auc_result)) {
$auc_no = $auc_data[wr_id];
$auc_data[wr_subject] = trim(strip_tags(stripslashes($auc_data[wr_subject])));
$auc_subject=cut_str($auc_data[wr_subject], 28, ''); // 제목 자르고
?>
<span id="rollTextMenu<?=$j?>" class="dsBlock">ㆍ<a href="<?=$g4[url]?>/<?=$g4[bbs]?>/board.php?bo_table=<?=$aj_bdid?>&wr_id=<?=$auc_no?>"><?=$auc_subject?></a></span>
<?
$j++;
}// end while
?>
</li>
<li id="pageShow">1/<?=$aj_con?></li>
<li id="li02" onclick="rollText(-1);" title="이전"><</li>
<li id="li03" onclick="rollText(1);" title="다음">></li>
</ul>
</div>
</div>
<script type="text/javascript" language="JavaScript">
//<![CDATA]
var rollText_k=<?=$aj_con?>; // total
var rollText_i=1; // start
var rollTime = 3000; // roll time
rollText_tt=setInterval("rollText(1)", rollTime);
function rollText(a){
clearInterval(rollText_tt);
rollText_tt=setInterval("rollText(1)", rollTime);
rollText_i+=a;
if (rollText_i>rollText_k){rollText_i=1;}
if (rollText_i==0){rollText_i=rollText_k;}
for (var j=1; j<=rollText_k; j++){
document.getElementById("rollTextMenu"+j).style.display="none";
}
document.getElementById("rollTextMenu"+rollText_i).style.display="block";
document.getElementById("pageShow").innerHTML = rollText_i+"/"+rollText_k;
}
//]]>
</script>
</body>
</html>
// 본인에 맞게 수정하세요
$_gnu_url = "http://".$_SERVER['HTTP_HOST']."/gnuboard4";
$g4_path = $_SERVER['DOCUMENT_ROOT']."/gnuboard4";
include_once("$g4_path/common.php");
// 본인에 맞게 수정하세요
$aj_bdid = "test_bd1"; // 게시판 아이디
$aj_con = "7"; // 몇개를 뽑을래
$auc_result=mysql_query("select * from g4_write_$aj_bdid where wr_is_comment='0' and wr_option!='secret' order by wr_id desc limit $aj_con"); // 답변글이 아니고 비밀글이 아닌 것만
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">
<head>
<title>rollText</title>
<style type="text/css" media="all">
#rollD_r {position:relative; width:276px; height:25px; overflow:hidden; background-color:#f5f5f5;}
#rollD {clear:both; width:273px; height:22px; overflow:hidden; border:1px solid #e4e4e4; top:-2px; left:-2px;}
#rollD ul{list-style-type:none; padding:0; margin:0;}
#rollD ul li {background-color:#f8f8f8; float:left; height:22px; text-align:center; overflow:hidden; font-size:11px; font-family:'돋움'; color:#999; line-height:200%; border-right:1px solid #e4e4e4;}
#rollD ul li#li01 {background-color:#fff; width:200px; text-align:left; word-spacing:2px; letter-spacing:-1px;}
#rollD ul li#pageShow {width:30px;}
#rollD ul li#li02 {width:20px; cursor:pointer;}
#rollD ul li#li03 {width:20px; border-right:none; cursor:pointer;}
#rollD ul li a{color:#777; text-decoration:none;}
#rollD ul li a:hover{color:#39c; text-decoration:underline;}
#rollD ul li img{width:11px; height:11px; border:0; cursor:pointer; margin:5px auto 0 auto;}
#rollD ul li span{text-indent:3px;}
.dsBlock {display:block;}
.dsNone {display:none;}
</style>
</head>
<body>
<div id="rollD_r">
<div id="rollD">
<ul>
<li id="li01">
<?
$j = '1';
while($auc_data=mysql_fetch_array($auc_result)) {
$auc_no = $auc_data[wr_id];
$auc_data[wr_subject] = trim(strip_tags(stripslashes($auc_data[wr_subject])));
$auc_subject=cut_str($auc_data[wr_subject], 28, ''); // 제목 자르고
?>
<span id="rollTextMenu<?=$j?>" class="dsBlock">ㆍ<a href="<?=$g4[url]?>/<?=$g4[bbs]?>/board.php?bo_table=<?=$aj_bdid?>&wr_id=<?=$auc_no?>"><?=$auc_subject?></a></span>
<?
$j++;
}// end while
?>
</li>
<li id="pageShow">1/<?=$aj_con?></li>
<li id="li02" onclick="rollText(-1);" title="이전"><</li>
<li id="li03" onclick="rollText(1);" title="다음">></li>
</ul>
</div>
</div>
<script type="text/javascript" language="JavaScript">
//<![CDATA]
var rollText_k=<?=$aj_con?>; // total
var rollText_i=1; // start
var rollTime = 3000; // roll time
rollText_tt=setInterval("rollText(1)", rollTime);
function rollText(a){
clearInterval(rollText_tt);
rollText_tt=setInterval("rollText(1)", rollTime);
rollText_i+=a;
if (rollText_i>rollText_k){rollText_i=1;}
if (rollText_i==0){rollText_i=rollText_k;}
for (var j=1; j<=rollText_k; j++){
document.getElementById("rollTextMenu"+j).style.display="none";
}
document.getElementById("rollTextMenu"+rollText_i).style.display="block";
document.getElementById("pageShow").innerHTML = rollText_i+"/"+rollText_k;
}
//]]>
</script>
</body>
</html>
관련링크
댓글목록
등록된 댓글이 없습니다.