bug 1138: added function get_alerts
authorINOPIAE <inopiae@cacert.org>
Sun, 8 Dec 2013 11:15:28 +0000 (12:15 +0100)
committerINOPIAE <inopiae@cacert.org>
Sun, 8 Dec 2013 11:15:28 +0000 (12:15 +0100)
includes/notary.inc.php
pages/account/43.php
pages/account/59.php

index 1c6f8ed..bca285b 100644 (file)
@@ -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
index 177d261..7e4d00a 100644 (file)
@@ -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">
index 3911cfe..4c5b63f 100644 (file)
@@ -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>