Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Re: An error message when I build

Quote Reply
Re: An error message when I build In reply to
Hi,

From lines 431 - 437 replace:

Code:
if (exists $votes{$id}) {
$values[$db_rating] = (($values[$db_rating] * $values[$db_votes]) + $rating{$id}) / ($values[$db_votes] + $votes{$id});
$values[$db_rating] = sprintf ("%.2f", $values[$db_rating]);
$values[$db_votes] = $values[$db_votes] + $votes{$id};
print "\tUpdating rating to $values[$db_rating] for link id $id\n";
}
...with...

Code:
if (exists $votes{$id}) {
$values[$db_rating] = eval { (($values[$db_rating] * $values[$db_votes]) + $rating{$id}) / ($values[$db_votes] + $votes{$id}); };
if ($@) {
print "\tUpdating rating to $values[$db_rating] for link id $id\n";
}
$values[$db_rating] = sprintf ("%.2f", $values[$db_rating]);
$values[$db_votes] = $values[$db_votes] + $votes{$id};
print "\tUpdating rating to $values[$db_rating] for link id $id\n";
}
This is a dirty solution but should work.

Mods:http://wiredon.net/gt/download.shtml
Installations:http://wiredon.net/gt/
Subject Author Views Date
Thread An error message when I build cakey 2017 Aug 16, 2001, 10:03 AM
Post Re: An error message when I build
Paul 1597 Aug 16, 2001, 10:17 AM