當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserAuth::check_clon_votes方法代碼示例

本文整理匯總了PHP中UserAuth::check_clon_votes方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserAuth::check_clon_votes方法的具體用法?PHP UserAuth::check_clon_votes怎麽用?PHP UserAuth::check_clon_votes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserAuth的用法示例。


在下文中一共展示了UserAuth::check_clon_votes方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Match

$match = new Match($id);
if (!$match->read_basic()) {
    error(_('partido inexistente'));
}
if (!$match->is_votable()) {
    error(_('votos cerrados'));
}
if ($current_user->user_id == 0) {
    error(_('Los votos anónimos están deshabilitados'));
}
if ($current_user->user_id != $_REQUEST['user']) {
    error(_('usuario incorrecto'));
}
// Check the user is not a clon by cookie of others that voted the same link
if ($current_user->user_id > 0 && $match->status != 'published') {
    if (UserAuth::check_clon_votes($current_user->user_id, $match->id, 5, 'links') > 0) {
        error(_('no se puede votar con clones'));
    }
}
try {
    $match->insert_vote($vote);
} catch (Exception $e) {
    error($e->getMessage());
}
echo $match->json_votes_info(intval($vote));
function error($mess)
{
    $dict['error'] = $mess;
    echo json_encode($dict);
    die;
}
開發者ID:brainsqueezer,項目名稱:fffff,代碼行數:31,代碼來源:league_vote.php

示例2: Comment

$comment = new Comment();
$comment->id = $id;
if (!$comment->read_basic()) {
	error(_('comentario inexistente'));
}

if ($comment->author == $current_user->user_id) {
	error(_('no puedes votar a tus comentarios'));
}

if ($comment->date < time() - $globals['time_enabled_comments']) {
	error(_('votos cerrados'));
}

// Check the user is not a clon by cookie of others that voted the same cooemnt
if (UserAuth::check_clon_votes($current_user->user_id, $id, 5, 'comments') > 0) {
	error(_('no se puede votar con clones'));
}


if ($value > 0) {
	$votes_freq = intval($db->get_var("select count(*) from votes where vote_type='comments' and vote_user_id=$current_user->user_id and vote_date > subtime(now(), '0:0:30') and vote_value > 0 and vote_ip_int = ".$globals['user_ip_int']));
	$freq = 10;
} else {
	$votes_freq = intval($db->get_var("select count(*) from votes where vote_type='comments' and vote_user_id=$current_user->user_id and vote_date > subtime(now(), '0:0:30') and vote_value <= 0 and vote_ip_int = ".$globals['user_ip_int']));
	$freq = 5;
}

if ($votes_freq > $freq) {
	if ($current_user->user_id > 0 && $current_user->user_karma > 4) {
    	// Crazy votes attack, decrease karma
開發者ID:rasomu,項目名稱:chuza,代碼行數:31,代碼來源:menealo_comment.php


注:本文中的UserAuth::check_clon_votes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。