// ÀÛ¼ºÀÚ : ÃÖ»ó¹Î
// ¼öÁ¤ÀÏ : 2002³â 2¿ù 17ÀÏ
// ÆÄÀϸí : boardList.html
// °Ô½ÃÆÇ ¸®½ºÆ®
include ("../inc/header.html"); // Çì´õ
include ("../common/dbConnect.php"); // Ä¿³Ø¼Ç Æ÷ÇÔ
include("../common/pageSkip.php"); // ÆäÀÌÁö ½ºÅµ°ü·Ã Æ÷ÇÔ
include("../common/common.php"); // °øÅëÇÔ¼ö Æ÷ÇÔ
echo "";
// °Ô½ÃÆÇ°ªÀÌ ¾øÀ»°æ¿ì ±âº»°Ô½ÃÆÇÀ» °¡Á®¿Â´Ù. ±×°Íµµ ¾øÀ½..¿¡·¯Áö ¸ð
if($boardID == "")
$boardID = "freeboard";
// ±âº» º¯¼ö
if(!$page) { $page = 1; } // ÇöÀç ÆäÀÌÁö
$maxLine = 8; // ÆäÀÌÁö´ç °Ô½Ã¹°¼ö
// ÆÄÀÏŸÀÔ Ã¼Å©
function getFileType($imageName) {
$split = explode(".", $imageName);
switch($split[count($split)-1]) {
case "JPG":
case "jpg":
case "JPEG":
case "jpeg":
return "jpg";
break;
case "GIF":
case "gif":
return "gif";
break;
default:
return false;
}
}
// ½æ³×ÀÏ »ý¼º
function createThumnail($imageName) {
global $boardID;
if(file_exists("../tmp/thum_${imageName}"))
return "../tmp/thum_${imageName}";
$fileType = getFileType($imageName);
if(!$fileType)
return;
if($fileType == "jpg")
@$src = ImageCreateFromJpeg("../board/${boardID}_data/$imageName");
else if($fileType == "gif")
@$src = ImageCreateFromGif("../board/${boardID}_data/$imageName");
if(!$src)
return;
$thum = imageCreate(120, 120);
ImageCopyResized($thum, $src, 0, 0, 0, 0, 120, 120, imageSX($src), imageSY($src));
if($fileType == "jpg")
ImageJpeg($thum, "../tmp/thum_${imageName}", 80);
else if($fileType == "gif")
ImageGif($thum, "../tmp/thum_${imageName}", 80);
// ÆÛ¹Ì¼Ç º¯°æ
chmod("../tmp/thum_${imageName}", 0777);
ImageDestroy($src);
ImageDestroy($thum);
return "thum_${imageName}";
}
function getPageNum() {
global $conn, $info, $maxLine, $start, $page, $findType, $findWord, $boardID, $pageSkip, $maxLine;
if($findWord == "" || $findType == "")
$totalCount = countRows($boardID);
else {
$query = "select count(no) from $boardID where $findType like '%$findWord%' ";
$result = $conn->runQuery($query);
$totalCount = mysql_result($result,0,0);
}
$start = ($page == 1)?0:($page-1)*$maxLine; // ½ÃÀÛ Row
$pageSkip = new pageSkip("./photoList.html?boardID=$boardID&page=", $totalCount, $maxLine, 10);
}
// ¸®½ºÆ® ÃßÃâ
function getList($page) {
global $conn, $boardID, $start, $maxLine, $findType, $findWord, $totalCount, $info, $limitWord, $maxLine;
$query = "select b.no, sortNo, writer, subject, writeDate, attachName, count(c.cNo) as count from $boardID b LEFT OUTER JOIN bComment c ON b.no=c.no and c.boardId='$boardID' group by b.no order by sortNo desc limit $start, $maxLine";
$result = $conn->runQuery($query);
echo "
";
$trCount = 0;
if (mysql_num_rows($result) > 0) {
while($rows = mysql_fetch_array($result)) {
if($trCount%4 == 0)
echo "
";
echo "";
$trCount++;
$rows[subject] = strSplit($rows[subject], 10, "...");
// $rows[subject] .= ($rows[count] > 0 && $info->getLimitComment() == "Y")?" [".$rows[count]."]":"";
printList($rows[no], $rows[sortNo], $rows[writer], $rows[subject], $rows[writeDate], $rows[attachName]);
echo " | ";
}
echo "
";
}
else {
echo "¾÷·ÎµåµÈ »çÁøÀÌ ¾ø½À´Ï´Ù. |
";
}
}
// °ªÀ» ȸ鿡 Ãâ·Â
function printList($no, $sortNo, $writer, $subject, $writeDate, $attachName) {
global $boardID, $page, $info, $findWord, $findType;
if(dateCheck($writeDate, 1))
$subject = "
".$subject;
if($readLock == "Y")
$subject = "
".$subject;
// º»¹® Ãâ·Â
echo "
$subject |
";
// ½æ³×ÀÏ À̹ÌÁö -------------------------------> GD ¶óÀ̺귯¸®°¡ ¼³Ä¡µÇ¾î ÀÖ´Â °æ¿ì
// echo "
// .") |
";
// ½æ³×ÀÏ À̹ÌÁö -------------------------------> GD ¶óÀ̺귯¸®°¡ ¼³Ä¡µÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì
echo "
 |
";
}
// Å×À̺í Ãâ·Â
function printTable() {
global $info, $width, $align, $pageSkip, $page, $boardID, $totalCount, $maxLine, $pageSkip;
// Àüü °Ô½Ã¹° °è»ê
getPageNum();
echo "";
}
printTable();
include ("../inc/footer.html"); // ǪÅÍ
?>