묻고답하기

댓글의 경우에는 comment.controller.php에서

  // invalid vote if both ip addresses between author's and the current user are same.
  if($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
  {
   $_SESSION['voted_comment'][$comment_srl] = TRUE;
   return new Object(-1, $failed_voted);
  }

이 부분을 지우면 자신의 댓글에 추천이 가능합니다. 참 쉽죠 ^0^


그럼 게시글의 경우는 어떻게 해야할까요...? 댓글처럼하면 참으로 쉬워보이는데요....

 

우선 document.controller.php를 들어가봐야겠죠..

1060줄대쯤 부근에  function updateVotedCount($document_srl, $point = 1) ... 추천과 관련된 함수가 있습니다...

조금 밑에 이부분이 있습니다.

  // Pass if the author's IP address is as same as visitor's.
  if($oDocument->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
  {
   $_SESSION['voted_document'][$document_srl] = true;
   return new Object(-1, $failed_voted);
  }

 

그 다음엔 이런식으로 이어지는군요..

  // Create a member model object
  // Check if document's author is a member.
             // Pass after registering a session if author's information is same as the currently logged-in user's.
  // Use member_srl for logged-in members and IP address for non-members.

 

흠... 하지만 이 부분을 모두 주석처리해도 자신의 글이 추천되지 않습니다.....


저는 bin님의 추천/비추천/신고 모듈을 사용중입니다. 그래서 안되는 걸까요?

그래서 vote모듈의 vote.controller.php를 들어가보았습니다..

  // 추천 세션확인   <--- 부분에 보면 다큐먼트컨트롤러와 동일하게 이런 부분이 있네요.

  // Pass if the author's IP address is as same as visitor's. 

if($logged_info->is_admin != 'Y')
  {
   if($oDocument->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
   {
    $_SESSION['voted_document'][$document_srl] = true;
    return new Object(-1, $failed_voted);
   }
  }
  else
  {
   if($config->use_adminVote != 'Y')
   {
    if($oDocument->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
    {
     $_SESSION['voted_document'][$document_srl] = true;
     return new Object(-1, $failed_voted);
    }
   }
  }

이것이 추천모듈에서 ip중복검사를 하는 부분인 것 같습니다.

하지만 이 부분을 주석처리해도 자신의 글은 추천이 되지 않습니다...

이부분과 다큐먼트컨트롤러php와 추천모듈의php 둘을 모두 주석처리해도 안되구요..

으아아 도와주십시오. 모르겠습니다 무엇을 놓친것인지..

비회원이라서 그런가요..? 아닌딩;;;; ㅠㅠㅠ

아니면 시스템적으로.. 마치 내용없이는 등록이 안되는 것과 같이 소스수정으로는 구현할 수 없는 것인가요??

아시는 분이 계셨으면 좋겠네요..ㅎㅎ