* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: notifs.php,v 1.2 2004-11-04 19:57:42 x2000habouzit Exp $
+ $Id: notifs.php,v 1.3 2004-11-05 13:49:15 x2000habouzit Exp $
***************************************************************************/
require("auto.prepend.inc.php");
$notifs->add_promo($val);
};
break;
+
case 'del_promo':
$notifs->del_promo($val);
break;
+ case 'del_nonins':
+ $notifs->del_nonins($val);
+ break;
+
case 'flags':
$flags = new FlagSet();
if(isset($_REQUEST['contacts'])) $flags->addflag('contacts');
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: notifs.inc.php,v 1.3 2004-11-05 13:41:31 x2000habouzit Exp $
+ $Id: notifs.inc.php,v 1.4 2004-11-05 13:49:16 x2000habouzit Exp $
***************************************************************************/
require_once('diogenes.flagset.inc.php');
mysql_free_result($res);
$this->flags = new FlagSet($flags);
- $res = $globals->db->query("SELECT type,arg,prenom,nom,promo
+ $res = $globals->db->query("SELECT type,arg,prenom,nom,promo,u.user_id
FROM watch AS w
LEFT JOIN auth_user_md5 AS u ON(u.user_id = w.arg)
WHERE w.user_id = '$uid'
ORDER BY promo,nom,arg");
- while(list($type, $arg, $prenom, $nom, $promo) = mysql_fetch_row($res)) {
+ while(list($type, $arg, $prenom, $nom, $promo, $uid) = mysql_fetch_row($res)) {
if($type=='promo') {
$this->promos[$arg] = $arg;
} elseif($type =='non-inscrit') {
- $this->nonins[$arg] = Array('prenom'=>$prenom, 'nom'=>$nom, 'promo'=>$promo);
+ $this->nonins[$arg] = Array('prenom'=>$prenom, 'nom'=>$nom, 'promo'=>$promo, 'uid'=>$uid);
}
}
}
+ function del_nonins($p) {
+ global $globals;
+ unset($this->nonins[$p]);
+ $globals->db->query("DELETE FROM watch WHERE user_id='{$this->uid}' AND type='non-inscrit' AND arg='$p'");
+ }
+
function del_promo($p) {
global $globals;
unset($this->promos[$p]);
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: notifs.tpl,v 1.5 2004-11-05 13:41:31 x2000habouzit Exp $
+ $Id: notifs.tpl,v 1.6 2004-11-05 13:49:16 x2000habouzit Exp $
***************************************************************************}
{dynamic}
<p>
Si un non-inscrit que tu surveille s'inscrit, il sera automatiquement ajouté à tes contacts.
</p>
-
+<!--
<form action="{$smarty.server.PHP_SELF}" method="post">
<fieldset>
<legend>Ajouter un non-inscrit</legend>
<span class='smaller'>Il faut entrer le "login" (prenom.nom ou prenom.nom.promo).</span>
</fieldset>
</form>
-
+-->
<table class='tinybicol' cellpadding="0" cellspacing="0">
<tr>
<td>
<p>Tu surveilles {if $notifs->nonins|@count eq 1}le non-inscrit{else}les non-inscrits{/if} :</p>
<ul>
{foreach from=$notifs->nonins item=p}
- <li>{$p.prenom} {$p.nom} ({$p.promo})</li>
+ <li>
+ {$p.prenom} {$p.nom} ({$p.promo}) <a href="?del_nonins={$p.uid}"><img src="{"images/retirer.gif"|url}" alt="retirer" /></a>
+ </li>
{/foreach}
</ul>
{/if}