当前位置: 首页>>代码示例>>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;未经允许,请勿转载。