
테터에는 있는데 조그에는 없는것 중 하나인 비공개 덧글 기능입니다.
물론 아직 완성된 모습을 보이는것은 아니지만 아래의 파일아이콘 기능 추가처럼 여러 조거들이 수많이 아이디어를 줄것이기에 미완의 상태로 공개를 합니다.
먼저 이기능은 DB를 추가해야 하기때문에 DB를 사용할줄 모르는 사용자들은 패치하지 말아주셨으면 합니다.
1. DB 추가
먼저 아래의 파일을 제로보드 폴더에 올린후 실행을 하면 디비가 추가됩니다.
[#!_보이기..|숨기기.._!#]
<?
include "lib.php";
$connect=dbConn();
$member=member_info();
if(!$member[no]) Error("먼저 최고관리자로 로그인하시기 바랍니다.");
if($member[is_admin]!=1) error("최고관리자만이 설치할 수 있습니다.");
echo "<center><font style=font-size:9pt>";
$result = @mysql_query("SELECT name FROM $admin_table");
while(@extract(mysql_fetch_array($result))) {
@mysql_query("ALTER TABLE `zetyx_board_comment"."_$name` add (is_secret int(2) not null default '0');",$connect);
echo "mysql/$t_board"."comment_"."_$name 테이블이 정상적으로 변환되었습니다.<br>";
@flush();
}
echo "</center>";
@flush();
?>
[#!_END_!#]
2. zog / comment_view.php 파일 수정
196 줄 아래를 다음과 같이 변경
수정3 dream2u 님의 조언에 따라 비공개 덧글 사용자의 이름도 비공개로 수정(2005/07/02 19:20)
[#!_보이기..|숨기기.._!#]
// 비공개 덧글 패치 시작 by 유메미루
if(!$c_data[is_secret]=='1' || $_SESSION['zog_logged'.$id])
{
$out = str_replace('<$CommentsBody$>',(trim($memo)), $out);
$out = str_replace('<$CommentsAuthor$>', $comment_name . $keyname , $out);
}
else {
$out = str_replace('<$CommentsBody$>','관리자만 볼 수 있는 비공개덧글입니다.', $out);
$out = str_replace('<$CommentsAuthor$>', '비공개'. '', $out);
}
$out = str_replace('<$CommentsDateTime$>',strftime(DATE_COMMENT_FORMAT,$c_data[reg_date]), $out);
// 비공개 덧글 패치 끝.
echo $out;
[#!_END_!#]
3. zog/comment_ok.php 파일 수정
88번쨰 줄 아래를 다음과 같이 변경
[#!_보이기..|숨기기.._!#]
// 코멘트 입력
// 비공개 덧글 패치 by 유메미루
mysql_query("insert into $t_comment"."_$id (parent,ismember,name,password,memo,reg_date,ip,is_secret) values ('$parent','$member[no]','$name','$password','$memo','$reg_date','$REMOTE_ADDR','$is_secret')") or error(mysql_error());
리플진또는 다른 블로그로 날라간 글에서도 덧글이 보이지 않도록 패치(수정 2,2006/07/02 19:00, 수정3)
//update 2004-04-02 시작
$tblink = mysql_fetch_array(mysql_query("select sitelink2,subject from $t_board"."_$id where no = '$no'", $connect));
if($is_secret=='1')
{
$memo="관리자만 볼수 있는 비공개 덧글입니다.";
$name="비공개";
}
[#!_END_!#]
4. 스킨파일/comment.html 파일 수정
아래의 빨간색 부분을 사용하는 스킨에 맞게 넣어두시면 됩니다. 단 <ifknownUser> ~ </ifknownUser> 사이에만 두지 않는 다면 사용에는 큰 무리가 없을듯합니다.
<ifknownUser>
<div id="co-input">
<label for="name">이름</label>
<input type="text" id="name" name="name" value="" size="30" class="txt" /><br />
<label for="password">비밀번호</label>
<input type="password" id="password" name="password" size="30" class="txt" /><br />
<label for="comment_homepage" size="30">홈페이지</label>
<input type="text" id="comment_homepage" name="comment_homepage" value="http://" class="txt" /><br />
</div>
</ifknownUser>
<div id="co-submit">
<textarea name="memo" cols="65" rows="4"></textarea><br />
<input type="checkbox" id="saveInfo" name="saveInfo" onclick="ol_noticeSave();" />
<label id="saveInfoLabel" for="saveInfo" style="cursor:pointer;">내 정보 기억</label>
<input type="checkbox" id="is_secret" name="is_secret" value="1" />
<label for="is_secret">비밀글</label>
<input type="submit" value=" 남기기 " onfocus="this.blur()" style="cursor:pointer;" class="btn" />
이게 전부는 아닐겁니다... 조그를 좋아하시는 분들이 하나둘씩 조언을 해주시면 지속적으로 업데이트를 거쳐 조그 기본기능으로 만들어 봅시다.!!!
수정 1. ol_comments 플러그인 수정 at 2005/07/02 17:00
plugin/ol_comments/index.php 파일
이 플러그인을 수정해야 덧글 목록으로 볼수 없게 할수 있습니다.
[#!_보이기..|숨기기.._!#]
if($ol7_data[is_secret]=='1')
{
$ol7_list .= str_replace('<$ol_commentsLink$>', $index_url . "?no=" . $ol7_data[parent], $ol7_loop[1]);
$ol7_list = str_replace('<$ol_commentsBody$>','비공개덧글입니다.' ,$ol7_list);
$ol7_list = str_replace('<$ol_commentsIcon$>', ol7_is_new($ol7_data[reg_date]), $ol7_list);
$ol7_list = str_replace('<$ol_commentsAuthor$>', '비공개', $ol7_list);
}
else
{
$ol7_list .= str_replace('<$ol_commentsLink$>', $index_url . "?no=" . $ol7_data[parent], $ol7_loop[1]);
$ol7_list = str_replace('<$ol_commentsBody$>', trim($ol7_subject), $ol7_list);
$ol7_list = str_replace('<$ol_commentsIcon$>', ol7_is_new($ol7_data[reg_date]), $ol7_list);
$ol7_list = str_replace('<$ol_commentsAuthor$>', $ol7_data[name], $ol7_list);
}
[#!_END_!#]
수정 4 : dream2u님의 조언으로 거의 완성 단계에 이르렀습니다. 아직 미흡한 점은 이벤트 로그를 볼경우 그대로 다 보인다는 점인데 그 부분은 이벤트 로그를 메뉴에서 빼주셨으면 합니다.,,.이벤트 로그가 그져 보이기만 하는 것이라면 문제가 없지만 msn 연동기능과도 소통이 되므로 가능하다면 그대로 유지하고 싶습니다. 2006/07/03 12:30