골라먹는 재미가 있다. 새 코멘트 표시하기...예전 코멘트와 새 코멘트가 다르게... 정보
그누호환 골라먹는 재미가 있다. 새 코멘트 표시하기...예전 코멘트와 새 코멘트가 다르게...본문
밑에 글을 보고 저도 바꿔본것이 있어서 알려드립니다.
개인적으로는 이렇게 해도 간단하군요.
아래는 bbs/gblist.php 파일입니다.
대략 86번째 줄에 보면 아래 시작과 일치합니다. 거기서부터 // 속도를 빠르게 하기 위하여 막음 이라고 써있는데 전까지 전택해서 붙여넣습니다.
보드에서 새글 표시되는 만큼 표시됩니다. 만약 새글은 48시간 했는데 코멘트는 24시간 하고 싶으시면 중간에 // 수정 시작 이라고 되있는 부분의 왼쪽에 숫자를 3600에서 2를 나눠줍니다.(혹시 모르시는 분을 위해 ^^;;; : 1800)
바로 아래처럼 새글은 48시간인데 코멘트는 24시간, 48시간이 따로 표시되게 바꾸시고 싶으시면 else문 하나 더 붙여서 만드시면 됩니다.
그냥 막 만든건데 잘 돌아갑니다. 여러분의 의견 부탁합니다.
unset($list);
$save_wr_num = $save_wr_notice = 0;
for ($i=0; $row=mysql_fetch_array($result); $i++) {
$tr = "";
if ($i && $i%$board[bo_gallery_width]==0) {
$tr = "</tr><tr>";
}
if ('' != $stext) {
$row = sql_fetch(" select * from $write_table where wr_id = '$row[wr_parent_id]' and wr_comment = '0' ");
$row2 = sql_fetch(" select * from $write_table where wr_parent_id = '$row[wr_id]' and wr_comment >= '$row[wr_commentcnt]' "); // 추가
$subject = conv_subject($row[wr_subject], $board[bo_subject_len], "…");
} else {
$subject = cut_str($row[wr_subject], $board[bo_subject_len], "…");
$subject = get_text($subject);
$row2 = sql_fetch(" select * from $write_table where wr_parent_id = '$row[wr_id]' and wr_comment >= '$row[wr_commentcnt]' "); // 추가
}
// 배열전체를 복사
$list[$i] = $row;
$list[$i][subject] = $subject;
$list[$i][content] = conv_content($row[wr_content], $row[wr_html]);
$list[$i][is_notice] = false;
if ($row[wr_notice] == -1) {
$list[$i][num] = "<font color=#FF6633>공지</font>"; //수정
$list[$i][is_notice] = true;
} else if ($save_wr_num != $row[wr_num] || $save_wr_notice != $row[wr_notice]) {
$list[$i][num] = $row[wr_num] * -1;
} else {
$list[$i][num] = " ";
}
if ($wr_id == $row[wr_id]) {
$list[$i][num] = "<font color=blue><marquee direction=right scrolldelay=150><b>→</b></marquee></font>";
}
//$list[$i][serial] = $total_count - $i - $from_record;
$list[$i][ca_name] = get_category_name($write_table, $row[ca_id]);
$list[$i][commentcnt] = "";
if ($row[wr_commentcnt]) {
if ($row2[wr_datetime] >= date("Y-m-d H:i:s", time() - $board[bo_new] * 3600)) { // 수정 시작
$list[$i][commentcnt] = "<font color=#333333><b>[$row[wr_commentcnt]]</b></font> ";
} else {
$list[$i][commentcnt] = "<font color=gray>[<font color=#999999><b>$row[wr_commentcnt]</b></font>]</font> ";
} // 수정 끝
}
$list[$i][datetime] = substr($row[wr_datetime],0,4) . "<font color=gray style={font-size:8pt; font-family:굴림;}>.</font>" . substr($row[wr_datetime],5,2) . "<font color=gray style={font-size:8pt; font-family:굴림;}>.</font>" . substr($row[wr_datetime],8,2); // 수정
개인적으로는 이렇게 해도 간단하군요.
아래는 bbs/gblist.php 파일입니다.
대략 86번째 줄에 보면 아래 시작과 일치합니다. 거기서부터 // 속도를 빠르게 하기 위하여 막음 이라고 써있는데 전까지 전택해서 붙여넣습니다.
보드에서 새글 표시되는 만큼 표시됩니다. 만약 새글은 48시간 했는데 코멘트는 24시간 하고 싶으시면 중간에 // 수정 시작 이라고 되있는 부분의 왼쪽에 숫자를 3600에서 2를 나눠줍니다.(혹시 모르시는 분을 위해 ^^;;; : 1800)
바로 아래처럼 새글은 48시간인데 코멘트는 24시간, 48시간이 따로 표시되게 바꾸시고 싶으시면 else문 하나 더 붙여서 만드시면 됩니다.
그냥 막 만든건데 잘 돌아갑니다. 여러분의 의견 부탁합니다.
unset($list);
$save_wr_num = $save_wr_notice = 0;
for ($i=0; $row=mysql_fetch_array($result); $i++) {
$tr = "";
if ($i && $i%$board[bo_gallery_width]==0) {
$tr = "</tr><tr>";
}
if ('' != $stext) {
$row = sql_fetch(" select * from $write_table where wr_id = '$row[wr_parent_id]' and wr_comment = '0' ");
$row2 = sql_fetch(" select * from $write_table where wr_parent_id = '$row[wr_id]' and wr_comment >= '$row[wr_commentcnt]' "); // 추가
$subject = conv_subject($row[wr_subject], $board[bo_subject_len], "…");
} else {
$subject = cut_str($row[wr_subject], $board[bo_subject_len], "…");
$subject = get_text($subject);
$row2 = sql_fetch(" select * from $write_table where wr_parent_id = '$row[wr_id]' and wr_comment >= '$row[wr_commentcnt]' "); // 추가
}
// 배열전체를 복사
$list[$i] = $row;
$list[$i][subject] = $subject;
$list[$i][content] = conv_content($row[wr_content], $row[wr_html]);
$list[$i][is_notice] = false;
if ($row[wr_notice] == -1) {
$list[$i][num] = "<font color=#FF6633>공지</font>"; //수정
$list[$i][is_notice] = true;
} else if ($save_wr_num != $row[wr_num] || $save_wr_notice != $row[wr_notice]) {
$list[$i][num] = $row[wr_num] * -1;
} else {
$list[$i][num] = " ";
}
if ($wr_id == $row[wr_id]) {
$list[$i][num] = "<font color=blue><marquee direction=right scrolldelay=150><b>→</b></marquee></font>";
}
//$list[$i][serial] = $total_count - $i - $from_record;
$list[$i][ca_name] = get_category_name($write_table, $row[ca_id]);
$list[$i][commentcnt] = "";
if ($row[wr_commentcnt]) {
if ($row2[wr_datetime] >= date("Y-m-d H:i:s", time() - $board[bo_new] * 3600)) { // 수정 시작
$list[$i][commentcnt] = "<font color=#333333><b>[$row[wr_commentcnt]]</b></font> ";
} else {
$list[$i][commentcnt] = "<font color=gray>[<font color=#999999><b>$row[wr_commentcnt]</b></font>]</font> ";
} // 수정 끝
}
$list[$i][datetime] = substr($row[wr_datetime],0,4) . "<font color=gray style={font-size:8pt; font-family:굴림;}>.</font>" . substr($row[wr_datetime],5,2) . "<font color=gray style={font-size:8pt; font-family:굴림;}>.</font>" . substr($row[wr_datetime],8,2); // 수정
추천
0
0
댓글 전체