Gossamer Forum
Home : Products : Links 2.0 : Customization :

Re: Need someone to Fix an Illegal division by zero

Quote Reply
Re: Need someone to Fix an Illegal division by zero In reply to
Thanks Pagla,

We have quiet a few MODs. Which have never caused problems before.

The line 447 is after :

# This adds one to the total of each category above the current category.
# We have to caluclate the affect of the link on each alt category as well as the main.
foreach $cat ($category, @alt_categories) {


The lines around this are :


# Add the link to the list of new links if it is new.
push (@{$new_links{$category}}, @values) if ($values[$db_isnew] eq "Yes");

# Add the link to the list of cool links if it is popular.
push (@{$cool_links{$category}}, @values) if ($values[$db_ispop] eq "Yes");

# This adds one to the total of each category above the current category.
# We have to caluclate the affect of the link on each alt category as well as the main.
foreach $cat ($category, @alt_categories) {

# Calculate the stats: the number of links and the newest link.
@categorylist = split (/\//, $cat);
$depth = $#categorylist;

# This adds one to the total of each category above the current category,
# and also marks any above categories new, if this link is new.
for $i (0 .. $depth) {
$stats{$cat}[0]++;
if ((!$stats{$cat}[1]) || &compare_dates($values[$db_modified], $stats{$cat}[1])) {
$stats{$cat}[1] = $values[$db_modified];
}
pop (@categorylist);
$cat = join("/", @categorylist);
}
}
}
close DB;


I think this was from the category MOD, so we can have sub categories. Any ideas. Any help is really appreciated.
Regards,

Matt


Subject Author Views Date
Thread Need someone to Fix an Illegal division by zero matthawkins 1560 Jan 3, 2001, 2:53 AM
Thread Re: Need someone to Fix an Illegal division by zero
pagla2000 1517 Jan 3, 2001, 4:26 AM
Thread Re: Need someone to Fix an Illegal division by zero
matthawkins 1515 Jan 3, 2001, 7:08 AM
Thread Re: Need someone to Fix an Illegal division by zero
matthawkins 1507 Jan 3, 2001, 10:29 AM
Post Re: Need someone to Fix an Illegal division by zero
Stealth 1475 Jan 6, 2001, 9:51 PM