mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
improve dont sign in user also can vote
This commit is contained in:
parent
ac8a5338cb
commit
884ecbd02e
2 changed files with 4 additions and 15 deletions
|
|
@ -84,12 +84,12 @@
|
|||
<div class="vote">
|
||||
<ul>
|
||||
<li>
|
||||
<a cond="$oDocument->getVoted() === false || $oDocument->getVoted() < 0" href="#" onclick="doCallModuleAction('document','procDocumentVoteUp','{$oDocument->document_srl}');return false;"|cond="$is_logged" class="voted"> <i class="xi-thumbs-up"></i><br>{$lang->cmd_vote} {$oDocument->get('voted_count')}</a>
|
||||
<a cond="$oDocument->getVoted() > 0" href="#" onclick="doCallModuleAction('document','procDocumentVoteUpCancel','{$oDocument->document_srl}');return false;"|cond="$is_logged" class="voted"> <i class="xi-thumbs-up"></i><br>{$lang->cmd_vote} {$oDocument->get('voted_count')}</a>
|
||||
<a cond="$oDocument->getVoted() === false || $oDocument->getVoted() < 0" href="#" onclick="doCallModuleAction('document','procDocumentVoteUp','{$oDocument->document_srl}');return false;" class="voted"> <i class="xi-thumbs-up"></i><br>{$lang->cmd_vote} {$oDocument->get('voted_count')}</a>
|
||||
<a cond="$oDocument->getVoted() > 0" href="#" onclick="doCallModuleAction('document','procDocumentVoteUpCancel','{$oDocument->document_srl}');return false;" class="voted"> <i class="xi-thumbs-up"></i><br>{$lang->cmd_vote} {$oDocument->get('voted_count')}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a cond="$oDocument->getVoted() === false || $oDocument->getVoted() > 0" herf="#" onclick="doCallModuleAction('document','procDocumentVoteDown','{$oDocument->document_srl}');return false;"|cond="$is_logged" class="voted"> <i class="xi-thumbs-down"></i><br>{$lang->cmd_vote_down} {$oDocument->get('blamed_count')}</a>
|
||||
<a cond="$oDocument->getVoted() < 0" herf="#" onclick="doCallModuleAction('document','procDocumentVoteDownCancel','{$oDocument->document_srl}');return false;"|cond="$is_logged" class="voted"> <i class="xi-thumbs-down"></i><br>{$lang->cmd_vote_down} {$oDocument->get('blamed_count')}</a>
|
||||
<a cond="$oDocument->getVoted() === false || $oDocument->getVoted() > 0" herf="#" onclick="doCallModuleAction('document','procDocumentVoteDown','{$oDocument->document_srl}');return false;" class="voted"> <i class="xi-thumbs-down"></i><br>{$lang->cmd_vote_down} {$oDocument->get('blamed_count')}</a>
|
||||
<a cond="$oDocument->getVoted() < 0" herf="#" onclick="doCallModuleAction('document','procDocumentVoteDownCancel','{$oDocument->document_srl}');return false;" class="voted"> <i class="xi-thumbs-down"></i><br>{$lang->cmd_vote_down} {$oDocument->get('blamed_count')}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ class documentController extends document
|
|||
*/
|
||||
function procDocumentVoteUp()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
$document_srl = Context::get('target_srl');
|
||||
if(!$document_srl) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
|
|
@ -46,8 +44,6 @@ class documentController extends document
|
|||
|
||||
function procDocumentVoteUpCancel()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
$document_srl = Context::get('target_srl');
|
||||
if(!$document_srl) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
|
|
@ -90,8 +86,6 @@ class documentController extends document
|
|||
*/
|
||||
function procDocumentVoteDown()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
$document_srl = Context::get('target_srl');
|
||||
if(!$document_srl) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
|
|
@ -112,8 +106,6 @@ class documentController extends document
|
|||
|
||||
function procDocumentVoteDownCancel()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
$document_srl = Context::get('target_srl');
|
||||
if(!$document_srl) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
|
|
@ -1311,7 +1303,6 @@ class documentController extends document
|
|||
$_SESSION['voted_document'][$document_srl] = false;
|
||||
return new Object(-1, $failed_voted);
|
||||
}
|
||||
|
||||
// Create a member model object
|
||||
$oMemberModel = getModel('member');
|
||||
$member_srl = $oMemberModel->getLoggedMemberSrl();
|
||||
|
|
@ -1326,7 +1317,6 @@ class documentController extends document
|
|||
return new Object(-1, $failed_voted);
|
||||
}
|
||||
}
|
||||
|
||||
// Use member_srl for logged-in members and IP address for non-members.
|
||||
$args = new stdClass();
|
||||
if($member_srl)
|
||||
|
|
@ -1345,7 +1335,6 @@ class documentController extends document
|
|||
$_SESSION['voted_document'][$document_srl] = false;
|
||||
return new Object(-1, $failed_voted);
|
||||
}
|
||||
|
||||
// begin transaction
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue