diff --git a/pages/wot/1.php b/pages/wot/1.php
index 64c99a1..6a03e62 100644
--- a/pages/wot/1.php
+++ b/pages/wot/1.php
@@ -52,47 +52,29 @@
if(intval($_GET['ccid']) <= 0)
{
echo "
\n";
- $res = mysql_query("select distinct `ccid`,`countries`.`name` from `users`,`notary`,`countries` where `listme`='1' and `ccid` > 0 and
- `users`.`id`=`notary`.`to` and `ccid`=`countries`.`id` group by `notary`.`to` HAVING SUM(`points`) >= 100
- order by `countries`.`name`");
+ $query = "select * from countries where acount>0 order by `name`";
+ $res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
- $query = "select sum(`users`.`id`) as `listed` from `users`,`notary`
- where `listme`='1' and `ccid` = '$row[ccid]' and `users`.`id`=`notary`.`to`
- group by `notary`.`to` HAVING SUM(`points`) >= 100";
- $listed = mysql_num_rows(mysql_query($query));
- echo "- $row[name] ("._("Listed").": $listed)
\n";
+ echo "- $row[name] ("._("Listed").": $row[acount])
\n";
}
-
echo "
\n\n\n
\n";
} elseif(intval($_GET['ccid']) > 0 && intval($_GET['regid']) <= 0 && intval($_GET['locid']) <= 0) {
echo "\n";
- $query = "select distinct `regid`,`regions`.`name` from `users`,`notary`,`regions` where `listme`='1' and `users`.`id`=`notary`.`to` and
- `regid`=`regions`.`id` and `users`.`ccid`='".intval($_GET['ccid'])."' group by `notary`.`to`
- HAVING SUM(`points`) >= 100 order by `regions`.`name`";
+ $query = "select * from regions where ccid='".intval($_GET['ccid'])."' and acount>0 order by `name`";
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
- $query = "select sum(`users`.`id`) as `listed` from `users`,`notary`
- where `listme`='1' and `regid` = '$row[regid]' and `users`.`id`=`notary`.`to`
- group by `notary`.`to` HAVING SUM(`points`) >= 100";
- $listed = mysql_num_rows(mysql_query($query));
- echo "- $row[name] ("._("Listed").": $listed)
\n";
+ echo "- $row[name] ("._("Listed").": $row[acount])
\n";
}
echo "
\n\n\n\n\n
\n";
} elseif(intval($_GET['regid']) > 0 && intval($_GET['locid']) <= 0) {
echo "\n";
- $query = "select * from `users`,`notary` where `listme`='1' and `regid`='".intval($_GET['regid'])."' and
- `users`.`id`=`notary`.`to` group by `locid` HAVING SUM(`points`) >= 100";
+ $query = "select * from locations where regid='".intval($_GET['regid'])."' and acount>0 order by `name`";
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
- $loc = mysql_fetch_assoc(mysql_query("select * from `locations` where `id`='$row[locid]'"));
- $listed = mysql_num_rows(mysql_query("select * from `users`,`notary` where `listme`='1' and
- `locid`='".$row['locid']."' and `locid`!=0 and `users`.`id`=`notary`.`to`
- group by `notary`.`to` HAVING SUM(`points`) >= 100"));
- if($listed > 0)
- echo "- $loc[name] ("._("Listed").": $listed)
\n";
+ echo "- $row[name] ("._("Listed").": $row[acount])
\n";
}
echo "
\n\n\n\n\n
\n";
} elseif(intval($_GET['locid']) > 0){