' . oc_('Discussion Threads') . ' » '; printHeader(oc_('Discussion Options'), 2); // submission? if (isset($_POST['ocaction']) && ($_POST['ocaction'] == 'Save Options')) { if (isset($_POST['oc_discussion_notification']) && preg_match("/^[01]$/", $_POST['oc_discussion_notification'])) { // delete current setting if any $q = "DELETE FROM `" . OCC_TABLE_MODULE_OC_DISCUSSION_NOTIFICATION . "` WHERE `accountid`='" . safeSQLstr($uid) . "'"; $r = ocsql_query($q) or err('Unable to update notification option'); // add setting if no email to be received if ($_POST['oc_discussion_notification'] == 0) { $q = "INSERT INTO `" . OCC_TABLE_MODULE_OC_DISCUSSION_NOTIFICATION . "` SET `accountid`='" . safeSQLstr($uid) . "', `notification`=0"; $r = ocsql_query($q) or err('Unable to update notification option (2)'); } print '
' . oc_('Options saved') . '
'; } } // Get notification status if ! chair $notification = 1; if ($uid != 0) { $q = "SELECT `notification` FROM `" . OCC_TABLE_MODULE_OC_DISCUSSION_NOTIFICATION . "` WHERE `accountid`='" . safeSQLstr($uid) . "'"; $r = ocsql_query($q) or err('Unable to retrieve notification status'); if (mysql_num_rows($r) == 1) { $l = mysql_fetch_assoc($r); if ($l['notification'] == 0) { $notification = 0; } } } $notificationOptions = ' '; print ' '; printFooter();