versgui
Enregistré le 12/06/2003
Messages: 643
Non connecté
|
Sujet : [0.7.2] Amélioration de "Stop de notif"
Ajouté le : 18/06/2004 23:35
Message :
Voici le hack original qui a été élaboré par Tiger : http://tiger.storm.free.fr/site/articles.php?id=45
Je propose une petite amélioration a ce hack.
Fichier detail.php:
// ###### Navigation ######
if($_USER[userstatus]>1)
{
if($_REQUEST[action]=="stopnotify")
{
$sql->query("UPDATE ".$_PRE."posts SET notifyme='N' WHERE parent='".$_GET[id]."' AND idmembre='".$_USER[userid]."'");
}
if($_REQUEST[action]=="gonotify")
{
$sql->query("UPDATE ".$_PRE."posts SET notifyme='Y' WHERE parent='".$_GET[id]."' AND idmembre='".$_USER[userid]."'");
}
$query = $sql->query("SELECT parent FROM ".$_PRE."posts WHERE parent='".$_GET[id]."'");
$DetailMsg = mysql_fetch_array($query);
$num = $sql->query("SELECT * FROM ".$_PRE."posts WHERE notifyme='Y' AND parent='".$DetailMsg[parent]."' AND idmembre='".$_USER[userid]."'");
$nbrnum = mysql_num_rows($num);
if($nbrnum == "0")
{
$tpl->box[stopnotify]=$tpl->gettemplate("detail","gonotify");
}
else
{
$tpl->box[stopnotify]=$tpl->gettemplate("detail","stopnotify");
}
}
$ForumInfo[cattitle]=getformatrecup($ForumInfo[cattitle]);
Template tpl_detail.html, rajoutez tout en bas:
<!--********** TPL NAME = stopnotify **********-->
<a href="detail.php?forumid={%::_GET[forumid]%}&id={%::_GET[id]%}&p={%::_GET[p]%}&action=stopnotify" class=lien>Ne plus être notifié de l'ajout de nouveaux messages à ce topic</a><br>
<!--********** TPL NAME = gonotify **********-->
<a href="detail.php?forumid={%::_GET[forumid]%}&id={%::_GET[id]%}&p={%::_GET[p]%}&action=gonotify" class=lien>Etre notifié de l'ajout de nouveaux messages à ce topic</a><br>
Et toujours tpl_detail.html, ligne 60 environ:
<font size={%::_SKIN[smallfont]%}>
{%box[numberpages]%}
{%box[stopnotify]%}
</font>
En bref, ce hack permet une meilleur gestion de la notification par mail : le lien change en fonction si on a demandé la notification ou pas
*** Message édité par versgui le 18/06/2004 23:35 ***
|