관리자님이 올리신 포인트 경매 소스중 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

관리자님이 올리신 포인트 경매 소스중 정보

관리자님이 올리신 포인트 경매 소스중

본문

[code]
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$dotted_color = array("red", "green", "blue");
$dcolor = $dotted_color[rand(0, count($dotted_color)-1)];
?>
<br>
<table width=100% align=center cellpadding=5 style='border:2px dotted <?=$dcolor?>;'>
<tr>
<td align='center' style="padding:10px 0 10px 10px;">
    <h3 style='float:left; margin-bottom:10px;'><a href="<?=$g4[bbs_path]?>/board.php?bo_table=auction">♡ 포인트 경매</a></h3>

<?
$sql = " select * from g4_write_auction where '$g4[time_ymdhis]' < wr_2 order by wr_2 asc ";
$result = sql_query($sql, true);
for ($i=0; $row=sql_fetch_array($result); $i++) {
    $style = "";
    if (strtotime($row[wr_2]) < $g4[server_time] + (3600 * 6)) {
        $style = "color:crimson;";
    }

    $color = $acolor[rand(0, count($acolor)-1)];
    $num = $i + 1;

    $subject = explode("|", $row[wr_subject]);
    echo "<div style='font-size:12px; padding:2 0 2 0; clear:both; cursor:pointer; text-decoration:normal; text-align:left; $style' onclick=\"document.location='/bbs/board.php?bo_table=auction&wr_id=$row[wr_id]'\">\n";
        echo "<div style='float:left; color:blue; font-family:Gulim;'>경매남은시간 :&nbsp;</div>";
        echo "<div style='border-bottom:1px solid #ccc; padding-bottom:5px; margin-bottom:5px;'>";
        echo "<span style='font-weight:normal; color:#556677; font-family:Gulim;'>$num. $subject[1]</span> <span style='color:#ff6600; font:10px tahoma;'>(".number_format($row[wr_7]).")</span>";
        echo "<span id='time{$i}' style='color:green; font-family:Dotum; font-size:12px; margin-left:10px;'></span>";
        echo "</div>";
    echo "</div>\n";

    $time = "t{$i}";
    $end_time = strtotime($row[wr_2])-$g4[server_time];

    echo "<script>";
    echo "var $time = new Timer(); ";
    echo "$time.id = 'time$i'; ";
    echo "$time.end_time = $end_time; ";
    echo "$time.run(); ";
    echo "$time.tid = setInterval(\"$time.run()\", 1000); ";
    echo "</script>\n";
}
if ($i==0) echo "<div align='center'>현재 진행중인 포인트 경매가 없습니다.</div>";
?>

</td>
</tr>
</table>
<br><br>

<script type="text/javascript">
function Timer() {
    this.end_time = null;
    this.id = null;
    this.tid = null;
    this.run = function() {
        //alert(this.xxx);
        var timer = document.getElementById(this.id);

        dd = Math.floor(this.end_time/(60*60*24));
        hh = Math.floor((this.end_time%(60*60*24))/(60*60));
        mm = Math.floor(((this.end_time%(60*60*24))%(60*60))/60);
        ii = Math.floor((((this.end_time%(60*60*24))%(60*60))%60));

        var str = "";

        if (dd > 0) str += dd + "일 ";
        if (hh > 0) str += hh + "시간 ";
        if (mm > 0) str += mm + "분 ";
        str += ii + "초 ";

        timer.innerHTML = str;

        this.end_time--;

        if (this.end_time < 0) clearInterval(this.tid);
    }
}
</script>

위 소스중 경매남은시간 주석풀었는데, 경매남은시간만 출력되고 시간초가 안뜨네요.

뭐가 문제일까요 고수님들의 답변 기달리겠습니다.
[/code]

댓글 전체

전체 66,558 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT