|
|
$sql = "select * from ad_board where b_table='notice' order by b_idx desc limit 4";
$result = mysql_query($sql,$db);
$record = mysql_num_rows($result);
if($record=="0"){
?>
ÁغñÁßÀÔ´Ï´Ù!! |
}else{
$i=0;
while($rows=mysql_fetch_array($result)){
$idx=$rows[b_idx];
$subject=$rows[b_subject];
$count=$rows[b_count];
$date=$rows[b_date];
$date=substr($date,0,10);
$b_date=str_replace("-",".",$date);
// if (strlen($subject) > 28){ //Á¦¸ñÀÌ 50ÀÚÀÌ»óºÎÅÍ ....À¸·Î Ãâ·Â
// $subject = substr($subject,0,50)."...";
// }
$subject = cutstr($subject,40,"...");
$wdate=$rows[b_date];
$wdate=str_replace(" ","-",$wdate); //³¯Â¥Çü½ÄÀ» 2002-02-02-02-02-02À¸·Î º¯È¯
$wdate=str_replace(":","-",$wdate);
$ndate=explode("-",$wdate); //"-"¸¦ ±âÁØÀ¸·Î ¹è¿¿¡ ÀúÀå
$wsecond=mktime($ndate[3],$ndate[4],$ndate[5],$ndate[1],$ndate[2],$ndate[0]); //±Û¾´³¯Â¥¸¦ ÃÊ·Îȯ»ê
$tsecond=mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"));//ÇöÀç½Ã°£±îÁö¸¦ ÃʷΠȯ»ê
//ÇöÀç½Ã°£±îÁöÀÇ ÃÊ(second)¿¡¼ ±Û¾´ ³¯Â¥¸¦ ÃÊ()·Î º¯ÈÇÏ¿© ½Ã°£Â÷¸¦ ±¸ÇÔ
$datdiff=$tsecond-$wsecond;
$wdate=$ndate[0]."-".$ndate[1]."-".$ndate[2]; //±Û¾´³¯Â¥¸¸
$today=24*60*60; //ÇÏ·ç 24½Ã°£À» ÃʷΠȯ»ê
if ((int)$today > (int)$datdiff){ //±Û¾´³¯Â¥°¡ ÇÏ·ç°¡ Áö³ªÁö ¾ÊÀ¸¸é »õ·Î¿î±Û Ç¥½Ã
$new=" ";
}else{
$new="";
}
if ($i%2) {
$color4="#FFFFFF";
}else{
$color4="#FFFFFF";
}
$num = $record - ($listsize*($offset-1))-($i); //°¡»ó¹øÈ£·Î ¼øÂ÷ÀûÀÎ ¹øÈ£
?>
[= $b_date?>] = $subject?> |
$i=$i+1;
}
}
?>
|
|
|
|
|