관리자님이 올리신 포인트 경매 소스중 정보
관리자님이 올리신 포인트 경매 소스중본문
[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]
<?
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]
댓글 전체