summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorINOPIAE <inopiae@cacert.org>2013-12-08 12:15:28 +0100
committerINOPIAE <inopiae@cacert.org>2013-12-08 12:15:28 +0100
commit0335ec43f3dc09cc28b246fb046ddd659c983326 (patch)
tree3b905699fb1fb621ae65c4d2fa848233078648a5
parent111d0d44dd4f7a8b6c4d8bec6197bc2314a345f1 (diff)
downloadcacert-devel-0335ec43f3dc09cc28b246fb046ddd659c983326.tar.gz
cacert-devel-0335ec43f3dc09cc28b246fb046ddd659c983326.tar.xz
cacert-devel-0335ec43f3dc09cc28b246fb046ddd659c983326.zip
bug 1138: added function get_alerts
-rw-r--r--includes/notary.inc.php10
-rw-r--r--pages/account/43.php4
-rw-r--r--pages/account/59.php17
3 files changed, 29 insertions, 2 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php
index 1c6f8ed..bca285b 100644
--- a/includes/notary.inc.php
+++ b/includes/notary.inc.php
@@ -1168,3 +1168,13 @@ function get_user_data($userid, $deleted=0){
$query = "select * from `users` where `users`.`id`='$userid' ".$filter;
return mysql_query($query);
}
+
+/**
+ * get_alerts()
+ * retrns all alert settings for one user
+ * @param mixed $userid for the requested account
+ * @return
+ */
+function get_alerts($userid){
+ return mysql_fetch_assoc(mysql_query("select * from `alerts` where `memid`='".intval($userid)."'"));
+} \ No newline at end of file
diff --git a/pages/account/43.php b/pages/account/43.php
index 177d261..7e4d00a 100644
--- a/pages/account/43.php
+++ b/pages/account/43.php
@@ -115,7 +115,9 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php");
$query = "select sum(`points`) as `points` from `notary` where `to`='".intval($row['id'])."'";
$dres = mysql_query($query);
$drow = mysql_fetch_assoc($dres);
- $alerts = mysql_fetch_assoc(mysql_query("select * from `alerts` where `memid`='".intval($row['id'])."'"));
+// comment to be deleted before release
+// $alerts = mysql_fetch_assoc(mysql_query("select * from `alerts` where `memid`='".intval($row['id'])."'"));
+ $alerts =get_alerts(intval($row['id']));
//display account data
?>
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
diff --git a/pages/account/59.php b/pages/account/59.php
index 3911cfe..4c5b63f 100644
--- a/pages/account/59.php
+++ b/pages/account/59.php
@@ -29,6 +29,7 @@ $suffix = $row['suffix'];
$dob = $row['dob'];
$name = $fname." ".$mname." ".$lname." ".$suffix;
$email = $row['email'];
+$alerts =get_alerts($userid)
?>
<table>
<tr>
@@ -81,7 +82,21 @@ $email = $row['email'];
<td class="DataTD"><?=_("Ad Admin")?>:</td>
<td class="DataTD"><?= $row['adadmin']._(' - 0 = none, 1 = submit, 2 = approve')?></td>
</tr>
-
+ <td class="DataTD"><?=_("General Announcements")?>:</td>
+ <td class="DataTD"><?= ($alerts['general']==0)? _('No'):_('Yes')?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Country Announcements")?>:</td>
+ <td class="DataTD"><?= ($row['id']==0)? _('No'):_('Yes')?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Regional Announcements")?>:</td>
+ <td class="DataTD"><?= ($row['id']==0)? _('No'):_('Yes')?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Within 200km Announcements")?>:</td>
+ <td class="DataTD"><?= ($row['id']==0)? _('No'):_('Yes')?></td>
+ </tr>
<tr>
<td colspan="<? $colspandefault ?>" class="title"><?=_('Address')?></td>