All mysql_-statments replaced by their corresponding mysqli_-statements
[cacert-devel.git] / pages / wot / 9.php
index 94523f2..ea7a384 100644 (file)
        require_once($_SESSION['_config']['filepath'].'/includes/lib/l10n.php');
 
 
-       $res = mysql_query("select * from `users` where `id`='".intval($_REQUEST['userid'])."' and `listme`='1'");
-       if(mysql_num_rows($res) <= 0)
+       $res = mysqli_query($_SESSION['mconn'], "select * from `users` where `id`='".intval($_REQUEST['userid'])."' and `listme`='1'");
+       if(mysqli_num_rows($res) <= 0)
        {
                echo _("Sorry, I was unable to locate that user, the person doesn't wish to be contacted, or isn't an assurer.");
        } else {
 
-               $user = mysql_fetch_array($res);
-               $userlang = $user['language'];
-               $points = mysql_num_rows(mysql_query("select sum(`points`) as `total` from `notary`
+               $user = mysqli_fetch_array($res);
+               $userlang = L10n::normalise_translation($user['language']);
+               $points = mysqli_num_rows(mysqli_query($_SESSION['mconn'], "select sum(`points`) as `total` from `notary`
                                where `to`='".intval($user['id'])."' and `deleted`=0 group by `to` HAVING SUM(`points`) > 0"));
                if($points <= 0) {
                        echo _("Sorry, I was unable to locate that user.");
 <? if($userlang != "") { ?>
   <tr>
     <td class="DataTD"><?=_("Language")?>:</td>
-    <?
-    $parts = explode("_", $userlang ,2);
-    $printlang = strtolower($parts[0]);
-    ?>
-    <td class="DataTD" align="left"><? printf(_("%s prefers to be contacted in %s"), sanitizeHTML($user['fname']), L10n::$translations[$printlang]) ?></td>
+    <td class="DataTD" align="left"><? printf(_("%s prefers to be contacted in %s"), sanitizeHTML($user['fname']), L10n::$translations[$userlang]) ?></td>
   </tr>
 <? } ?>
 <?
        $query = "select * from `addlang` where `userid`='".intval($user['id'])."'";
-       $res = mysql_query($query);
-       while($row = mysql_fetch_assoc($res))
+       $res = mysqli_query($_SESSION['mconn'], $query);
+       while($row = mysqli_fetch_assoc($res))
        {
-               $lang = mysql_fetch_assoc(mysql_query("select * from `languages` where `locale`='".mysql_real_escape_string($row['lang'])."'"));
+               $lang = mysqli_fetch_assoc(mysqli_query($_SESSION['mconn'], "select * from `languages` where `locale`='".mysqli_real_escape_string($_SESSION['mconn'], $row['lang'])."'"));
 ?>
   <tr>
     <td class="DataTD"><?=_("Additional Language")?>:</td>
-    <td class="DataTD" align="left"><? printf(_("%s will also accept email in %s - %s"), sanitizeHTML($user['fname']), sanitizeHTML($lang['lang']), sanitizeHTML($lang['country'])) ?></td>
+    <td class="DataTD" align="left"><? printf(_("%s will also accept email in %s - %s"), sanitizeHTML($user['fname']), $lang['lang'], $lang['country']) ?></td>
   </tr>
 <? } ?>
   <tr>