Gossamer Forum
Home : Products : Links 2.0 : Customization :

Messed up my link counts - help please

Quote Reply
Messed up my link counts - help please
Hi everyone,

I installed a mod to allow multi categories (loopy's) and had a few problems, searched the forums and created an upgrade script which sort of fixed it...

Anyway I fixed the links.db but now all the link counts for my categories are doubled up...

So a category with 10 links will say there are 20 for example.

How do I fix this ?

Thanks

Sean
Quote Reply
Re: [Seanhk] Messed up my link counts - help please In reply to
Recheck your code changes... In nph-build.cgi, in the sub build_stats, verify the red:

----------
my (@values, $category, $cat, @alt_categories, @categorylist, $depth, $i, $cat, %unique_categories);



# 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.
%unique_categories = "";

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) {
if (! defined ($unique_categories{$cat})) {
$unique_categories{$cat} += 1;
$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;
-----------

For others, this mod is available at:
http://www.online-sweepstakes.com/links-mods/


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Messed up my link counts - help please In reply to
Hi PerlFlunkie,

My code changes were correct, I corrected the problem by editing the db file and inserting a column of |0| where the alternative category data was supposed to be.

Sean