추천/비추 언어변수 설정 및 적용

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4143 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-04-25 02:07:25 +00:00
parent 4d51ddc3ee
commit 56a1809dd0
8 changed files with 36 additions and 19 deletions

View file

@ -360,8 +360,11 @@
* @brief 해당 document의 추천수 증가
**/
function updateVotedCount($document_srl, $point = 1) {
if($point > 0) $failed_voted = 'failed_voted';
else $failed_voted = 'failed_blamed';
// 세션 정보에 추천 정보가 있으면 중단
if($_SESSION['voted_document'][$document_srl]) return new Object(-1, 'failed_voted');
if($_SESSION['voted_document'][$document_srl]) return new Object(-1, $failed_voted);
// 문서 원본을 가져옴
$oDocumentModel = &getModel('document');
@ -370,7 +373,7 @@
// 글의 작성 ip와 현재 접속자의 ip가 동일하면 패스
if($oDocument->get('ipaddress') == $_SERVER['REMOTE_ADDR']) {
$_SESSION['voted_document'][$document_srl] = true;
return new Object(-1, 'failed_voted');
return new Object(-1, $failed_voted);
}
// document의 작성자가 회원일때 조사
@ -382,7 +385,7 @@
// 글쓴이와 현재 로그인 사용자의 정보가 일치하면 읽었다고 생각하고 세션 등록후 패스
if($member_srl && $member_srl == $oDocument->get('member_srl')) {
$_SESSION['voted_document'][$document_srl] = true;
return new Object(-1, 'failed_voted');
return new Object(-1, $failed_voted);
}
}
@ -398,33 +401,33 @@
// 로그 정보에 추천 로그가 있으면 세션 등록후 패스
if($output->data->count) {
$_SESSION['voted_document'][$document_srl] = true;
return new Object(-1, 'failed_voted');
return new Object(-1, $failed_voted);
}
// 추천수 업데이트
if($point < 0)
{
$args->blamed_count = $oDocument->get('blamed_count') + $point;
$output = executeQuery('document.updateBlamedCount', $args);
}
else
{
$args->voted_count = $oDocument->get('voted_count') + $point;
$output = executeQuery('document.updateVotedCount', $args);
}
if($point < 0)
{
$args->blamed_count = $oDocument->get('blamed_count') + $point;
$output = executeQuery('document.updateBlamedCount', $args);
}
else
{
$args->voted_count = $oDocument->get('voted_count') + $point;
$output = executeQuery('document.updateVotedCount', $args);
}
// 로그 남기기
$args->point = $point;
$args->point = $point;
$output = executeQuery('document.insertDocumentVotedLog', $args);
// 세션 정보에 남김
$_SESSION['voted_document'][$document_srl] = true;
// 결과 리턴
if($point > 0)
return new Object(0, 'success_voted');
else
return new Object(0, 'success_blamed');
if($point > 0)
return new Object(0, 'success_voted');
else
return new Object(0, 'success_blamed');
}
/**