Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Re: nph-build problem -- abort or looping

Quote Reply
Re: nph-build problem -- abort or looping In reply to
Thanks! But sorry, I get an error. I give you the scripts, where I put the changes, maybe you know, what I've done wrong:


in the ngh-build.cgi:

sub build_category_pages {
# --------------------------------------------------------
# This routine builds all the category pages. Each category uses
# the same template which is defined in &site_html_category.
#
my ($s, $e, $f, $limit, $offset, $get_related, $subcat_info, $get_links, $get_alt);

print "Building category pages ... \n\n";
$s = time();

$limit = &Links::DB_Utils::get_totalcats; $offset = 0;
$subcat_info = $CATDB->prepare ( qq!
SELECT Category.*
FROM Category, CategoryHierarchy
WHERE CategoryHierarchy.CategoryID = ? AND
CategoryHierarchy.Depth = 1 AND
CategoryHierarchy.SubCategoryID = Category.ID
!) or die "Can't prepare: $DBI::errstr";
$get_related = $LINKDB->prepare (" SELECT Category.Name FROM CategoryRelations, Category WHERE CategoryRelations.CategoryID = ? AND CategoryRelations.RelatedID = Category.ID");
$get_links = $LINKDB->prepare (" SELECT * FROM Links WHERE CategoryID = ? ORDER BY $LINKS{build_sort_order_category} LIMIT 1000 ");
$get_alt = $LINKDB->prepare (" SELECT l.* FROM Links as l, CategoryAlternates as c WHERE l.ID = c.LinkID AND c.CategoryID = ? ORDER BY $LINKS{build_sort_order_category} LIMIT 1000 ");

my ($categories_r, $links_r, $category_r, $subcategory_r, $alt_r, $total_links);
my ($directory, $url, $numlinks, $page_num, $tmp, $name, %OUT);

###while (1) {
$categories_r = $CATDB->query ( { ID => '*', mh => $limit, nh => $offset+1, sb => 'Name', so => 'ASC', tb => 0 });
###last unless ($categories_r and @{$categories_r} > 0);

foreach $category_r (@{$categories_r}) {



in the DB_Utils.pm:

sub get_totalcats {
#-----------------------------------------------------
my ($CATDB, $GRAND_TOTAL);
$GRAND_TOTAL = 0;
$CATDB = new Links::DBSQL "$LINKS{admin_root_path}/defs/Category.def";
$GRAND_TOTAL = $CATDB->total();
return $GRAND_TOTAL;
}


sub cgi_to_hash {
# --------------------------------------------------------
# Converts a CGI object to a hash ref.
#
my $in = shift;
my %rec = ();
foreach ($in->param) { $rec{$_} = join "\0", $in->param($_); }
return \%rec;
}



and in the HTML_Template:

# You can put variables here that you would like to use in any
# of your templates.

%GLOBALS = (
date => \&Links::DBSQL::get_date,
time => \&Links::DBSQL::get_time,
db_cgi_url => $LINKS{db_cgi_url},
build_root_url => $LINKS{build_root_url},
site_title => $LINKS{build_site_title},
css => $LINKS{build_css_url},
totalcats => &Links::DB_Utils::get_totalcats,
banner => ''

);


Subject Author Views Date
Thread nph-build problem -- abort or looping pugdog 11629 Aug 29, 2000, 12:32 PM
Thread Re: nph-build problem -- abort or looping
Stealth 11494 Aug 29, 2000, 12:38 PM
Thread Re: nph-build problem -- abort or looping
qango 11389 Aug 29, 2000, 1:32 PM
Post Re: nph-build problem -- abort or looping
Stealth 11379 Aug 29, 2000, 1:40 PM
Thread Re: nph-build problem -- abort or looping
startpoint 11406 Aug 29, 2000, 2:24 PM
Thread Re: nph-build problem -- abort or looping
Stealth 11393 Aug 29, 2000, 3:39 PM
Thread Re: nph-build problem -- abort or looping
qango 11398 Aug 29, 2000, 3:47 PM
Thread Re: nph-build problem -- abort or looping
Stealth 11415 Aug 29, 2000, 3:52 PM
Thread Re: nph-build problem -- abort or looping
pugdog 11395 Aug 30, 2000, 1:25 AM
Thread Re: nph-build problem -- abort or looping
Alex404 11403 Aug 30, 2000, 3:30 AM
Thread Re: nph-build problem -- abort or looping
pugdog 11380 Aug 30, 2000, 6:11 AM
Thread Re: nph-build problem -- abort or looping
Alex404 11370 Aug 30, 2000, 6:36 AM
Thread Re: nph-build problem -- abort or looping
Stealth 11350 Aug 30, 2000, 7:51 AM
Thread Re: nph-build problem -- abort or looping
AndreasH 11379 Aug 30, 2000, 4:04 PM
Thread Re: nph-build problem -- abort or looping
Stealth 11356 Aug 30, 2000, 5:05 PM
Thread Re: nph-build problem -- abort or looping
AndreasH 11357 Aug 30, 2000, 5:20 PM
Thread Re: nph-build problem -- abort or looping
pugdog 11381 Aug 30, 2000, 6:02 PM
Thread Re: nph-build problem -- abort or looping
AndreasH 11362 Aug 30, 2000, 6:14 PM
Thread Re: nph-build problem -- abort or looping
pugdog 11381 Aug 30, 2000, 6:29 PM
Thread Re: nph-build problem -- abort or looping
AndreasH 11367 Aug 30, 2000, 6:50 PM
Post Re: nph-build problem -- abort or looping
pugdog 11357 Aug 30, 2000, 7:30 PM
Thread Re: nph-build problem -- abort or looping
Alex404 11378 Aug 31, 2000, 12:42 AM
Thread Re: nph-build problem -- abort or looping
AndreasH 11353 Aug 31, 2000, 10:58 AM
Thread Re: nph-build problem -- abort or looping
pugdog 11329 Aug 31, 2000, 2:06 PM
Thread to Alex
AndreasH 4438 Aug 31, 2000, 2:51 PM
Thread Re: to Alex
Stealth 4415 Aug 31, 2000, 3:09 PM
Thread Re: to Alex
AndreasH 4423 Aug 31, 2000, 3:18 PM
Post Re: to Alex
Stealth 4396 Aug 31, 2000, 3:25 PM
Thread Re: nph-build problem -- abort or looping
AndreasH 4435 Aug 31, 2000, 4:30 PM
Thread Re: nph-build problem -- abort or looping
pugdog 4407 Aug 31, 2000, 5:51 PM
Thread Re: nph-build problem -- abort or looping
AndreasH 4405 Aug 31, 2000, 6:27 PM
Thread Re: nph-build problem -- abort or looping
Alex404 4402 Sep 1, 2000, 1:38 AM
Post Re: nph-build problem -- abort or looping
AndreasH 4390 Sep 1, 2000, 3:32 AM
Post To all who helped me!
AndreasH 4379 Sep 1, 2000, 4:44 PM
Post Re: nph-build problem -- abort or looping
Alex404 11363 Aug 30, 2000, 7:50 AM