이미지(배경)를 추가하고 싶어요 정보
이미지(배경)를 추가하고 싶어요본문
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.
오류 주소 : http://tingyuan.dothome.co.kr/gnuboard4/bbs/board.php?bo_table=diarymemo
오류 주소에 있는 게시판 코멘트 스타일을 http://tingyuan.dothome.co.kr/gnuboard4/bbs/board.php?bo_table=diary 여기처럼 바꾸고 싶습니다.
그러니까 각 코멘트 아래쪽에 line.gif를 넣어서 코멘트들을 구분하고 싶어요.
<td height="1" style="background: url('<?=$board_skin_path?>/img/line.gif');"></td>
다른 건 이걸 사용해서 깔았는데... 저건 어떻게 해야 하는 건지;ㅠㅜ; 복붙으로 수정하고 있는 초보라 어려움이 많습니다. 도움 주시면 감사하겠습니다(__);;
아래에 list.skin.php 추가합니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$colist = array();
if($is_admin)set_session("ss_delete_token", $token = uniqid(time()));
?>
<style>
.line { background-color:#DDDDDD; height:1px; }
.bnum { font:bold 18px Georgia; color:333333; margin-right:10px; }
.c_name { color:#aaaaaa; text-decoration:none; font-size:8pt; }
.c_date { color:#aaaaaa; font-family:tahoma; }
.t7 { font-family:tahoma; font-size:7pt; }
input.ed { height:20px; border:1px solid #EFEFEF; padding:3px 2px 0 2px; }
input.ed_password { height:20px; border:1px solid #EFEFEF; padding:3px 2px 0 2px; font:10px Tahoma; }
textarea.tx { border:1px solid #EFEFEF; padding:2px; }
</style>
<script language="JavaScript">
// 글자수 제한
var char_min = parseInt(<?=$write_min?>); // 최소
var char_max = parseInt(<?=$write_max?>); // 최대
</script>
<!-- 게시판 리스트 시작 -->
<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0">
<tr><td><br><br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<?
for($i= 0; $i< count($list); $i++){
$wr_id= $list[$i][wr_id];
$write = sql_fetch(" select * from $write_table where wr_id = '$wr_id' ");
$view = get_view($write, $board, $board_skin_path, 255);
if (strstr($sfl, "subject"))
$view[subject] = search_font($stx, $view[subject]);
$html = 0;
if (strstr($view[wr_option], "html1"))
$html = 1;
else if (strstr($view[wr_option], "html2"))
$html = 2;
$view[content] = conv_content($view[wr_content], $html);
if (strstr($sfl, "content"))
$view[content] = search_font($stx, $view[content]);
$view[content] = preg_replace("/(\<img )([^\>]*)(\>)/i", "\\1 name='target_resize_image[]' onclick='image_window(this)' style='cursor:pointer;' \\2 \\3", $view[content]);
$view[rich_content] = preg_replace("/{이미지\:([0-9]+)[:]?([^}]*)}/ie", "view_image(\$view, '\\1', '\\2')", $view[content]);
?>
<!-- 본문 리스트 -->
<tr>
<td height="1" style="background:url('<?=$board_skin_path?>/img/line.gif') " colspan="6"></td></tr><tr>
<td height="25" colspan="5" style="padding-left:5px;">
<a name="c_<?=$wr_id?>"></a>
<span class=bnum><?= abs($list[$i][num]) ?></span>
<!-- use element of num instead of wr_num to increase numbers in order -->
<!-- also change the link title below, wr_num to num, line 70 -->
<style="font-size:11px;"><?=date("F j, Y, g:i a", strtotime($list[$i][wr_datetime]))?></b>
</td><td align="right" style="padding-right:15px; padding:10px">
<?=$list[$i][subject]?>
</td></tr>
<tr><td colspan="6" height="10"></td></tr>
<tr style="cursor:pointer;_cursor:hand;" title="no one who care about me ♬" onClick="javascript:list_box('<?=$wr_id?>', 'r');"><td colspan="6" style="padding:5px 5px 0 5px;">
<div class="writeContents">
<!-- 비밀글 걸러내기 -->
<?
if ( strstr($list[$i][wr_option], "secret") && ($member[mb_id] != $list[$i][mb_id]) ) {
echo "<span class='small' style='color:#ff6600;'>비밀글 입니다</span>";
}
else { ?>
<!-- 첨부파일 표시 -->
<?
if(!strstr($view[wr_1], "invisible")){
if(count($view[file])> 1){
echo "<div class='contentsInfo'>";
// 가변 파일
$acnt = 0;
for ($ai=0; $ai<count($view[file]); $ai++) {
if ($view[file][$ai][source] && !$view[file][$ai][view]) {
$acnt++;
echo "#Attached File{$acnt}:";
echo "<a href=\"javascript:file_download('{$view[file][$ai][href]}', '".urlencode($view[file][$ai][source])."');\" title='{$view[file][$ai][content]}'>";
echo " <span style=\"color:#888;\">{$view[file][$ai][source]} ({$view[file][$ai][size]})</span>";
echo "</a><br />";
}
}
// 파일 출력
for ($ai=0; $ai<=count($view[file]); $ai++) {
if ($view[file][$ai][view])
echo $view[file][$ai][view] . "<br />";
}
echo "</div>";
}
}
?>
<!-- 첨부파일 표시 끝 -->
<?= $view[content] ?>
<? } ?>
<!-- 비밀글 걸러내기 끝 -->
</div>
</td></tr>
<!-- 본문 리스트 끝 -->
<!-- 본문 댓글쓰기 -->
<tr><td colspan="6">
<span id='reply_<?=$wr_id?>' style='display:none; width:100%; padding:5;'></span>
<span id='edit_<?=$wr_id?>' style='display:none; width:100%; padding:5;'></span>
</td></tr>
<!-- 본문 댓글쓰기 끝 -->
<tr><td colspan="6" style="padding:30 0 30 30;line-height:1.6em">
<!-- 코멘트 리스트 -->
<?
$cosql = " select * from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment, wr_comment_reply ";
$coresult = sql_query($cosql);
for ($ii=0; $corow=sql_fetch_array($coresult); $ii++)
{
$colist[$ii] = $corow;
$cotmp_name = get_text(cut_str($corow[wr_name], $config[cf_cut_name])); // 설정된 자리수 만큼만 이름 출력
if ($board[bo_use_sideview])
$colist[$ii][name] = get_sideview($corow[mb_id], $cotmp_name, $corow[wr_email], $corow[wr_homepage]);
else
$colist[$ii][name] = "<span class='".($corow[mb_id]?'member':'guest')."'>$cotmp_name</span>";
// 공백없이 연속 입력한 문자 자르기 (way 보드 참고. way.co.kr)
$c_secret_f= 1;
$colist[$ii][content] = $colist[$ii][content1]= "비밀글 입니다";
if (!strstr($corow[wr_option], "secret") ||
$is_admin ||
($write[mb_id]==$member[mb_id] && $member[mb_id]) ||
($corow[mb_id]==$member[mb_id] && $member[mb_id])) {
$c_secret_f= 0;
$colist[$ii][content1] = $corow[wr_content];
$colist[$ii][content] = conv_content($corow[wr_content], 0, 'wr_content');
$colist[$ii][content] = search_font($stx, $colist[$ii][content]);
}
$colist[$ii][trackback] = url_auto_link($corow[wr_trackback]);
$colist[$ii][datetime] = substr($corow[wr_datetime],0,16);
// 관리자가 아니라면 중간 IP 주소를 감춘후 보여줍니다.
$colist[$ii][ip] = $corow[wr_ip];
if (!$is_admin)
$colist[$ii][ip] = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", "\\1.♡.\\3.\\4", $corow[wr_ip]);
$colist[$ii][is_reply] = false;
$colist[$ii][is_edit] = false;
$colist[$ii][is_del] = false;
if ($is_comment_write || $is_admin)
{
if ($member[mb_id])
{
if ($corow[mb_id] == $member[mb_id] || $is_admin)
{
$colist[$ii][del_link] = "./delete_comment.php?bo_table=$bo_table&comment_id=$corow[wr_id]&cwin=$cwin&page=$page&token=$token".$qstr;
$colist[$ii][is_edit] = true;
$colist[$ii][is_del] = true;
}
}
else
{
if (!$corow[mb_id]) {
$colist[$ii][del_link] = "./password.php?w=x&bo_table=$bo_table&comment_id=$corow[wr_id]&cwin=$cwin&page=$page".$qstr;
$colist[$ii][is_del] = true;
}
}
if (strlen($corow[wr_comment_reply]) < 5)
$colist[$ii][is_reply] = true;
}
// 05.05.22
// 답변있는 코멘트는 수정, 삭제 불가
if ($ii > 0 && !$is_admin)
{
if ($corow[wr_comment_reply])
{
$tmp_comment_reply = substr($corow[wr_comment_reply], 0, strlen($corow[wr_comment_reply]) - 1);
if ($tmp_comment_reply == $colist[$ii-1][wr_comment_reply])
{
$colist[$ii-1][is_edit] = false;
$colist[$ii-1][is_del] = false;
}
}
}
$t_name= $colist[$ii][name];
$t_content= $colist[$ii][content];
$t_date= $colist[$ii][datetime];
$t_id= $colist[$ii][wr_id];
echo "<div style='padding:5 10 10 10;text-align:justify;' >";
for ($tc= 0; $tc< strlen($colist[$ii][wr_comment_reply]); $tc++) echo " ";
if($c_secret_f)
echo "<span class='small' style='color:#ff6600;'>$t_content</span> <span class='c_date'>$t_date</span>";
else {
if ($colist[$ii][wr_homepage]) { echo "<a href=\"http://{$colist[$ii][wr_homepage]}\">"; }
else if ($colist[$ii][wr_email]) { echo "<a href=\"mailto:{$colist[$ii][wr_email]}\">"; }
else {echo "<a name=\"\">"; }
echo "<span class='c_name'><NOBR>$t_name</NOBR></span></a> <span class='c_date'>$t_date</span>";
if ($colist[$ii][is_del])
echo " <a href=\"javascript:comment_delete('{$colist[$ii][del_link]}');\" class='write'>-</a> ";
if(strstr($corow[wr_option], "secret"))
echo "<span style='color:#999999;'><br />* $t_content";
else
echo "<br />$t_content";}
echo "</div>";}
?>
<!-- 코멘트 리스트 끝 -->
</td></tr>
<? } // 전체 루프끝 ?>
<? if (count($list) == 0) { ?>
<tr><td height="100" align="center">There's no article related.</td></tr>
<? } ?>
</table>
<!-- 페이지 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td height="1" colspan="2" style="background: url('<?=$board_skin_path?>/img/line.gif');"></td></tr>
<tr>
<td width="75%" height="10" class="t7 color_999" style='padding:2px 10px'>
<? if (($member[mb_id] && ($member[mb_id] == $list[$i][mb_id])) || $is_admin) { ?>
<a href="./write.php?w=u&bo_table=<?=$bo_table?>&wr_id=<?=$wr_id?>&page=<?=$page?>" class="write">mod</a>
<a href="javascript:if (confirm('Are you sure to delete?')) { location='./delete.php?w=d&bo_table=<?=$bo_table?>&wr_id=<?=$list[$i][wr_id]?>&page=<?=$page?>&token=<?=$token?>';}" class="write">del</a><? } ?>
<? if ($write_href) { ?> <a href="<?=$write_href?>">write</a><? } ?>
<? if ($admin_href) { ?><a href="<?=$admin_href?>"> *</a><?}?>
</td>
<td width="25%" align=right class="t7 color_999" style="padding:10px">
<? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\">prev</a> "; } ?>
<? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\">next</a> "; } ?>
<?
// 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
//echo $write_pages;
$write_pages = str_replace("처음", "<<", $write_pages);
$write_pages = str_replace("이전", "Prev", $write_pages);
$write_pages = str_replace("다음", "Next", $write_pages);
$write_pages = str_replace("맨끝", ">>", $write_pages);
$write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "$1", $write_pages);
$write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><font class=\"color_gold2\">$1</font></b>", $write_pages);
?>
<?=$write_pages?>
<? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/btn_search_next.gif' border=0 align=absmiddle title='다음검색'></a>"; } ?>
</td>
</tr>
</table>
<!-- 페이지 표시 끝 -->
</td></tr>
</table>
<!-- 댓글쓰기 양식 -->
<span id=list_write style="display:inline; width:100%; padding:10;">
<table width=93% align="right" border=0 cellpadding=1 cellspacing=0><tr><td>
<form name="fwrite" method="post" action="./write_comment_update.php" onsubmit="return fviewcomment_submit(this);" autocomplete="off">
<input type=hidden name=w id=list_w value='c'>
<input type=hidden name=bo_table value='<?=$bo_table?>'>
<input type=hidden name=wr_id id=list_id value='<?=$wr_id?>'>
<input type=hidden name=wr_subject value="<?=$subject?>">
<input type=hidden name=comment_id id='comment_id' value=''>
<input type=hidden name=sca value='<?=$sca?>' >
<input type=hidden name=sfl value='<?=$sfl?>' >
<input type=hidden name=stx value='<?=$stx?>'>
<input type=hidden name=spt value='<?=$spt?>'>
<input type=hidden name=page value='<?=$page?>'>
<input type=hidden name=cwin value='<?=$cwin?>'>
<input type=hidden name=is_good value=''>
<table width=100% cellpadding=3 cellspacing=0>
<tr>
<br><br>
<td colspan="2">
<textarea id="wr_content" name="wr_content" rows=4 itemname="내용" required
<? if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');"<?}?> style='width:100%; word-break:break-all;' class=tx></textarea>
<? if ($comment_min || $comment_max) { ?><script type="text/javascript"> check_byte('wr_content', 'char_count'); </script><?}?>
</td></tr>
<tr>
<td class="t7" align="right">
<? if ($is_guest) { ?>
name <INPUT type=text maxLength=20 size=10 name="wr_name" itemname="이름" class=ed>
pass <INPUT type=text size=10 name="wr_password" itemname="패스워드" class=ed>
<? } ?>
secret<input type=checkbox id="wr_secret" name="wr_secret" value="secret">
<? if ($comment_min || $comment_max) { ?><span id=char_count></span>characters<?}?>
<? if ($is_guest) { ?>
<input type=hidden name=zsfCodeResult id="zsfCodeResult" value="" valign="bottom">
<img id='kcaptcha_image' border='0' style="cursor:pointer;" title="글자가 잘안보이는 경우 코멘트창을 리로드...!" width="60" height="17">
<input title="왼쪽의 글자를 입력하세요." type="input" name="wr_key" size="10" itemname="자동등록방지" required class=ed>
<? } ?>
<input type="image" src="<?=$board_skin_path?>/img/comment.gif" border=0 accesskey='s'></div>
</td>
</tr>
</table>
</form>
</td></tr></table>
<!-- 댓글쓰기 양식 끝 -->
<script type="text/javascript">
function file_download(link, file) {
<? if ($board[bo_download_point] < 0) { ?>if (confirm("'"+decodeURIComponent(file)+"' 파일을 다운로드 하시면 포인트가 차감(<?=number_format($board[bo_download_point])?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"))<?}?>
document.location.href=link;
}
</script>
<script type="text/javascript" src="<?="$g4[path]/js/board.js"?>"></script>
<script type="text/javascript">
window.onload=function() {
resizeBoardImage(<?=(int)$board[bo_image_width]?>);
drawFont();
}
</script>
<script type="text/javascript"> var md5_norobot_key = ''; </script>
<script type="text/javascript" src="<?="$g4[path]/js/prototype.js"?>"></script>
<script type="text/javascript">
function comment_delete(url)
{
if (confirm("Are you sure to delete the comment?")) location.href = url;
}
</script>
<?
if (!$member[mb_id])
echo "<script language='javascript' src='$g4[path]/js/md5.js'></script>\n";
echo "<script language='javascript'> var g4_cf_filter = '$config[cf_filter], '; </script>\n";
echo "<script language='javascript' src='$g4[path]/js/filter.js'></script>\n";
?>
<script type="text/javascript">
function imageClick() {
var url = "<?=$g4[bbs_path]?>/kcaptcha_session.php";
var para = "";
var myAjax = new Ajax.Request(
url,
{
method: 'post',
asynchronous: true,
parameters: para,
onComplete: imageClickResult
});
}
function imageClickResult(req) {
var result = req.responseText;
var img = document.createElement("IMG");
img.setAttribute("src", "<?=$g4[bbs_path]?>/kcaptcha_image.php?t=" + (new Date).getTime());
document.getElementById('kcaptcha_image').src = img.getAttribute('src');
md5_norobot_key = result;
}
<? if (!$member[mb_id]) { ?>Event.observe(window, "load", imageClick);<? } ?>
var old_id, new_id;
var save_html = document.getElementById('list_write').innerHTML;
function list_box(list_id, work)
{
imageClick();
if (list_id){
if (work == 'r')
new_id = 'reply_' + list_id;
else
new_id = 'edit_' + list_id;
}
else
new_id = 'list_write';
if (old_id == new_id) {
var mode = document.getElementById(new_id).style.display;
if (mode == 'inline') {
document.getElementById(new_id).style.display = 'none';
}
else {
document.getElementById(new_id).style.display = 'inline';
}
}
else {
if (old_id){
document.getElementById(old_id).style.display = 'none';
document.getElementById(old_id).innerHTML = '';
}
document.getElementById(new_id).style.display = 'inline';
document.getElementById(new_id).innerHTML = save_html;
if (work == 'u'){
document.getElementById('list_content').value = document.getElementById('save_content_' + list_id).value;
var commentObj = eval("document.getElementById('comment_" + list_id + "')");
if(commentObj != null)
if(commentObj.style.display == 'none') commentObj.style.display = 'inline';
else
commentObj.style.display = 'none';
}
document.getElementById('list_id').value = list_id;
document.getElementById('list_w').value = 'c';
old_id = new_id;
}
}
list_box('', '');
new_id = 'list_write';
document.getElementById(new_id).style.display = 'none';
function fviewcomment_submit(f)
{
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
f.is_good.value = 0;
/*
var s;
if (s = word_filter_check(document.getElementById('wr_content').value))
{
alert("내용에 금지단어('"+s+"')가 포함되어있습니다");
document.getElementById('wr_content').focus();
return false;
}
*/
var subject = "";
var content = "";
$.ajax({
url: "<?=$board_skin_path?>/ajax.filter.php",
type: "POST",
data: {
"subject": "",
"content": f.wr_content.value
},
dataType: "json",
async: false,
cache: false,
success: function(data, textStatus) {
subject = data.subject;
content = data.content;
}
});
if (content) {
alert("prohibited word:"+content+" included");
f.wr_content.focus();
return false;
}
// 양쪽 공백 없애기
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
document.getElementById('wr_content').value = document.getElementById('wr_content').value.replace(pattern, "");
if (char_min > 0 || char_max > 0)
{
check_byte('wr_content', 'char_count');
var cnt = parseInt(document.getElementById('char_count').innerHTML);
if (char_min > 0 && char_min > cnt)
{
alert("코멘트는 "+char_min+"글자 이상 쓰셔야 합니다.");
return false;
} else if (char_max > 0 && char_max < cnt)
{
alert("코멘트는 "+char_max+"글자 이하로 쓰셔야 합니다.");
return false;
}
}
else if (!document.getElementById('wr_content').value)
{
alert("are you trying to say something with a black?");
return false;
}
if (typeof(f.wr_name) != 'undefined')
{
f.wr_name.value = f.wr_name.value.replace(pattern, "");
if (f.wr_name.value == '')
{
alert('name field required');
f.wr_name.focus();
return false;
}
}
if (typeof(f.wr_password) != 'undefined')
{
f.wr_password.value = f.wr_password.value.replace(pattern, "");
if (f.wr_password.value == '')
{
alert('contact field required');
f.wr_password.focus();
return false;
}
}
if (!check_kcaptcha(f.wr_key)) {
return false;
}
return true;
}
</script>
오류 주소 : http://tingyuan.dothome.co.kr/gnuboard4/bbs/board.php?bo_table=diarymemo
오류 주소에 있는 게시판 코멘트 스타일을 http://tingyuan.dothome.co.kr/gnuboard4/bbs/board.php?bo_table=diary 여기처럼 바꾸고 싶습니다.
그러니까 각 코멘트 아래쪽에 line.gif를 넣어서 코멘트들을 구분하고 싶어요.
<td height="1" style="background: url('<?=$board_skin_path?>/img/line.gif');"></td>
다른 건 이걸 사용해서 깔았는데... 저건 어떻게 해야 하는 건지;ㅠㅜ; 복붙으로 수정하고 있는 초보라 어려움이 많습니다. 도움 주시면 감사하겠습니다(__);;
아래에 list.skin.php 추가합니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$colist = array();
if($is_admin)set_session("ss_delete_token", $token = uniqid(time()));
?>
<style>
.line { background-color:#DDDDDD; height:1px; }
.bnum { font:bold 18px Georgia; color:333333; margin-right:10px; }
.c_name { color:#aaaaaa; text-decoration:none; font-size:8pt; }
.c_date { color:#aaaaaa; font-family:tahoma; }
.t7 { font-family:tahoma; font-size:7pt; }
input.ed { height:20px; border:1px solid #EFEFEF; padding:3px 2px 0 2px; }
input.ed_password { height:20px; border:1px solid #EFEFEF; padding:3px 2px 0 2px; font:10px Tahoma; }
textarea.tx { border:1px solid #EFEFEF; padding:2px; }
</style>
<script language="JavaScript">
// 글자수 제한
var char_min = parseInt(<?=$write_min?>); // 최소
var char_max = parseInt(<?=$write_max?>); // 최대
</script>
<!-- 게시판 리스트 시작 -->
<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0">
<tr><td><br><br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<?
for($i= 0; $i< count($list); $i++){
$wr_id= $list[$i][wr_id];
$write = sql_fetch(" select * from $write_table where wr_id = '$wr_id' ");
$view = get_view($write, $board, $board_skin_path, 255);
if (strstr($sfl, "subject"))
$view[subject] = search_font($stx, $view[subject]);
$html = 0;
if (strstr($view[wr_option], "html1"))
$html = 1;
else if (strstr($view[wr_option], "html2"))
$html = 2;
$view[content] = conv_content($view[wr_content], $html);
if (strstr($sfl, "content"))
$view[content] = search_font($stx, $view[content]);
$view[content] = preg_replace("/(\<img )([^\>]*)(\>)/i", "\\1 name='target_resize_image[]' onclick='image_window(this)' style='cursor:pointer;' \\2 \\3", $view[content]);
$view[rich_content] = preg_replace("/{이미지\:([0-9]+)[:]?([^}]*)}/ie", "view_image(\$view, '\\1', '\\2')", $view[content]);
?>
<!-- 본문 리스트 -->
<tr>
<td height="1" style="background:url('<?=$board_skin_path?>/img/line.gif') " colspan="6"></td></tr><tr>
<td height="25" colspan="5" style="padding-left:5px;">
<a name="c_<?=$wr_id?>"></a>
<span class=bnum><?= abs($list[$i][num]) ?></span>
<!-- use element of num instead of wr_num to increase numbers in order -->
<!-- also change the link title below, wr_num to num, line 70 -->
<style="font-size:11px;"><?=date("F j, Y, g:i a", strtotime($list[$i][wr_datetime]))?></b>
</td><td align="right" style="padding-right:15px; padding:10px">
<?=$list[$i][subject]?>
</td></tr>
<tr><td colspan="6" height="10"></td></tr>
<tr style="cursor:pointer;_cursor:hand;" title="no one who care about me ♬" onClick="javascript:list_box('<?=$wr_id?>', 'r');"><td colspan="6" style="padding:5px 5px 0 5px;">
<div class="writeContents">
<!-- 비밀글 걸러내기 -->
<?
if ( strstr($list[$i][wr_option], "secret") && ($member[mb_id] != $list[$i][mb_id]) ) {
echo "<span class='small' style='color:#ff6600;'>비밀글 입니다</span>";
}
else { ?>
<!-- 첨부파일 표시 -->
<?
if(!strstr($view[wr_1], "invisible")){
if(count($view[file])> 1){
echo "<div class='contentsInfo'>";
// 가변 파일
$acnt = 0;
for ($ai=0; $ai<count($view[file]); $ai++) {
if ($view[file][$ai][source] && !$view[file][$ai][view]) {
$acnt++;
echo "#Attached File{$acnt}:";
echo "<a href=\"javascript:file_download('{$view[file][$ai][href]}', '".urlencode($view[file][$ai][source])."');\" title='{$view[file][$ai][content]}'>";
echo " <span style=\"color:#888;\">{$view[file][$ai][source]} ({$view[file][$ai][size]})</span>";
echo "</a><br />";
}
}
// 파일 출력
for ($ai=0; $ai<=count($view[file]); $ai++) {
if ($view[file][$ai][view])
echo $view[file][$ai][view] . "<br />";
}
echo "</div>";
}
}
?>
<!-- 첨부파일 표시 끝 -->
<?= $view[content] ?>
<? } ?>
<!-- 비밀글 걸러내기 끝 -->
</div>
</td></tr>
<!-- 본문 리스트 끝 -->
<!-- 본문 댓글쓰기 -->
<tr><td colspan="6">
<span id='reply_<?=$wr_id?>' style='display:none; width:100%; padding:5;'></span>
<span id='edit_<?=$wr_id?>' style='display:none; width:100%; padding:5;'></span>
</td></tr>
<!-- 본문 댓글쓰기 끝 -->
<tr><td colspan="6" style="padding:30 0 30 30;line-height:1.6em">
<!-- 코멘트 리스트 -->
<?
$cosql = " select * from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment, wr_comment_reply ";
$coresult = sql_query($cosql);
for ($ii=0; $corow=sql_fetch_array($coresult); $ii++)
{
$colist[$ii] = $corow;
$cotmp_name = get_text(cut_str($corow[wr_name], $config[cf_cut_name])); // 설정된 자리수 만큼만 이름 출력
if ($board[bo_use_sideview])
$colist[$ii][name] = get_sideview($corow[mb_id], $cotmp_name, $corow[wr_email], $corow[wr_homepage]);
else
$colist[$ii][name] = "<span class='".($corow[mb_id]?'member':'guest')."'>$cotmp_name</span>";
// 공백없이 연속 입력한 문자 자르기 (way 보드 참고. way.co.kr)
$c_secret_f= 1;
$colist[$ii][content] = $colist[$ii][content1]= "비밀글 입니다";
if (!strstr($corow[wr_option], "secret") ||
$is_admin ||
($write[mb_id]==$member[mb_id] && $member[mb_id]) ||
($corow[mb_id]==$member[mb_id] && $member[mb_id])) {
$c_secret_f= 0;
$colist[$ii][content1] = $corow[wr_content];
$colist[$ii][content] = conv_content($corow[wr_content], 0, 'wr_content');
$colist[$ii][content] = search_font($stx, $colist[$ii][content]);
}
$colist[$ii][trackback] = url_auto_link($corow[wr_trackback]);
$colist[$ii][datetime] = substr($corow[wr_datetime],0,16);
// 관리자가 아니라면 중간 IP 주소를 감춘후 보여줍니다.
$colist[$ii][ip] = $corow[wr_ip];
if (!$is_admin)
$colist[$ii][ip] = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", "\\1.♡.\\3.\\4", $corow[wr_ip]);
$colist[$ii][is_reply] = false;
$colist[$ii][is_edit] = false;
$colist[$ii][is_del] = false;
if ($is_comment_write || $is_admin)
{
if ($member[mb_id])
{
if ($corow[mb_id] == $member[mb_id] || $is_admin)
{
$colist[$ii][del_link] = "./delete_comment.php?bo_table=$bo_table&comment_id=$corow[wr_id]&cwin=$cwin&page=$page&token=$token".$qstr;
$colist[$ii][is_edit] = true;
$colist[$ii][is_del] = true;
}
}
else
{
if (!$corow[mb_id]) {
$colist[$ii][del_link] = "./password.php?w=x&bo_table=$bo_table&comment_id=$corow[wr_id]&cwin=$cwin&page=$page".$qstr;
$colist[$ii][is_del] = true;
}
}
if (strlen($corow[wr_comment_reply]) < 5)
$colist[$ii][is_reply] = true;
}
// 05.05.22
// 답변있는 코멘트는 수정, 삭제 불가
if ($ii > 0 && !$is_admin)
{
if ($corow[wr_comment_reply])
{
$tmp_comment_reply = substr($corow[wr_comment_reply], 0, strlen($corow[wr_comment_reply]) - 1);
if ($tmp_comment_reply == $colist[$ii-1][wr_comment_reply])
{
$colist[$ii-1][is_edit] = false;
$colist[$ii-1][is_del] = false;
}
}
}
$t_name= $colist[$ii][name];
$t_content= $colist[$ii][content];
$t_date= $colist[$ii][datetime];
$t_id= $colist[$ii][wr_id];
echo "<div style='padding:5 10 10 10;text-align:justify;' >";
for ($tc= 0; $tc< strlen($colist[$ii][wr_comment_reply]); $tc++) echo " ";
if($c_secret_f)
echo "<span class='small' style='color:#ff6600;'>$t_content</span> <span class='c_date'>$t_date</span>";
else {
if ($colist[$ii][wr_homepage]) { echo "<a href=\"http://{$colist[$ii][wr_homepage]}\">"; }
else if ($colist[$ii][wr_email]) { echo "<a href=\"mailto:{$colist[$ii][wr_email]}\">"; }
else {echo "<a name=\"\">"; }
echo "<span class='c_name'><NOBR>$t_name</NOBR></span></a> <span class='c_date'>$t_date</span>";
if ($colist[$ii][is_del])
echo " <a href=\"javascript:comment_delete('{$colist[$ii][del_link]}');\" class='write'>-</a> ";
if(strstr($corow[wr_option], "secret"))
echo "<span style='color:#999999;'><br />* $t_content";
else
echo "<br />$t_content";}
echo "</div>";}
?>
<!-- 코멘트 리스트 끝 -->
</td></tr>
<? } // 전체 루프끝 ?>
<? if (count($list) == 0) { ?>
<tr><td height="100" align="center">There's no article related.</td></tr>
<? } ?>
</table>
<!-- 페이지 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td height="1" colspan="2" style="background: url('<?=$board_skin_path?>/img/line.gif');"></td></tr>
<tr>
<td width="75%" height="10" class="t7 color_999" style='padding:2px 10px'>
<? if (($member[mb_id] && ($member[mb_id] == $list[$i][mb_id])) || $is_admin) { ?>
<a href="./write.php?w=u&bo_table=<?=$bo_table?>&wr_id=<?=$wr_id?>&page=<?=$page?>" class="write">mod</a>
<a href="javascript:if (confirm('Are you sure to delete?')) { location='./delete.php?w=d&bo_table=<?=$bo_table?>&wr_id=<?=$list[$i][wr_id]?>&page=<?=$page?>&token=<?=$token?>';}" class="write">del</a><? } ?>
<? if ($write_href) { ?> <a href="<?=$write_href?>">write</a><? } ?>
<? if ($admin_href) { ?><a href="<?=$admin_href?>"> *</a><?}?>
</td>
<td width="25%" align=right class="t7 color_999" style="padding:10px">
<? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\">prev</a> "; } ?>
<? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\">next</a> "; } ?>
<?
// 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
//echo $write_pages;
$write_pages = str_replace("처음", "<<", $write_pages);
$write_pages = str_replace("이전", "Prev", $write_pages);
$write_pages = str_replace("다음", "Next", $write_pages);
$write_pages = str_replace("맨끝", ">>", $write_pages);
$write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "$1", $write_pages);
$write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><font class=\"color_gold2\">$1</font></b>", $write_pages);
?>
<?=$write_pages?>
<? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/btn_search_next.gif' border=0 align=absmiddle title='다음검색'></a>"; } ?>
</td>
</tr>
</table>
<!-- 페이지 표시 끝 -->
</td></tr>
</table>
<!-- 댓글쓰기 양식 -->
<span id=list_write style="display:inline; width:100%; padding:10;">
<table width=93% align="right" border=0 cellpadding=1 cellspacing=0><tr><td>
<form name="fwrite" method="post" action="./write_comment_update.php" onsubmit="return fviewcomment_submit(this);" autocomplete="off">
<input type=hidden name=w id=list_w value='c'>
<input type=hidden name=bo_table value='<?=$bo_table?>'>
<input type=hidden name=wr_id id=list_id value='<?=$wr_id?>'>
<input type=hidden name=wr_subject value="<?=$subject?>">
<input type=hidden name=comment_id id='comment_id' value=''>
<input type=hidden name=sca value='<?=$sca?>' >
<input type=hidden name=sfl value='<?=$sfl?>' >
<input type=hidden name=stx value='<?=$stx?>'>
<input type=hidden name=spt value='<?=$spt?>'>
<input type=hidden name=page value='<?=$page?>'>
<input type=hidden name=cwin value='<?=$cwin?>'>
<input type=hidden name=is_good value=''>
<table width=100% cellpadding=3 cellspacing=0>
<tr>
<br><br>
<td colspan="2">
<textarea id="wr_content" name="wr_content" rows=4 itemname="내용" required
<? if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');"<?}?> style='width:100%; word-break:break-all;' class=tx></textarea>
<? if ($comment_min || $comment_max) { ?><script type="text/javascript"> check_byte('wr_content', 'char_count'); </script><?}?>
</td></tr>
<tr>
<td class="t7" align="right">
<? if ($is_guest) { ?>
name <INPUT type=text maxLength=20 size=10 name="wr_name" itemname="이름" class=ed>
pass <INPUT type=text size=10 name="wr_password" itemname="패스워드" class=ed>
<? } ?>
secret<input type=checkbox id="wr_secret" name="wr_secret" value="secret">
<? if ($comment_min || $comment_max) { ?><span id=char_count></span>characters<?}?>
<? if ($is_guest) { ?>
<input type=hidden name=zsfCodeResult id="zsfCodeResult" value="" valign="bottom">
<img id='kcaptcha_image' border='0' style="cursor:pointer;" title="글자가 잘안보이는 경우 코멘트창을 리로드...!" width="60" height="17">
<input title="왼쪽의 글자를 입력하세요." type="input" name="wr_key" size="10" itemname="자동등록방지" required class=ed>
<? } ?>
<input type="image" src="<?=$board_skin_path?>/img/comment.gif" border=0 accesskey='s'></div>
</td>
</tr>
</table>
</form>
</td></tr></table>
<!-- 댓글쓰기 양식 끝 -->
<script type="text/javascript">
function file_download(link, file) {
<? if ($board[bo_download_point] < 0) { ?>if (confirm("'"+decodeURIComponent(file)+"' 파일을 다운로드 하시면 포인트가 차감(<?=number_format($board[bo_download_point])?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"))<?}?>
document.location.href=link;
}
</script>
<script type="text/javascript" src="<?="$g4[path]/js/board.js"?>"></script>
<script type="text/javascript">
window.onload=function() {
resizeBoardImage(<?=(int)$board[bo_image_width]?>);
drawFont();
}
</script>
<script type="text/javascript"> var md5_norobot_key = ''; </script>
<script type="text/javascript" src="<?="$g4[path]/js/prototype.js"?>"></script>
<script type="text/javascript">
function comment_delete(url)
{
if (confirm("Are you sure to delete the comment?")) location.href = url;
}
</script>
<?
if (!$member[mb_id])
echo "<script language='javascript' src='$g4[path]/js/md5.js'></script>\n";
echo "<script language='javascript'> var g4_cf_filter = '$config[cf_filter], '; </script>\n";
echo "<script language='javascript' src='$g4[path]/js/filter.js'></script>\n";
?>
<script type="text/javascript">
function imageClick() {
var url = "<?=$g4[bbs_path]?>/kcaptcha_session.php";
var para = "";
var myAjax = new Ajax.Request(
url,
{
method: 'post',
asynchronous: true,
parameters: para,
onComplete: imageClickResult
});
}
function imageClickResult(req) {
var result = req.responseText;
var img = document.createElement("IMG");
img.setAttribute("src", "<?=$g4[bbs_path]?>/kcaptcha_image.php?t=" + (new Date).getTime());
document.getElementById('kcaptcha_image').src = img.getAttribute('src');
md5_norobot_key = result;
}
<? if (!$member[mb_id]) { ?>Event.observe(window, "load", imageClick);<? } ?>
var old_id, new_id;
var save_html = document.getElementById('list_write').innerHTML;
function list_box(list_id, work)
{
imageClick();
if (list_id){
if (work == 'r')
new_id = 'reply_' + list_id;
else
new_id = 'edit_' + list_id;
}
else
new_id = 'list_write';
if (old_id == new_id) {
var mode = document.getElementById(new_id).style.display;
if (mode == 'inline') {
document.getElementById(new_id).style.display = 'none';
}
else {
document.getElementById(new_id).style.display = 'inline';
}
}
else {
if (old_id){
document.getElementById(old_id).style.display = 'none';
document.getElementById(old_id).innerHTML = '';
}
document.getElementById(new_id).style.display = 'inline';
document.getElementById(new_id).innerHTML = save_html;
if (work == 'u'){
document.getElementById('list_content').value = document.getElementById('save_content_' + list_id).value;
var commentObj = eval("document.getElementById('comment_" + list_id + "')");
if(commentObj != null)
if(commentObj.style.display == 'none') commentObj.style.display = 'inline';
else
commentObj.style.display = 'none';
}
document.getElementById('list_id').value = list_id;
document.getElementById('list_w').value = 'c';
old_id = new_id;
}
}
list_box('', '');
new_id = 'list_write';
document.getElementById(new_id).style.display = 'none';
function fviewcomment_submit(f)
{
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
f.is_good.value = 0;
/*
var s;
if (s = word_filter_check(document.getElementById('wr_content').value))
{
alert("내용에 금지단어('"+s+"')가 포함되어있습니다");
document.getElementById('wr_content').focus();
return false;
}
*/
var subject = "";
var content = "";
$.ajax({
url: "<?=$board_skin_path?>/ajax.filter.php",
type: "POST",
data: {
"subject": "",
"content": f.wr_content.value
},
dataType: "json",
async: false,
cache: false,
success: function(data, textStatus) {
subject = data.subject;
content = data.content;
}
});
if (content) {
alert("prohibited word:"+content+" included");
f.wr_content.focus();
return false;
}
// 양쪽 공백 없애기
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
document.getElementById('wr_content').value = document.getElementById('wr_content').value.replace(pattern, "");
if (char_min > 0 || char_max > 0)
{
check_byte('wr_content', 'char_count');
var cnt = parseInt(document.getElementById('char_count').innerHTML);
if (char_min > 0 && char_min > cnt)
{
alert("코멘트는 "+char_min+"글자 이상 쓰셔야 합니다.");
return false;
} else if (char_max > 0 && char_max < cnt)
{
alert("코멘트는 "+char_max+"글자 이하로 쓰셔야 합니다.");
return false;
}
}
else if (!document.getElementById('wr_content').value)
{
alert("are you trying to say something with a black?");
return false;
}
if (typeof(f.wr_name) != 'undefined')
{
f.wr_name.value = f.wr_name.value.replace(pattern, "");
if (f.wr_name.value == '')
{
alert('name field required');
f.wr_name.focus();
return false;
}
}
if (typeof(f.wr_password) != 'undefined')
{
f.wr_password.value = f.wr_password.value.replace(pattern, "");
if (f.wr_password.value == '')
{
alert('contact field required');
f.wr_password.focus();
return false;
}
}
if (!check_kcaptcha(f.wr_key)) {
return false;
}
return true;
}
</script>
댓글 전체
echo "<div style='padding:5 10 10 10;text-align:justify;' >";
for ($tc= 0; $tc< strlen($colist[$ii][wr_comment_reply]); $tc++) echo " ";
if($c_secret_f)
echo "<span class='small' style='color:#ff6600;'>$t_content</span> <span class='c_date'>$t_date</span>";
else {
if ($colist[$ii][wr_homepage]) { echo "<a href=\"http://{$colist[$ii][wr_homepage]}\">"; }
else if ($colist[$ii][wr_email]) { echo "<a href=\"mailto:{$colist[$ii][wr_email]}\">"; }
else {echo "<a name=\"\">"; }
echo "<span class='c_name'><NOBR>$t_name</NOBR></span></a> <span class='c_date'>$t_date</span>";
if ($colist[$ii][is_del])
echo " <a href=\"javascript:comment_delete('{$colist[$ii][del_link]}');\" class='write'>-</a> ";
if(strstr($corow[wr_option], "secret"))
echo "<span style='color:#999999;'><br />* $t_content";
else
echo "<br />$t_content";}
echo "</div>";}
이 부분이 코멘트 출력하는 부분이고요
줄이미지 태그를 for($tc=0 ~) 안에 추가해주세요
답변 달아주셔서 감사합니다, 흥힝힝님.
그런데 제가 초보라ㅠㅠ 흥힝힝님이 답변해주신 내용을 적용하는 방법을 잘 모르겠습니다ㅠ;
style="background: url('<?=$board_skin_path?>/img/line.gif');" 이걸 각 코멘트 아래쪽에 적용하고 싶은데.. 어떻게 하면 좋을지... 죄송하지만 조금 구체적으로 부탁드려도 될까요ㅜㅜ?
그런데 제가 초보라ㅠㅠ 흥힝힝님이 답변해주신 내용을 적용하는 방법을 잘 모르겠습니다ㅠ;
style="background: url('<?=$board_skin_path?>/img/line.gif');" 이걸 각 코멘트 아래쪽에 적용하고 싶은데.. 어떻게 하면 좋을지... 죄송하지만 조금 구체적으로 부탁드려도 될까요ㅜㅜ?
echo "<div style='padding:5 10 10 10;text-align:justify;border-bottom:1px dashed #ddd;'>";
for ($tc= 0; $tc< strlen($colist[$ii][wr_comment_reply]); $tc++) echo " ";
div style을 적용하니까 되는군요ㅠㅠ 해결하고 혹시나 해서 덧글로 남기고 갑니다....
for ($tc= 0; $tc< strlen($colist[$ii][wr_comment_reply]); $tc++) echo " ";
div style을 적용하니까 되는군요ㅠㅠ 해결하고 혹시나 해서 덧글로 남기고 갑니다....