뿅

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

· 2011-02-01 (화) 18:19:01 · 1377
[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;'>경매남은시간 : </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]
|
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

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

+
제목 글쓴이 날짜 조회
11-02-02 조회 1,264
11-02-02 조회 1,501
11-02-02 조회 1,995
11-02-02 조회 1,162
11-02-02 조회 1,718
11-02-02 조회 2,228
11-02-02 조회 1,674
11-02-02 조회 1,522
11-02-02 조회 1,607
11-02-02 조회 1,674
11-02-02 조회 1,295
11-02-02 조회 1,766
11-02-01 조회 1,730
11-02-01 조회 1,722
11-02-01 조회 1,563
11-02-01 조회 1,378
11-02-01 조회 2,609
11-02-01 조회 1,718
11-02-01 조회 1,877
11-02-01 조회 1,656