Subject: CAcert Code Development list.
List archive
- From: dirk astrath <dastrath AT gmx.de>
- To: cacert-devel AT lists.cacert.org, Philipp Guehring <philipp AT cacert.org>, Alexander Prinsier <aphexer AT mailhaven.com>
- Subject: a new trip ... a new (okay) oatched /wot/10.php
- Date: Thu, 09 Jul 2009 10:23:03 +0200
hiya,
i'm on tour again ... this time to work 'only' ... and i detected, that
it's rediculous, to do a select-case for every assurance you made or
got, when you list up your points ...
therefore i decided to make a change from
<?
$query = "select * from `notary` where
`to`='".intval($_SESSION['profile']['id'])."'";
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
$fromuser = mysql_fetch_assoc(mysql_query("select * from
`users` where
`id`='".intval($row['from'])."'"));
?>
to
<?
$query = "select users.fname, users.lname, notary.id, notary.date,
notary.from, notary.points, notary.location, notary.method from `notary`
left outer join users on users.id = notary.from where
`to`='".intval($_SESSION['profile']['id'])."' order by notary.id desc";
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
// $fromuser = mysql_fetch_assoc(mysql_query("select * from
`users`
where `id`='".intval($row['from'])."'"));
?>
using my piece of code there is only one sql-call to get the data ...
not > 500 in a case of a top 10-assurer ...
(okay ... about 30 lines above in the 10.wot there is nearly then same
for the assuring in the other direction ... so there are 2 sql-commands
instead of > 500 ;-) )
this means: less workload for the sql-server ... ;-)
however:
i added another change to this 10.wot, if you read the patched lines
carefully:
using the old routine, the assurances are listed on the chronological
order from oldest to newest ... which means, i have to scroll a long way
down to see the newest one ...
using my patch, the oldest assurance is at the bottom, the newest is on
top ... which means, i can see, who assured me last without having to
scroll ... ;-)
if this behaviour is not wanted, the 'desc' in the 'order by notary.id
desc' has to be omitted ...
what to you think about it?
have a nice day ...
ps: the patched file will be placed on test1.cacert.at during the day
... philipp and alexander will get it by mail ...
Attachment:
signature.asc
Description: OpenPGP digital signature
- a new trip ... a new (okay) oatched /wot/10.php, dirk astrath, 07/09/2009
- Re: a new trip ... a new (okay) oatched /wot/10.php, Alexander Prinsier, 07/09/2009
Archive powered by MHonArc 2.6.16.