<?php
/***************************************************************************
- * Copyright (C) 2003-2004 Polytechnique.org *
+ * Copyright (C) 2003-2006 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
if (Env::has('medal_op')) {
if (Env::get('medal_op')=='retirer' && Env::getInt('medal_id')) {
- $globals->xdb->execute("DELETE FROM profile_medals_sub WHERE uid = {?} AND mid = {?}", Session::getInt('uid', -1), Env::getInt('medal_id', -1));
+ XDB::execute("DELETE FROM profile_medals_sub WHERE uid = {?} AND mid = {?}", S::v('uid', -1), Env::getInt('medal_id', -1));
}
if (Env::get('medal_op')=='ajouter' && Env::getInt('medal_id')) {
- $globals->xdb->execute("INSERT INTO profile_medals_sub (uid,mid) VALUES ({?}, {?})", Session::getInt('uid', -1), Env::getInt('medal_id'));
+ XDB::execute("INSERT INTO profile_medals_sub (uid,mid) VALUES ({?}, {?})", S::v('uid', -1), Env::getInt('medal_id'));
}
}
if (Post::has('grade')) {
foreach (Post::getMixed('grade') as $mid=>$gid) {
- $globals->xdb->execute('UPDATE profile_medals_sub SET gid={?} WHERE uid={?} AND mid={?}', $gid, Session::getInt('uid'), $mid);
+ XDB::execute('UPDATE profile_medals_sub SET gid={?} WHERE uid={?} AND mid={?}', $gid, S::v('uid'), $mid);
}
}
-$res = $globals->xdb->query(
+$res = XDB::query(
"SELECT m.id, m.text AS medal, m.type, m.img, s.gid
FROM profile_medals_sub AS s
INNER JOIN profile_medals AS m ON ( s.mid = m.id )
- WHERE s.uid = {?}", Session::getInt('uid', -1));
+ WHERE s.uid = {?}", S::v('uid', -1));
$medals = $res->fetchAllAssoc();
-$res = $globals->xdb->query("SELECT profile_medals_pub FROM auth_user_quick WHERE user_id = {?}", Session::getInt('uid', -1));
+$res = XDB::query("SELECT profile_medals_pub FROM auth_user_quick WHERE user_id = {?}", S::v('uid', -1));
$medals_pub = $res->fetchOneCell();
if(Env::has('modifier') || Env::has('suivant')) {