0) echo "
".attachCheck($attachType)." $attachName ($attachSize byte)
"; } // Åä´Þ±â üũ function bComment() { global $info, $conn, $boardID, $no, $cWriter, $cContent, $memberName, $width; if ($info->getLimitComment() == "Y") { $query = "select cNo, cWriter, cContent, cWriteDate from bComment where boardId='$boardID' and no=$no order by cWriteDate"; $result = $conn->runQuery($query); while($rows = mysql_fetch_array($result)) { echo "
 ¢É $rows[cWriter] $rows[cContent] ".substr($rows[cWriteDate],0,10)." »èÁ¦
"; } if($info->getLimitWrite() != "N" && !memberCheck()) return; $commentSize = floor($width / 15); echo "
 À̸§     ¾ÏÈ£
"; } } // Åä´Þ±â function writeComment() { global $comment, $cWriter, $cContent, $cPassword, $no, $boardID, $conn, $findType, $findWord, $page, $info, $memberID; // Åä´Þ±â À϶§¿¡´Â Á¶È¸¼ö¸¦ ¾÷µ¥ÀÌÆ® ÇÏÁö ¾Ê´Â´Ù. if ($comment == "Y") { if($info->getLimitWrite() != "N" && !memberCheck()) alert("·Î±×ÀÎÀ» ÇÏ¼Å¾ß Åä´Þ¼ö ÀÖ½À´Ï´Ù.", 2); if($cWriter == "") alert("Åä´Þ±â ÀÛ¼ºÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä", 1); else if($cContent == "") alert("Åä´Þ±â ³»¿ëÀ» ÀÔ·ÂÇϼ¼¿ä", 1); else if($cPassword == "") alert("Åä´Þ±â ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇϼ¼¿ä", 1); else { $cPassword= md5($cPassword); $query = "insert into bComment values ('', '$boardID', $no, '$cWriter', '$cPassword', '$cContent', now())"; $conn->runQuery($query); $cWriter = ""; $cContent = ""; echo ""; exit(); } } else { // Á¶È¸¼ö ¾÷µ¥ÀÌÆ® updateCount(); } } // Å×À̺í function printTable() { global $no, $boardID, $width, $align, $conn, $info, $page, $attachName, $attachSize, $findWord, $findType, $memberID, $memberLevel, $secret, $attachType, $info; $query = "select * from $boardID where no=$no"; $result = $conn->runQuery($query); $rows = mysql_fetch_array($result); $subject = $rows[subject]; $content = $rows[content]; $writer = $rows[writer]; $readCount = $rows[readCount]; $email = $rows[email]; $homepage = $rows[homepage]; $writeDate = $rows[writeDate]; $enableHtml = $rows[enableHtml]; $attachName = $rows[attachName]; $attachSize = $rows[attachSize]; $attachType = $rows[attachType]; $readLock = $rows[readLock]; $readLock2 = "Y"; $mID = $rows[mId]; $rootNo = $rows[rootNo]; // Á¦¸ñÀº HTML ¹«Á¶°Ç ¸øÇÔ $subject = htmlspecialchars($subject); $subject = stripslashes($subject); // ³»¿ë ½ºÅ©¸³Æ® üũ $content = str_replace("", $content); $content = stripslashes($content); if($secret != "") { // ÆÐ½º¿öµå ºñ±³ $secret =md5($secret); $query = "select count(no) from $boardID where no=$no and password='$secret'"; $count = mysql_result($conn->runQuery($query), 0, 0); if($count == 0) alert("ÆÐ½º¿öµå°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.", 1); else $readLock2 = "N"; } switch($info->getLimitRead()) { case "A": case "M": if($mID != $memberID && $readLock == "Y") { alert("Àá°ÜÁø ±ÛÀÔ´Ï´Ù. ÀÛ¼ºÀÚ¿Í °ü¸®ÀÚ¿Ü¿¡´Â º¼ ¼ö ¾ø½À´Ï´Ù.", 2); } break; case "N": if($info->getLimitWrite() != "N" && $readLock == "Y") { if($mID != $memberID && !adminCheck($memberID)) alert("Àá°ÜÁø ±ÛÀÔ´Ï´Ù. ÀÛ¼ºÀÚ¿Í °ü¸®ÀÚ¿Ü¿¡´Â º¼ ¼ö ¾ø½À´Ï´Ù.", 2); } else if ($readLock == "Y" && $readLock2 == "Y") { echo "
¡Ý ". $info->getBoardName() ."
¾Ñ! Àá°ÜÁø ±ÛÀ̳׿ä. °Ô½Ã¹°ÀÇ ¾ÏÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.

"; return; break; } } // Åä´Þ±â ½ÇÇà writeComment(); echo "
¡Ý ". $info->getBoardName() ."
$subject
$writer (".substr($writeDate,0,10).")"; // À̸ÞÀÏ Ã¼Å© if ($email != "") echo " "; // ȨÆäÀÌÁö üũ if ($homepage != "") echo " "; echo"
"; switch($attachType) { case "image/pjpeg": case "image/gif": echo ""; break; case "application/x-shockw": echo ""; break; } echo "
$content
"; // ÷ºÎÆÄÀÏ Ã¼Å© attachFile(); // Åä´Þ±â üũ if ($readLock != "Y") bComment(); echo "

"; // °ü·Ã°Ô½Ã¹° Ãâ·Â relatedList($no, $rootNo); } function relatedList($no, $rootNo) { global $boardID, $conn, $align, $width, $info, $limitWord; $query = "select b.no, sortNo, writer, email, subject, writeDate, readCount, replyNo, readLock, attachType, count(c.cNo) as count from $boardID b LEFT OUTER JOIN bComment c ON b.no=c.no and c.boardId='$boardID' where b.no=$no or b.rootNo=$no "; if($rootNo != 0) $query .= "or b.no=$rootNo or rootNo=$rootNo "; $query .= "group by b.no order by sortNo desc "; $result = $conn->runQuery($query); $space = ""; echo "
"; while($rows = mysql_fetch_array($result)) { for($i=0 ; $i<$rows[replyNo] ; $i++) { $space .= "  "; if(($i+1) == $rows[replyNo]) $space .= " "; } $rows[subject] = strSplit($rows[subject], $limitWord, "..."); $rows[subject] .= ($rows[count] > 0 && $info->getLimitComment() == "Y")?" [".$rows[count]."]":""; printList($rows[no], $rows[sortNo], $rows[writer], $rows[email], $space.$rows[subject], $rows[writeDate], $rows[readCount], $rows[readLock], $rows[attachType]); $space = ""; } echo "

"; } // °ªÀ» È­¸é¿¡ Ãâ·Â function printList($rNo, $sortNo, $writer, $email, $subject, $writeDate, $readCount, $readLock, $attachType) { global $boardID, $page, $info, $no; $subject = stripslashes($subject); if(dateCheck($writeDate, 1)) $subject = " ".$subject; if($readLock == "Y") $subject = "".$subject; // º»¹® Ãâ·Â if($no == $rNo) echo ""; else echo "
"; echo ""; // ÆÄÀÏ÷ºÎ üũ if($info->getLimitAttach() == "Y") echo ""; if($no == $rNo) echo ""; else echo ""; // ³ª¸ÓÁö ³»¿ë ´Ù Ãâ·Â echo "
$sortNo".attachCheck($attachType)."$subject$subject$writer ".substr($writeDate,0,10)." $readCount
"; } // ÆÛ¹Ì¼Ç üũ boardPermission("R"); // Ãâ·Â printTable(); include ("../inc/footer.html"); // ǪÅÍ ?>