From 8ac71a212eb3bfd9e01bbecaea3dfe44e638fd45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Sun, 29 May 2011 23:53:39 +0200 Subject: [PATCH] Correction d'*encore* un bug sur j'aime( pas)? --- code/serveur/php/ressources/backend.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/serveur/php/ressources/backend.inc b/code/serveur/php/ressources/backend.inc index 617fc06..c5db1a5 100644 --- a/code/serveur/php/ressources/backend.inc +++ b/code/serveur/php/ressources/backend.inc @@ -6,6 +6,7 @@ require_once("ressources/db.inc"); /* Les prototypes des fonctions : *===============================> +* getGidFromPgid($user, $pgid); * checkLogin($user, $passwd); * randomCenterNode(); * randomCloudNode(); @@ -747,7 +748,7 @@ function setJAimePgid($user, $pgid, $value) { $value = intval($value) / abs(intval($value) || 1); // Calcule le signe de $value : -1 ou 0 ou 1 $original = getJAimePgid($user, $pgid); getDB()->querySingle("UPDATE played_game SET like = ".$value." WHERE login = '".SQLite3::escapeString($user)."' and pgid = ".longStrVal($pgid).";"); - $gid = getGidFromPgid(longStrVal($pgid)); + $gid = getGidFromPgid($user, longStrVal($pgid)); getDB()->querySingle("UPDATE game SET nb_like = nb_like".($original == 1 ? " - 1" : "").($value == 1 ? " + 1" : "")." WHERE gid = ".intval($gid).";"); getDB()->querySingle("UPDATE game SET nb_dislike = nb_dislike".($original == -1 ? " - 1" : "").($value == -1 ? " + 1" : "")." WHERE gid = ".intval($gid).";"); }