Okay, this much now works. Links no longer builds index pages for category 91 which I call "Default". Problem is it still puts category "Default" on the home page with a dead end hyperlink to /Default/index.shtml. Where do I look to keep it from building into the home page as well?
unless($id eq "91"){#begin unless $id=91
$clean_name = $db->as_url($name);
$page = $CFG->{build_root_path} . "/" . $clean_name . '/' . $CFG->{build_index};
$url = $CFG->{build_root_url} . "/" . $clean_name . '/' . $CFG->{build_index};
$USE_HTML ?
print "\tBuilding category <a href='$url' target='_blank'>$name</a> ... \n" :
print "\tBuilding category $name ... \n";
_build_dir ($clean_name);
$total = $catlink_db->count ( { 'CatLinks.CategoryID' => $id, isValidated => 'Yes' } );
print "\t\tLinks: $total\n";
# Do sub-pages if requested.
if ($CFG->{build_span_pages}) {
$lpp = $CFG->{build_links_per_page} || 25;
$num_pages = int ($total / $lpp);
($total % $lpp) and ($num_pages++);
# Create the main page.
open (PAGE, "> $page") or _cant_open($page, $!);
print PAGE Links::Build::build ('category', { id => $id, nh => 1, mh => $lpp });
close PAGE;
my $perms = oct ($CFG->{build_file_per});
chmod ($perms, $page);
# Create the sub pages.
for (2 .. $num_pages) {
$page = $CFG->{build_root_path} . "/" . $clean_name . '/' . "more" . $_ . $CFG->{build_extension};
$url = $CFG->{build_root_url} . "/" . $clean_name . "/" . "more" . $_ . $CFG->{build_extension};
$USE_HTML ?
print "\t\tBuilding subpage: <a href='$url' target='_blank'>$_</a>\n" :
print "\t\tBuilding subpage: $page\n";
open (PAGE, "> $page") or _cant_open($page, $!);
print PAGE Links::Build::build ('category', { id => $id, nh => $_, mh => $lpp });
close PAGE;
chmod ($perms, $page);
}
}
else {
open (PAGE, "> $page") or _cant_open($page, $!);
print PAGE Links::Build::build ('category', { id => $id });
close PAGE;
my $perms = oct ($CFG->{build_file_per});
chmod ($perms, $page);
}
print "\tDone\n\n";
}#end unless $id=91
}
print "Finished building categories (", _time_display(), " s)\n\n";Mark Brasche
http://SurfSafely.com/
Code:
while (my ($id, $name) = $sth->fetchrow_array) { unless($id eq "91"){#begin unless $id=91
$clean_name = $db->as_url($name);
$page = $CFG->{build_root_path} . "/" . $clean_name . '/' . $CFG->{build_index};
$url = $CFG->{build_root_url} . "/" . $clean_name . '/' . $CFG->{build_index};
$USE_HTML ?
print "\tBuilding category <a href='$url' target='_blank'>$name</a> ... \n" :
print "\tBuilding category $name ... \n";
_build_dir ($clean_name);
$total = $catlink_db->count ( { 'CatLinks.CategoryID' => $id, isValidated => 'Yes' } );
print "\t\tLinks: $total\n";
# Do sub-pages if requested.
if ($CFG->{build_span_pages}) {
$lpp = $CFG->{build_links_per_page} || 25;
$num_pages = int ($total / $lpp);
($total % $lpp) and ($num_pages++);
# Create the main page.
open (PAGE, "> $page") or _cant_open($page, $!);
print PAGE Links::Build::build ('category', { id => $id, nh => 1, mh => $lpp });
close PAGE;
my $perms = oct ($CFG->{build_file_per});
chmod ($perms, $page);
# Create the sub pages.
for (2 .. $num_pages) {
$page = $CFG->{build_root_path} . "/" . $clean_name . '/' . "more" . $_ . $CFG->{build_extension};
$url = $CFG->{build_root_url} . "/" . $clean_name . "/" . "more" . $_ . $CFG->{build_extension};
$USE_HTML ?
print "\t\tBuilding subpage: <a href='$url' target='_blank'>$_</a>\n" :
print "\t\tBuilding subpage: $page\n";
open (PAGE, "> $page") or _cant_open($page, $!);
print PAGE Links::Build::build ('category', { id => $id, nh => $_, mh => $lpp });
close PAGE;
chmod ($perms, $page);
}
}
else {
open (PAGE, "> $page") or _cant_open($page, $!);
print PAGE Links::Build::build ('category', { id => $id });
close PAGE;
my $perms = oct ($CFG->{build_file_per});
chmod ($perms, $page);
}
print "\tDone\n\n";
}#end unless $id=91
}
print "Finished building categories (", _time_display(), " s)\n\n";
http://SurfSafely.com/