2005년 7월 2일 토요일

비공개 덧글 패치


테터에는 있는데 조그에는 없는것 중 하나인  비공개 덧글 기능입니다.


물론 아직 완성된 모습을 보이는것은 아니지만 아래의 파일아이콘 기능 추가처럼 여러 조거들이 수많이 아이디어를 줄것이기에 미완의 상태로 공개를 합니다.


먼저 이기능은 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


 

댓글 29개:

  1. ol_comments 플러그인 관련 수정하였습니다,.

    답글삭제
  2. 비밀 댓글 입니다.

    답글삭제
  3. 비밀 댓글 입니다.

    답글삭제
  4. 으흠. 위에 리플은 리플진에 그냥 공개로 올라왔는데, 밑에껀 수정을 하셨나보군요.

    작성자 이름도 비공개로 띄울 수 없을까요? &#039;-&#039;

    예전에 알릭님께서도 비공개덧글패치를 만드셨었는데, 아마 공개를 안하셨었죠.

    <!-- <homepage>http://foulup.nazzim.net/bbs/view.php?id=replzine&no=1736</homepage> -->

    답글삭제
  5. * 드림투유 // 제가 알기로는 제로보드용으로만 만드셨던걸로 알고 있습니다..작성자도 비공개로 하기는 쉬울듯 합니다.곧 패치업하도록 하죠,,

    답글삭제
  6. 비밀 댓글 입니다.

    답글삭제
  7. 시나브로블로그2005년 7월 2일 오후 8:41

    <a href="http://joydpr.new21.org/BG2/" target=_blank ><b>시나브로블로그에서 퍼감</b></a><BR/>

    답글삭제
  8. 오..알릭님이 만드신거 2.51넘어오면서 날라갔었는데..

    이걸로 다시 달아봐야겠군요. ^^

    <!-- <homepage>http://foulup.nazzim.net/bbs/view.php?id=replzine&no=1736</homepage> -->

    답글삭제
  9. 음...설치해보려 했는데..초보가 설치하기에 좀 설명이 부족합니다..-_ㅜ<br />

    comment_view.php 수정하라 하셨는데,<br />

    줄 수는 이것저것 손보다 보면 바뀌는 것이라..<br />

    바로 위에 어디를 남기고 바로 밑에 어디까지를 두고 수정을 해야할런지...<br />

    ol_comments도 그렇구요.<!-- <homepage>http://dreams2u.net</homepage> -->

    답글삭제
  10. 리플진또는 다른 블로그로 날라간 글에서도 덧글이 보이지 않도록 패치<br />

    부분은 comment_view.php파일을 수정하는게 아닌 듯 한데,<br />

    어느 파일인지요?;<!-- <homepage>http://dreams2u.net</homepage> -->

    답글삭제
  11. 음..comment_view는 196째줄이 아니라 195째줄 if 시작구문부터<br />

    echo $out<br />

    까지를 수정하니 되는군요.<br />

    <br />

    ol_comments는 변수에 두가지가 더 있던데요<br />

    if($ol7_data[is_secret]==&#039;1&#039;) <br />

    {<br />

    $ol7_list .= str_replace(&#039;<$ol_commentsLink$>&#039;, $index_url . "?no=" . $ol7_data[parent], $ol7_loop[1]);<br />

    $ol7_list = str_replace(&#039;<$ol_commentsBody$>&#039;,&#039;비공개덧글입니다.&#039; ,$ol7_list);<br />

    $ol7_list = str_replace(&#039;<$ol_commentsIcon$>&#039;, ol7_is_new($ol7_data[reg_date]), $ol7_list);<br />

    $ol7_list = str_replace(&#039;<$ol_commentsAuthor$>&#039;, &#039;비공개&#039;, $ol7_list); <br />

    }<br />

    else <br />

    { <br />

    <br />

    $ol7_list .= str_replace(&#039;<$ol_commentsLink$>&#039;, $index_url . "?no=" . $ol7_data[parent], $ol7_loop[1]);<br />

    $ol7_list = str_replace(&#039;<$ol_commentsBody$>&#039;, trim($ol7_subject), $ol7_list);<br />

    $ol7_list = str_replace(&#039;<$ol_commentsIcon$>&#039;, ol7_is_new($ol7_data[reg_date]), $ol7_list);<br />

    $ol7_list = str_replace(&#039;<$ol_commentsAuthor$>&#039;, $ol7_data[name], $ol7_list);<br />

    }<br />

    <br />

    로 수정해야 제대로 보이더군요..<br />

    <br />

    남은건 리플진등으로 트랙백 전송하는것인데..<br />

    어느파일의 어느부분 수정해야하는지 가르쳐주세요~~<br />

    <!-- <homepage>http://dreams2u.net</homepage> -->

    답글삭제
  12. 후우..comment_ok.php 였군요.<br />

    패치 완료한것같네요..^^<br />

    잘쓰겠습니다~

    답글삭제
  13. <a href="http://www.dreams2u.net/blog/?no=516" target=_blank ><b>비공개코멘트 적용</b></a><BR/><A class=AutoLinkType_blue href="http://www.zeeps.net/blog/?no=157" target=_blank>유메미루</A>님께서 공개하신<BR><BR>비공개 코멘트 기능을 적용했습니다.<BR>이것저것 찾아가며 적용하다보니<BR>거진 30분이 걸렸네요.<BR><BR>사용방법은 뭐 간단하죠.<BR>코멘트 다는 란에 보면 비밀글 부분 체크하시면 됩니다.<BR><BR>비밀글 체크하고 쓰신 글은<BR>저 말고는 아무도 못봐요~<BR><BR>음침하고 어두운 코멘트라거나<BR>비밀스런 사랑의 밀어라거나<BR>마음껏 남겨주세요~<BR><BR>라지만, 아무도 기능을 안쓰면..OTL

    답글삭제
  14. 친구 블로그에 적용시키는데, ol_comments를 사용하지 않는 경우의 수정방법도 올려주시면 고맙겠습니다..^^;<!-- <homepage>http://dreams2u.net</homepage> -->

    답글삭제
  15. 비밀 댓글 입니다.

    답글삭제
  16. 윗글은 실수로 비밀글체크를 해버렸네요.<br />

    유메미루님의 경우에도 이벤트로그를 보면 비공개코멘트가<br />

    그대로 보이는군요..^^;

    답글삭제
  17. 아..태그가 먹혀버렸네요. &ltifknownuser&gt 태그위에 비밀글박스부분을 위치시켰습니다.

    답글삭제
  18. 드림투유 // 덕분에 최대한 빨리 소스 수정을 완료한것 같습니다., 감사합니다..<br />

    이제 또 다시 테터 따라잡기 3탄을 준비해야 할 시간이듯 합니다..

    답글삭제
  19. 블로그 메뉴상에 이벤트로그를 없앤다고 해도,<br />

    유메미루님같은경우에도 tools->eventlog를 클릭해서 보면<br />

    이벤트로그는 나오죠. 그렇게까지 할 사람이 있을까 싶기도 하지만,<br />

    조그를 아는 사람이라면 메뉴에서 빼놔도 주소를 직접 입력해서<br />

    확인할 수도 있을 테구요. 이벤트로그도 수정을 하는것이<br />

    가장 확실할것같은데요<!-- <homepage>http://dreams2u.net</homepage> -->

    답글삭제
  20. 음,,그럼 이벤트 로그 상단에 관리자만 볼수 잇도록 소스를 추가하는 방법으로 우회해서 돌파하도록 하죠,,아마도 그 방법도 하나의 대안이 될수 있으리라 봅니다..

    답글삭제
  21. 그것도 괜찮겠네요. 그럼 추가 부탁드립니다. ^^

    <!-- <zogNick><A HREF=&#039;http://www.dreams2u.net/blog/&#039; title=&#039;http://www.dreams2u.net/blog/&#039; target=_blank ><img border=0 alt=&#039;드림투유&#039; border=&#039;0&#039; src=&#039;http://www.dreams2u.net/blog//webmsg/2.jpg&#039;></A></zogNick> <zogURL>http://www.dreams2u.net/blog/</zogURL> -->

    답글삭제
  22. 비밀 댓글 입니다.

    답글삭제
  23. 예전에 저도 만들어서... 적용하고.. 설치가 복잡스러워서 공개를 못하고.. 드림투유님에게만 설치해드리고 쓰던 기억이 나네요.. (제 조그엔 지금도 적용되어있죠...ㅡ.ㅡ) 음.. 전 최근이벤트에 비밀글이라고 DB 에 넣어버렸던거 같네요....



    비밀글이라면..리플진으로 아예 전송 안시켜버리는것도 좋을것 같구요...



    어디 어디 고&#52451;엇는지 생각이 않나네요..ㅋㅋ

    <!-- <homepage>http://foulup.nazzim.net/bbs/view.php?id=replzine&no=1736</homepage> -->

    답글삭제
  24. 음.. 조그를 제로보드로 ..그러니까..게시판 형태로 보게되면...비밀글도 다 보여지게 됩니다.. 그렇기 때문에.. 어쩔수 없이. 제로보드에도 패치를 해줄수 밖에 없구요... 또... comment_ok.php 에서 비밀리플일때는 inputUpdata 에 내용을 확 비밀글로 넣어줘도 될듯합니다.. 어짜피 관리자는 그 리플을 읽을수 있으니까요... 뭐 여기저기.. 완전 않보이게 만들기 위해서 막아줘야할 구멍들이 몇개 있었던 기억이 납니다.

    <!-- <homepage>http://foulup.nazzim.net/bbs/view.php?id=replzine&no=1736</homepage> -->

    답글삭제
  25. poohoot&#039;s paradise2005년 8월 24일 오전 9:53

    <a href="http://www.poohoot.co.kr/blog/" target=_blank ><b>poohoot&#039;s paradise에서 퍼감</b></a><BR/>잘 할수있을지 모르겠으나 일단 펌.

    답글삭제
  26. 안녕하세요 ^^;<br />

    다름이 아니고 제가 ol_comments 를 쓰지 않는데요.<br />

    비밀댓글을 모두 적용을 했는데, 최근 코멘트 목록엔 그냥 바로 나옵니다.<br />

    어떤 파일을 수정하면 되는지요?<br />

    꼭 좀 가르쳐 주세요. 부탁 드리겠습니다. ^^;

    <!-- <zogNick><A HREF=&#039;http://blog.hhwkds.com:8888/dsblog/&#039; title=&#039;http://blog.hhwkds.com:8888/dsblog/&#039; target=_blank ><img border=0 alt=&#039;SeokiE&#039; border=&#039;0&#039; src=&#039;http://blog.hhwkds.com:8888/dsblog//webmsg/genie_nameicon.gif&#039;></A></zogNick> <zogURL>http://blog.hhwkds.com:8888/dsblog/</zogURL> -->

    답글삭제
  27. SeokiE // ol_comment를 사용하지 않으시려면 index 파일을 수정하는 방법외에는 없습니다..

    답글삭제
  28. 그러게요~<br />

    어떻게 수정을 해야할지 몰라서요.<br />

    아시는대로 답변 좀.... 죄송 ^^;<!-- <homepage>http://hhwkds.com</homepage> -->

    답글삭제
  29. SeokiE // 조그 폴더의 index.php 파일에서 replace_comments($str) 함수를 찾아 적당히 바꾸시면 됩니다..제가 도움을 드릴것은 여기까지인듯합니다..

    답글삭제