')
{
global $con;
$rs = $con->select('SELECT rate_ip FROM '.DB_PREFIX.'rate WHERE rate_post_id='.$GLOBALS['news']->f('post_id').' AND rate_ip=\''.$_SERVER["REMOTE_ADDR"].'\'','recordset', false);
// Sinon, s'il n'a jamais voté on affiche le formulaire
if ($rs->isEmpty())
{
printf($ret, $GLOBALS['news']->f('post_id'));
}
}
// getRate(): Renvois la note moyenne du billet
function getRate($ret='Rating for this post: %s(%s)')
{
global $con;
$rs = $con->select('SELECT rate_value FROM '.DB_PREFIX.'rate WHERE rate_post_id='.$GLOBALS['news']->f('post_id'),'recordset', false);
if ($rs->isEmpty())
{
printf($ret,0,0);
}else{
$tot=0;
while ($rs->fetch())
$tot += $rs->f('rate_value');
printf($ret, round(($tot / $rs->int_row_count), 2), $rs->int_row_count);
}
}
function checkNewVersion($current, $check)
{
$current = explode('.',$current);
$check = explode('.',$check);
if( $check[0] > $current[0] )
{
return true;
}elseif(( $check[0] == $current[0] ) && ( $check[1] > $current[1] )){
return true;
}else{
return false;
}
}
}
?>