Dean C
01-19-2003, 06:33 PM
Hi,
In editpost.php there is a query whereby it remembers whether a user is subscribed to a thread...
This is the code:
if ($email) {
if (!$checkid=$DB_site->query_first("SELECT subscribethreadid FROM subscribethread WHERE userid=$postinfo[userid] AND threadid=$threadinfo[threadid]")) {
$DB_site->query("INSERT INTO subscribethread (subscribethreadid,userid,threadid) VALUES (NULL,$postinfo[userid],$threadinfo[threadid])");
} // else : already subscribed, so no need to do that again
} else {
if ($checkid=$DB_site->query_first("SELECT subscribethreadid FROM subscribethread WHERE userid=$postinfo[userid] AND threadid=$threadinfo[threadid]")) {
$DB_site->query("DELETE FROM subscribethread WHERE userid=$postinfo[userid] AND threadid=$threadinfo[threadid]");
} // else : already unsubscribed, so no need to unsubscribe
}
Now i want similar code in newreply.php so if a user is subscribed the tickbox for "Email Notification" is ticked and if they're not subscribed i want it unticked..
Hopefully you know what i mean :)
Regards
- miSt
In editpost.php there is a query whereby it remembers whether a user is subscribed to a thread...
This is the code:
if ($email) {
if (!$checkid=$DB_site->query_first("SELECT subscribethreadid FROM subscribethread WHERE userid=$postinfo[userid] AND threadid=$threadinfo[threadid]")) {
$DB_site->query("INSERT INTO subscribethread (subscribethreadid,userid,threadid) VALUES (NULL,$postinfo[userid],$threadinfo[threadid])");
} // else : already subscribed, so no need to do that again
} else {
if ($checkid=$DB_site->query_first("SELECT subscribethreadid FROM subscribethread WHERE userid=$postinfo[userid] AND threadid=$threadinfo[threadid]")) {
$DB_site->query("DELETE FROM subscribethread WHERE userid=$postinfo[userid] AND threadid=$threadinfo[threadid]");
} // else : already unsubscribed, so no need to unsubscribe
}
Now i want similar code in newreply.php so if a user is subscribed the tickbox for "Email Notification" is ticked and if they're not subscribed i want it unticked..
Hopefully you know what i mean :)
Regards
- miSt