¸µÅ©µÈ °Ô½Ã¹°À» º¸¸é ¾Æ½Ã°ÚÁö¸¸ Á¶ÇÑ½Ä ´ÔÀÇ ÆÁÀ» ±âÃÊ·Î ÇÑ ³»¿ëÀÔ´Ï´Ù.
## °³¿ä ##
ÃֱٰԽù° ¶Ç´Â °Ô½ÃÆÇ ¸ñ·Ï¿¡¼ ÄÚ¸àÆ® ¼ýÀÚ¸¦ Ŭ¸¯Çϸé
ÄÚ¸àÆ® ºÎºÐ¸¸ Æ˾÷À¸·Î ¶å´Ï´Ù. Æ˾÷⠾ȿ¡¼ ÄÚ¸àÆ® ³»¿ëÀ»
¿¶÷ÇÒ ¼ö ÀÖ½À´Ï´Ù. (¿©±â±îÁö°¡ Á¶ÇÑ½Ä ´ÔÀÇ ÆÁ)
¿©±â¿¡ ´õÇÏ¿© »õ ÄÚ¸àÆ®¸¦ ÀÛ¼º ¹× ±âÁ¸ ÄÚ¸àÆ® »èÁ¦°¡ °¡´ÉÇϵµ·Ï
Çß½À´Ï´Ù. ÇÑÆí Á¶ÇѽĴÔÀº affected_rows ¼ýÀÚ¸¦ ±¸Çؼ ±× ¼ö¸¸Å
for ¹®À» µ¹¸®´Â ¹æ¹ýÀ» ¾²¼Ì´Âµ¥ ÀÌ»óÇÏ°Ô ÀÚ²Ù Á¤·ÄÀÌ ²¿ÀÌ´õ±º¿ä.
±×·¡¼ ±×³É fetch_array ÇØ while ¹®À» µ¹¸®´Â ¹æ¹ýÀ¸·Î ¹Ù²ãÁÖ¾ú½À´Ï´Ù.
1) comment_pop.php ÆÄÀÏÀ» ¸¸µé¾î ´ÙÀ½ ³»¿ëÀ¸·Î ÀúÀåÇÕ´Ï´Ù.
ÀÌ ÆÄÀÏÀº Á¦·Îº¸µå µð·ºÅ丮¿¡ ¾÷·Îµå ÇÕ´Ï´Ù.
<?
include "_head.php";
include "lib.php";
if(!$connect) $connect=dbconn();
$comments=mysql_query("select * from ".$t_comment."_".$id." where parent=$parent order by no", $connect);
//ÄÚ¸àÆ® Ãâ·Â¾ç½Ä¿¡ »ç¿ëÇÒ ½ºÅ²ÀÇ µð·ºÅ丮ÀÔ´Ï´Ù.
$blog_dir="../bbs/skin/mw_style_board/";
?>
<html>
<head>
<meta http-equiv='content-type' content='text/html; charset=euc-kr'>
<title>ÄÚ¸àÆ® º¸±â</title>
<!-- ½ºÅ¸ÀÏ ½ÃÆ® °æ·ÎÀÔ´Ï´Ù. -->
<link rel='stylesheet' type='text/css' href='../2fox/2fox.css'>
<!--À̸ðƼÄÜ »ðÀÔ ½ºÅ©¸³Æ®(»ç¿ë¾ÈÇÏ´Â ºÐÀº »èÁ¦)-->
<script language="JavaScript">
function AddChar(ch) {
document.write.memo.value+=ch;
document.write.memo.focus();
}
</script>
</head>
<body bgcolor=white><br>
<?php
// ȸ¿ø ¾ÆÀ̵𸦠ºÒ·¯¿À´Â ÇÔ¼ö(¾È¾²´Â ºÐÀº »èÁ¦)
function my_id($member_no) {
global $connect, $member_table;
@$data=mysql_fetch_array(mysql_query("select * from zetyx_member_table where no='$member_no'"));
$return_value = $data['user_id'];
if($member_no) {
if ($return_value=="") {
return "";
}else {
return "($return_value)";
}
}else {
return "(Guest)";
}
}
//ȸ¿ø ¾ÆÀÌÄÜ ºÒ·¯¿À´Â ÇÔ¼ö(¾È¾²½Ã´Â ºÐÀº »èÁ¦)
function blog_private_icon($no, $type) {
if($type==1) $dir = "../bbs/icon/private_icon/";
elseif($type==2) $dir = "../bbs/icon/private_name/";
if(@file_exists($dir.$no.".gif")) return $dir.$no.".gif";
}
//part for listing
while($c_data=mysql_fetch_array($comments)) {
$blog_com_no = $c_data[no];
$comment_name=stripslashes($c_data[name]);
$temp_name = blog_private_icon($c_data[ismember], "2");
if($temp_name) $comment_name="<img src='$temp_name' border=0 align=absmiddle>";
$c_data[memo] = str_replace("\\","",$c_data[memo]);
$c_memo=trim(stripslashes($c_data[memo]));
// À̸ðƼÄÜ º¯È¯ ºÎºÐÀÔ´Ï´Ù. (À̸ðƼÄÜ ¾È¾²´Â ºÐÀº »èÁ¦)
include "../bbs/include/emo_vc.php";
/***** Ãâ·Â ºÎºÐÀÔ´Ï´Ù.********************
echo my_id($c_data[ismember]); ÀÌ ºÎºÐÀº À§¿¡¼ ³ª¿Ôµí,
ȸ¿ø ¾ÆÀ̵𸦠ºÒ·¯¿À´Â ºÎºÐÀÌ´Ï »ç¿ëÇÏÁö ¾Ê´Â ºÐÀº »èÁ¦Çϼŵµ µË´Ï´Ù.
°¢Á¾ À̹ÌÁö ÆÄÀϸíÀº Àû´çÈ÷ ¼öÁ¤ÇÏ¼Å¾ß ÇÕ´Ï´Ù.
*******************************************/
//list output
echo "<div align=center>";
echo "<table border=0 height=9 cellspacing=0 cellpadding=0 width=95%><tr><td width=10><img src=".$blog_dir."image/bot_bg_left.gif border=0></td>";
echo "<td width=100% background=".$blog_dir."image/bot_bg_center.gif></td><td width=10><img src=".$blog_dir."image/bot_bg_right.gif border=0></td></tr></table>";
echo "<table border=0 style='table-layout:fixed;' align=center cellpadding=0 cellspacing=0 width=95%>";
echo " <tr><td style=padding:3px><b>".$comment_name."</b> <font class=view_id>";
echo my_id($c_data[ismember]);
echo " <font class=c_blog_date> ";
echo date("Y-m-d H:i",$c_data[reg_date]);
echo " </font></td>";
echo " <td width=30 align=right style='padding:5px;'><a href=../bbs/del_comment.php?id=".$id."&page=1&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=".$parent."&c_no=".$c_data[no]."&gowhere=pop><img src=".$blog_dir."image/list_delete.gif border=0></a> </td>";
echo "</tr><tr><td colspan=2 bgcolor=#ffffff height=3></td></tr>";
echo " <tr><td colspan=2 style='word-break:break-all;padding:5px;'>";
echo str_replace("\n","<br>",$c_memo);
echo " </td></tr></table></div>";
}
//name viewed at comment writing form
if($member[no]) {
$c_name=$member[name];
$hide_c_password_start="<!--";
$hide_c_password_end="-->";
$temp_name = blog_private_icon($member[no], "2");
if($temp_name) {
$c_name="<img src='$temp_name' border=0 align=absmiddle>";
} else $c_name=$c_name;
} else $c_name="<input type=text name=name size=8 maxlength=10 class=c_blog_input value=\"".$HTTP_SESSION_VARS["zb_writer_name"]."\">";
//À̸ðƼÄÜ show/hide ºÎºÐÀº »ç¿ëÇÏÁö ¾ÊÀ» °æ¿ì »èÁ¦Çϼ¼¿ä.
//comment writing form
echo "<div align=center><form method=post name=write action=../bbs/comment_ok.php?id=".$id."&page=1&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=".$parent."&gowhere=pop>";
echo "<table border=0 height=1 cellspacing=0 cellpadding=0 width=95%><tr><td width=100% background=../bbs/skin/mw_style_board/image/list_line.gif></td></tr></table>";
// À̸ðƼÄÜ Àû¿ëºÎºÐ - ¿©±âºÎÅÍ
echo "<table border=0 cellspacing=0 cellpadding=0 width=95%><tr><td> <a class=c_blog_v7b style='cursor:hand' onclick=\"if(MyEmo.style.display=='none'){MyEmo.style.display=''}else{MyEmo.style.display='none'}\">Use Emoticons in Nate-on</a></td></tr>";
echo "<tr><td style='padding=0 0 0 5;'><span id=MyEmo style='line-height:150%;display:none;'>";
include "../bbs/include/emo_blog.php";
echo "</span></td></tr></table>";
// À̸ðƼÄÜ Àû¿ëºÎºÐ - ¿©±â±îÁö
echo "<table border=0 cellspacing=0 cellpadding=4 width=96% height=100>";
echo "<tr align=center valign=top>";
echo "<td rowspan=2><textarea name=memo rows=7 class=c_blog_textarea></textarea></td>";
echo "<td width=80 height=70 align=center valign=middle class=c_blog_name>";
echo $hide_c_password_start."Name<br>".$hide_c_password_end."".$c_name."<br>";
echo $hide_c_password_start."Password<br><input type=password name=password";
echo size(9);
echo "maxlength=20 class=c_blog_input>".$hide_c_password_end ;
echo " </td></tr>";
echo "<tr><td align=center><input type=submit rows=5 class=c_blog_submit value='Alt + S' accesskey='s'></td>";
echo "</tr></table></form>";
echo "<input type=button rows=5 class=c_blog_pop value='Go to the Parent' onClick=\"window.close();opener.location.href='../bbs/zboard.php?id=".$id."&no=".$parent."';\" style=cursor:hand> <input type=button rows=5 class=c_blog_close value='Close' onClick=window.close() style=cursor:hand></div>";
?>
<br></body>
</html>
2) ȨÆäÀÌÁöÀÇ <head>¿Í </head> »çÀÌ¿¡ ´ÙÀ½ ½ºÅ©¸³Æ®¸¦ ³Ö¾îÁÝ´Ï´Ù.
Àú´Â ¸ðµç ÆäÀÌÁö¿¡ Àû¿ëµÇ´Â 2fox.js ¶ó´Â ½ºÅ©¸³Æ® ÆÄÀÏ¿¡ ³Ö¾îÁÖ¾ú½À´Ï´Ù.
â Å©±â´Â ÃëÇâ¿¡ ¸Â°Ô ¼öÁ¤Çϼ¼¿ä.
<script>
function comment_pop(id, parent) {
var url='../bbs/comment_pop.php?parent='+parent+'&id='+id;
var opt='width=600,height=400,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,left=100,top=100,copyhistory=yes';
window.open(url, 'comments', opt);
}
</script>
3) include/list_check.php¿Í outlogin.phpÀÇ ÄÚ¸àÆ® °¹¼ö Ãâ·Â ºÎºÐÀ» °¢°¢ ´ÙÀ½°ú °°ÀÌ
¼öÁ¤ÇØ ÁÝ´Ï´Ù. ¾Æ·¡´Â ½Ã°£¿¡ µû¶ó »ö±òÀÌ ¹Ù²î´Â ÆÁÀÌ Àû¿ëµÈ »óÅÂÀÔ´Ï´Ù.
// »õ·Î¿î ÄÚ¸àÆ® Ç¥½Ã include/list_check.php
$last_comment = mysql_fetch_array(mysql_query("select * from $t_comment"."_$id where parent='$data[no]' order by reg_date desc limit 1"));
$last_comment_time = $last_comment['reg_date'];
if(time()-$last_comment_time<60*60*12) $comment_num = "<a href=\"javascript:comment_pop('$id', $data[no])\"><font class=latest_comment24>[".$data[total_comment]."]</font></a>";
elseif(time()-$last_comment_time<60*60*24) $comment_num = "<a href=\"javascript:comment_pop('$id', $data[no])\"><font class=latest_comment12>[".$data[total_comment]."]</font></a>";
else $comment_num = "<a href=\"javascript:comment_pop('$id', $data[no])\"><font class=latest_comment>[".$data[total_comment]."]</font></a>";
// ÄÚ¸àÆ® °¹¼ö »õ·Î¿î ÄÚ¸àÆ®°¡ ¿Ã¶ó¿À¸é »ö±ò ¹Ù²î°Ô outlogin.php
if($data[total_comment]) {
$last_comment = mysql_fetch_array(mysql_query("select * from $t_comment"."_$id where parent='$data[no]' order by reg_date desc limit 1", $connect));
$last_comment_time = $last_comment[reg_date];
if(time()-$last_comment_time<60*60*12) $comment = "<a href=\"javascript:comment_pop('$id', $data[no])\"><font class=latest_comment24>[".$data[total_comment]."]</font></a>";
elseif(time()-$last_comment_time<60*60*24) $comment = "<a href=\"javascript:comment_pop('$id', $data[no])\"><font class=latest_comment12>[".$data[total_comment]."]</font></a>";
else $comment = "<a href=\"javascript:comment_pop('$id', $data[no])\"><font class=latest_comment>[".$data[total_comment]."]</font></a>";
} else $comment="";
¸¸¾à ½Ã°£¿¡ µû¶ó »ö±òÀÌ ¹Ù²î´Â ÆÁÀÌ Àû¿ë ¾ÈµÈ ¿øº»À̶ó¸é
if($data[total_comment]) $comment = "<a href=\"javascript:comment_pop('$id', $data[no])\">[".$data[total_comment]."]</font>"; else $comment="";
ÀÌ·± ½ÄÀÌ µÉ°Ì´Ï´Ù. ½Ã°£¿¡ µû¶ó »ö±òÀÌ ¹Ù²î´Â ÆÁÀÇ Àû¿ëÀº ´ÙÀ½À» Âü°íÇϽñ⠹ٶø´Ï´Ù.
http://reedyfox.com/bbs/zboard.php?id=building&page=2&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=7
http://reedyfox.com/bbs/zboard.php?id=building&page=2&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=8
4) ÀÚ... ±× ´ÙÀ½Àº ÄÚ¸àÆ® ÀÛ¼º½Ã Æ˾÷âÀ» ´Ý¾ÆÁÖ°í ºÎ¸ðâÀ»
¸±·Îµå ÇØÁÖ´Â ºÎºÐÀÔ´Ï´Ù.
comment_ok.php ÀÇ ¸¶Áö¸·À»
// ÆäÀÌÁö À̵¿
if($gowhere==blog) {
header("location:../2fox/main.html");
} elseif($gowhere==pop) {
echo "<script>
opener.history.go(0);
window.close();
</script>";
} else {
movepage("................................»ý·«........
}
ÀÌ·¸°Ô ¼öÁ¤ÇØ ÁÝ´Ï´Ù. ÀÌ°Ç ºí·Î±× ½ºÅ¸ÀÏ °øÁö»çÇ× ÆÁÀÌ Àû¿ëµÈ °æ¿ìÀε¥
ºí·Î±× ½ºÅ¸ÀÏ °øÁö»çÇ× ÆÁÀÌ Àû¿ë ¾ÈµÈ ºÐÀº
// ÆäÀÌÁö À̵¿
if($gowhere==pop) {
echo "<script>
opener.history.go(0);
window.close();
</script>";
} else {
movepage("................................»ý·«........
}
ÀÌ·¸°Ô ÇØÁÖ½Ã¸é µË´Ï´Ù.
5) ÄÚ¸àÆ® »èÁ¦½Ã Æ˾÷âÀ» ´Ý¾ÆÁÖ°í ºÎ¸ðâÀ» ¸±·Îµå ÇØÁÖ´Â ºÎºÐÀÔ´Ï´Ù.
del_comment.php¿¡¼
head(); ¿Í foot(); °¡ Àִµ¥ °¢°¢
if(!$gowhere=="pop") {
head();
}
if(!$gowhere=="pop") {
foot();
}
ÀÌ·±½ÄÀ¸·Î ¼öÁ¤ÇØ ÁÝ´Ï´Ù. »èÁ¦½Ã È®ÀÎȸéÀÌ ¶ß´Âµ¥ °Ô½ÃÆÇ ÆäÀÌÁö Àüü°¡
¶°¼ ½ºÅ©·Ñ »ý±â°í º¸±â°¡ ¾ÈÁÁ¾Æ¼ ±×°É ¸·´Â °Ì´Ï´Ù.
±×¸®°í include $dir."/ask_password.php"; ¾Æ·§ºÎºÐÀ»
//ºí·Î±×À϶§ º¯¼ö ³Ñ°ÜÁÖ±â
if($gowhere=="blog") {
echo "<form method=post name=gowhere action=del_comment_ok.php><input type=hidden name=gowhere value=blog></form>";
} elseif($gowhere=="pop") {
echo "<link rel='stylesheet' type='text/css' href='../bbs/skin/mw_style_board/style.css'>";
echo "<form method=post name=gowhere action=del_comment_ok.php><input type=hidden name=gowhere value=pop></form>";
} else {
}
ÀÌ·±½ÄÀ¸·Î °íÃÄÁÝ´Ï´Ù. ÀÌ°Í ¿ª½Ã ºí·Î±× ½ºÅ¸ÀÏ °øÁö»çÇ× ÆÁÀÌ
Àû¿ëµÈ °æ¿ìÀÌ¸ç ±×·¸Áö ¾ÊÀº ºÐÀº
if($gowhere=="pop") {
echo "<link rel='stylesheet' type='text/css' href='../bbs/skin/mw_style_board/style.css'>";
echo "<form method=post name=gowhere action=del_comment_ok.php><input type=hidden name=gowhere value=pop></form>";
} else {
}
ÀÌ·¸°Ô ÇØÁÖ½Ã¸é µË´Ï´Ù. ½ºÅ¸ÀÏ ½ÃÆ®¸¦ ·ÎµùÇÏ´Â ÀÌÀ¯´Â ¿¡·¯ ÆäÀÌÁö¸¸ ºÒ·¯¿À±â
¶§¹®¿¡ ¾Æ¹« ½ºÅ¸Àϵµ ÁöÁ¤µÇ¾î ÀÖÁö ¾Ê±â ¶§¹®ÀÔ´Ï´Ù.
±×¸®°í del_comment_ok.php ÀÇ ¸¶Áö¸· ºÎºÐµµ comment_ok.php ó·³
// ÆäÀÌÁö À̵¿
if($gowhere=="blog") {
header("location:../2fox/main.html");
} elseif($gowhere=="pop") {
echo "<script>
opener.history.go(0);
window.close();
</script>";
} else {
if($setup[...................»ý·«.......................
}
ÀÌ·¸°Ô ¼öÁ¤ÇØ ÁÖ½Ã¸é µË´Ï´Ù. ºí·Î±× ¾î¼±¸ ÇÏ´Â °Ç ´õÀÌ»ó ¸»¾¸ ¾Èµå·Áµµ ¾Æ½Ã°ÚÁÒ?
6) ¸¶Áö¸·À¸·Î _head.php 19ÇàÂë¿¡
$_zb_file_list = array............ ¿¡´Ù°¡ comment_pop.php ¶ó´Â ÆÄÀϸíÀ»
Ãß°¡ÇØ ÁÝ´Ï´Ù.
7) ³¡~~
ÀåȲÇÑ ³ª¸ÓÁö ºü¶ß¸° ºÎºÐÀÌ ÀÖÀ»Áöµµ ¸ð¸£°Ú½À´Ï´Ù.
¹ö±× ¸®Æ÷Æà ºÎŹµå¸³´Ï´Ù.
## »ç¿ëµÈ Ŭ·¡½º ##
.view_id {font-family:Verdana;font-size:7pt;color:coral;line-height:130%;}
.c_blog_date {font-family:Tahoma;font-size:7pt;color:gray;}
.c_blog_input {border:solid 1 silver;font-family:±¼¸²;font-size:9pt;color:black;background-color:white;cursor:hand;}
.c_blog_v7b {font-family:Verdana;font-size:7pt;color:#4a4d4a;font-weight:bold;}
.c_blog_textarea {font-family:±¼¸²;font-size:9pt;border:solid 2;border-color:c3c3c3;background-color:ffffff;width:100%;overflow-x:hidden;overflow-y:auto;}
.c_blog_name {font-family:Tahoma;font-size:8pt;color:black;font-weight:bold;}
.c_blog_submit {border:solid 1 black;font-family:Verdana;font-size:8pt;font-weight:bold;color:white;background-color:#4C67B4;width:75px;height:20px;}
.c_blog_pop {border:solid 1 black;font-family:Verdana;font-size:8pt;font-weight:bold;color:white;background-color:#DB9D25;width:140px;height:20px;}
.c_blog_close {border:solid 1 black;font-family:Verdana;font-size:8pt;font-weight:bold;color:white;background-color:#C00000;width:75px;height:20px;}
.latest_comment {font-family:tahoma;font-size:7pt;color:#E8C078;line-height:100%;}
.latest_comment12 {font-family:tahoma;font-size:7pt;color:#FF8050;line-height:100%;}
.latest_comment24 {font-family:tahoma;font-size:7pt;color:red;line-height:100%;}
µ¡. ºí·Î±× ½ºÅ¸ÀÏ °øÁö»çÇ׿¡¼ ÄÚ¸àÆ® °¹¼ö±îÁö Ãâ·ÂµÇ°Ô ÇϽŠºÐÀÌ
ÀÖ´Ù¸é ÀÌ°Í ÁÖÀÇÇϼ¼¿ä. ºÒ·¯¿Â ÄÚ¸àÆ® ÀÚü¿¡ aűװ¡ µé¾îÀÖÀ¸¹Ç·Î
show/hide ¸¦ µ¿ÀÛÇÏ´Â a ÅÂ±×¿Í ²¿Àϼö°¡ ÀÖ½À´Ï´Ù. À̶§´Â ÄÚ¸àÆ®
°¹¼ö¸¦ ±âÁØÀ¸·Î ¾Õ µÚ·Î aű׸¦ ºÐ¸®½ÃÅ°¼Å¾ß ÈÄȯ(?)ÀÌ ¾ø½À´Ï´Ù.