本文整理汇总了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;
}
示例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