diff --git a/pages/wot/10.php b/pages/wot/10.php index 4a6afac..cd02470 100644 --- a/pages/wot/10.php +++ b/pages/wot/10.php @@ -23,20 +23,13 @@ '$rc' ORDER BY `notary`.`when` DESC"; -*/ - $query = "SELECT count(*) AS `list` FROM `users` - inner join `notary` on `users`.`id` = `notary`.`from` - GROUP BY `notary`.`from` HAVING count(*) > '$rc'"; + $rc = intval($row['assurances']); + + $query = "SELECT COUNT(1) FROM `notary` GROUP BY `from` HAVING COUNT(1) > {$rc}"; $rank = mysql_num_rows(mysql_query($query)) + 1; ?> @@ -65,7 +58,7 @@ $maxpoints=intval($_SESSION['profile']['points'])-$row['apoints']; $points = 0; - $query = "select * from `notary` where `to`='".intval($_SESSION['profile']['id'])."' order by `id` desc "; + $query = "SELECT n.`id`, n.`date`, n.`awarded`, n.`from` as `from_id`, u.`fname` AS `from_fname`, u.`lname` AS `from_lname`, n.`location`, n.`method` FROM `notary` n LEFT JOIN `users` u ON n.`from`=u.`id` WHERE n.`to`=".intval($_SESSION['profile']['id'])." ORDER BY n.`when` DESC, n.`id` DESC"; $res = mysql_query($query); while($row = mysql_fetch_assoc($res)) { @@ -73,12 +66,11 @@ if ($points+$awarded > $maxpoints) $awarded = $maxpoints-$points; $points = $points + $awarded; - $fromuser = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".intval($row['from'])."'")); ?> - + @@ -105,17 +97,16 @@ '._("Deleted before Verification").''; else - $name = "$name"; + $name = "$name"; ?> @@ -133,4 +124,3 @@

[ ]

-