|
$sql = "select idx,title,wdate from board where board_name='notice' order by idx desc limit 0,4";
$result = mysql_query($sql);
$row = mysql_num_rows($result);
if ($row == 0) {
?>
no data |
} else {
for ($i=0;$i<$row;$i++) {
$idx = mysql_result($result,$i,'idx');
$title = han_substr(mysql_result($result,$i,'title'),16);
$wdate = substr(mysql_result($result,$i,'wdate'),0,10);
?>
|
|
}
}
?>
|
|
|
|
$sql = "select idx,title,wdate from board where board_name='qna' order by idx desc limit 0,4";
$result = mysql_query($sql);
$row = mysql_num_rows($result);
if ($row == 0) {
?>
no data |
} else {
for ($i=0;$i<$row;$i++) {
$idx = mysql_result($result,$i,'idx');
$title = han_substr(mysql_result($result,$i,'title'),16);
$wdate = substr(mysql_result($result,$i,'wdate'),0,10);
?>
|
|
}
}
?>
|
|
|
|
$sql_photo = "select idx,thumbimg,userid from board where board_name = 'photo' order by idx desc limit 0,2";
$result_photo = mysql_query($sql_photo);
$row_photo = mysql_num_rows($result_photo);
if ($row_photo == 0) {
?>
no data |
} else {
for ($i=0;$i<$row_photo;$i++) {
$photo_idx = mysql_result($result_photo,$i,'idx');
$photo_thumbimg = mysql_result($result_photo,$i,'thumbimg');
$photo_userid = mysql_result($result_photo,$i,'userid');
if ($photo_thumbimg <> "") {
if (strstr($photo_thumbimg,"/") == "") {
$photo_thumbimg = $photo_thumbimg;
} else {
$photo_thumbimg_tmp = split("/",$photo_thumbimg);
$photo_thumbimg = $photo_thumbimg_tmp[0] . "/" . $photo_thumbimg_tmp[1];
}
}
$photo_thumbimg_info = @GetImageSize("Spac_Editor/upload/__".$photo_userid."/".$photo_thumbimg);
$photo_thumbimg_width = $photo_thumbimg_info[0];
$photo_thumbimg_height = $photo_thumbimg_info[1];
if ($photo_thumbimg_width > 80 && $photo_thumbimg_height <= 80) {
$photo_thumbimg_height = $photo_thumbimg_height * (80 / $photo_thumbimg_width);
$photo_thumbimg_width = 80;
} else if ($photo_thumbimg_width <= 80 && $photo_thumbimg_height > 80) {
$photo_thumbimg_width = $photo_thumbimg_width * (80 / $photo_thumbimg_height);
$photo_thumbimg_height = 80;
} else if ($photo_thumbimg_width > 80 & $photo_thumbimg_height > 80) {
$photo_thumbimg_height = $photo_thumbimg_height * (80 / $photo_thumbimg_width);
$photo_thumbimg_width = 80;
if ($photo_thumbimg_height > 80) {
$photo_thumbimg_width = $photo_thumbimg_width * (80 / $photo_thumbimg_height);
$photo_thumbimg_height = 80;
}
}
?>
if ($photo_thumbimg <> "") { ?>
} else { ?>
} ?> |
if ((($i+1) % 4) == 0) {
echo " | ";
}
}
}
?>
|
|
|
|