웹프로그래밍

Global It Leader!!


그누보드


 
 

롤링 텍스트 - 공지사항에 이용

페이지 정보

작성자 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 댓글 0건 조회 15,908회 작성일 10-04-28 23:18

본문

공지사항등에 이용하면 좋을듯 합니다.

미리보기는 역시 같은 소스로 제로보드와 연동한 페이지로 대신하며
테스트는 익스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="이전">&#60;</li>
            <li id="li03" onclick="rollText(1);" title="다음">&#62;</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>


댓글목록

등록된 댓글이 없습니다.

전체 59
게시물 검색
그누보드 목록
번호 제목 글쓴이 조회 날짜
19 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4291 01-30
18 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3711 08-20
17 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4053 06-24
16 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4193 03-27
15 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3988 03-26
14 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4087 03-20
13 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3628 03-13
12 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4070 02-25
11 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3759 02-21
10 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3964 01-31
9 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3914 11-29
8 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3945 11-15
7 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 16756 03-15
6 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 11830 05-11
5 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 7290 09-29
4 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9207 05-04
열람중 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 15909 04-28
2 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 7727 04-28
1 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 11053 04-28