|
<?
##### ¼³Á¤ ÆÄÀÏ ¿¬°á #####
include "technology/config.inc";
##### µ¥ÀÌÅͺ£À̽º ¿¬°á #####
include "technology/dbconn.inc";
##### ÆÄÀÏÀÌ ÀúÀåµÉ µð·ºÅ丮 ¿¬°á #####
$savedir = "admin/technology/data";
##### °¶·¯¸® ¶ç¿ì±â #####
$query = "select uid,userfile1,subject,contents from $db order by uid desc limit 2";
$result= mysql_query($query,$dbconn);
if (!$result) {
echo ("
<script>
window.alert('Äõ¸® ¿¡·¯ÀÔ´Ï´Ù.')
history.go(-1);
</script>
");
}
while($row = mysql_fetch_row($result)) {
$uid=$row[0];
$userfile=$row[1];
$subject=$row[2];
$contents=$row[3];
##### ³»¿ë ±ÛÀÚ¼ö ÀÚ¸£±â #####
$max = 218;
$count = strlen($contents);
if($count >= $max) {
for ($pos=$max;$pos>0 && ord($contents[$pos-1])>=127;$pos--);
if (($max-$pos)%2 == 0)
$contents = sprintf("%s...", substr($contents, 0, $max));
else
$contents = sprintf("%s...", substr($contents, 0, $max+1));
}
else {
$contents = "$contents";
}
##### À̹ÌÁö Å©±â ÁÙÀ̱â #####
define("__LIMIT_WIDTH__", 245);
define("__LIMIT_HEIGHT__", 151);
##### À̹ÌÁö Å©±â±¸ÇÔ #####
$size = GetImageSize($savedir. "/" ."$userfile");
##### Width ±æÀ̰¡ Ŭ °æ¿ì #####
if (__LIMIT_WIDTH__ < $size[0]) {
$height = (int)(($size[1] / $size[0] ) * __LIMIT_WIDTH__);
$width = __LIMIT_WIDTH__;
}
##### Height ±æÀ̰¡ Ŭ °æ¿ì #####
else if (__LIMIT_HEIGHT__ < $size[1]) {
$width = (int)(($size[0] / $size[1]) * __LIMIT_HEIGHT__);
$height = __LIMIT_HEIGHT__;
}
##### À̹ÌÁö Å©±â°¡ ¸ÂÀ» °æ¿ì #####
else {
$width = $size[0];
$height = $size[1];
}
echo("
<td width='245' valign='top'>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='245' style='border:1px #9EABBC solid; border-collapse:collapse;'><a href='technology/viewbody.php?db=$db&number=$uid' onfocus='this.blur();'><img src='admin/technology/data/$userfile' width='245' height='151'></a></td>
</tr>
<tr>
<td height='12'></td>
</tr>
<tr>
<td height='40' class='new_title' valign='top'>$subject</td>
</tr>
<tr>
<td valign='top'>$contents</td>
</tr>
<tr>
<td height='10'></td>
</tr>
<tr>
<td align='right'><a href='technology/viewbody.php?db=$db&number=$uid' onfocus='this.blur();'><img src='image/icon_more.gif'></a></td>
</tr>
</table>
</td>
<td width='60'></td>
" );
}
?>
±â¼úÀÚ·á 2°³¸¦ ¸ÞÀÎÀ¸·Î ´ó±â´Â °Çµ¥...
ù¹øÂ° ´ó±â´Â °Å´Â <td width='60'></td> ÀÌ°Ô ºÙ¾î¾ß Çϰí
µÎ¹øÂ° ´ó±â´Â °Å´Â ºÙÁö ¾Ê¾Æ¾ß Çϴµ¥ ¾î¶»°Ô 󸮸¦ ÇØ¾ßÇÒÁö ¸ð¸£°Ú¾î¿ä.
<?
##### ¼³Á¤ ÆÄÀÏ ¿¬°á #####
include "technology/config.inc";
##### µ¥ÀÌÅͺ£À̽º ¿¬°á #####
include "technology/dbconn.inc";
##### ÆÄÀÏÀÌ ÀúÀåµÉ µð·ºÅ丮 ¿¬°á #####
$savedir = "admin/technology/data";
##### °¶·¯¸® ¶ç¿ì±â #####
$query = "select uid,userfile1,subject,contents from $db order by uid desc limit 2";
$result= mysql_query($query,$dbconn);
if (!$result) {
echo ("
<script>
window.alert('Äõ¸® ¿¡·¯ÀÔ´Ï´Ù.')
history.go(-1);
</script>
");
}
while($row = mysql_fetch_row($result)) {
$uid=$row[0];
$userfile=$row[1];
$subject=$row[2];
$contents=$row[3];
##### ³»¿ë ±ÛÀÚ¼ö ÀÚ¸£±â #####
$max = 218;
$count = strlen($contents);
if($count >= $max) {
for ($pos=$max;$pos>0 && ord($contents[$pos-1])>=127;$pos--);
if (($max-$pos)%2 == 0)
$contents = sprintf("%s...", substr($contents, 0, $max));
else
$contents = sprintf("%s...", substr($contents, 0, $max+1));
}
else {
$contents = "$contents";
}
##### À̹ÌÁö Å©±â ÁÙÀ̱â #####
define("__LIMIT_WIDTH__", 245);
define("__LIMIT_HEIGHT__", 151);
##### À̹ÌÁö Å©±â±¸ÇÔ #####
$size = GetImageSize($savedir. "/" ."$userfile");
##### Width ±æÀ̰¡ Ŭ °æ¿ì #####
if (__LIMIT_WIDTH__ < $size[0]) {
$height = (int)(($size[1] / $size[0] ) * __LIMIT_WIDTH__);
$width = __LIMIT_WIDTH__;
}
##### Height ±æÀ̰¡ Ŭ °æ¿ì #####
else if (__LIMIT_HEIGHT__ < $size[1]) {
$width = (int)(($size[0] / $size[1]) * __LIMIT_HEIGHT__);
$height = __LIMIT_HEIGHT__;
}
##### À̹ÌÁö Å©±â°¡ ¸ÂÀ» °æ¿ì #####
else {
$width = $size[0];
$height = $size[1];
}
echo("
<td width='245' valign='top'>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='245' style='border:1px #9EABBC solid; border-collapse:collapse;'><a href='technology/viewbody.php?db=$db&number=$uid' onfocus='this.blur();'><img src='admin/technology/data/$userfile' width='245' height='151'></a></td>
</tr>
<tr>
<td height='12'></td>
</tr>
<tr>
<td height='40' class='new_title' valign='top'>$subject</td>
</tr>
<tr>
<td valign='top'>$contents</td>
</tr>
<tr>
<td height='10'></td>
</tr>
<tr>
<td align='right'><a href='technology/viewbody.php?db=$db&number=$uid' onfocus='this.blur();'><img src='image/icon_more.gif'></a></td>
</tr>
</table>
</td>
<td width='60'></td>
" );
}
?>
±â¼úÀÚ·á 2°³¸¦ ¸ÞÀÎÀ¸·Î ´ó±â´Â °Çµ¥...
ù¹øÂ° ´ó±â´Â °Å´Â <td width='60'></td> ÀÌ°Ô ºÙ¾î¾ß Çϰí
µÎ¹øÂ° ´ó±â´Â °Å´Â ºÙÁö ¾Ê¾Æ¾ß Çϴµ¥ ¾î¶»°Ô 󸮸¦ ÇØ¾ßÇÒÁö ¸ð¸£°Ú¾î¿ä.
|