// ÀÛ¼ºÀÚ : ÃÖ»ó¹Î
// ¼öÁ¤ÀÏ : 2002³â 3¿ù 3ÀÏ
// ÆÄÀϸí : boardView.html
// °Ô½ÃÆÇ ±Û Àбâ
include ("../inc/header.html"); // Çì´õ
include ("../common/dbConnect.php"); // Ä¿³Ø¼Ç Æ÷ÇÔ
include("boardInfo.php"); // °Ô½ÃÆÇ Á¤º¸ Æ÷ÇÔ
include("../common/pageSkip.php"); // ÆäÀÌÁö ½ºÅµ°ü·Ã Æ÷ÇÔ
include("../common/common.php"); // °øÅëÇÔ¼ö Æ÷ÇÔ
include("./inc/header.html"); // Çì´õÆÄÀÏ Æ÷ÇÔ
include("boardCommon.php"); // °Ô½ÃÆÇ °øÅëÇÔ¼ö Æ÷ÇÔ
// °Ô½ÃÆÇ°ªÀÌ ¾øÀ»°æ¿ì ±âº»°Ô½ÃÆÇÀ» °¡Á®¿Â´Ù. ±×°Íµµ ¾øÀ½..¿¡·¯Áö ¸ð
if($boardID == "")
$boardID = "freeboard";
// °Ô½Ã¹° ¹øÈ£ üũ
if($no == "")
alert("ÀÐÀ¸·Á´Â °Ô½Ã¹° ¹øÈ£°¡ ¾ø½À´Ï´Ù.", 2);
// °Ô½ÃÆÇ Á¤º¸ ÃßÃâ
$info = new boardInfo($boardID);
// °Ô½ÃÆÇ Á¶È¸¼ö ¾÷µ¥ÀÌÆ®
function updateCount() {
global $no, $info, $boardID;
$query = "update $boardID set readCount=readCount+1 where no=$no";
mysql_query($query);
}
// ÷ºÎÆÄÀÏ Ã¼Å©
function attachFile() {
global $attachSize, $attachName, $boardID, $attachType;
if($attachName != "" && $attachSize > 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("