Gossamer Forum
Quote Reply
Re: [Andy] Slow build In reply to
1. When i do ./nph-build.cgi - the web is reachable without any problem.

2. What do you mean with "move globals to a pm"?

I add a new file.pm with some code; then include this pm to the files like build.pm?

Here some examples:

1. directory for the detailed pages;
DIR
sub {
my ($rec) = @_;
use POSIX;
my $d = floor($rec->{ID}/1000);
return $d;
}

I need this, because i save my detailed pages in dirs /detailed/x/ID.php


2. Father (and root and others)
sub {
my $tags = shift;
my $output;
my $lang = $tags->{lang};
my $fid = $tags->{FatherID};

my $cat_db = $DB->table('Category');
$cat_db->select_options ("", "");
my $sth = $cat_db->select (['Name','Pfad'],
GT::SQL::Condition->new (
'ID','=',$fid
) );
while (my ($name,$pfad) = $sth->fetchrow_array) {
$output .= "$name";
}
utf8::encode($output);
return $output;
}

With this (and others) i make my own breadcrumps home, root, father, city


3. a picture
sub {
my ($rec) = @_;
my $id = $rec->{ID};
my $url = $rec->{URL};
my $title = $rec->{Title};
my ($dir,$bild);

print:"ID:($id)";

if ($rec->{b1}) {
my $links_db = $DB->table('Links');
my $fh = $links_db->file_info( 'b1', $id );
my $location = $fh->File_RelativePath;
if ($fh->File_Name =~ /\.(jpg|gif)$/) {
return qq~/pics$location~;
}
else
{
return "Pic Error";
}
}
else
{
return "Pic Error2";
}
}


---------------------
351 seconds instead 450 at the console with -- all instead of staggered
Subject Author Views Date
Thread; hot thread Slow build Robert 9455 Sep 18, 2020, 9:43 AM
Thread; hot thread Re: [Robert] Slow build
Andy 9374 Sep 18, 2020, 10:13 PM
Thread; hot thread Re: [Andy] Slow build
Robert 9367 Sep 19, 2020, 7:29 AM
Thread; hot thread Re: [Robert] Slow build
Andy 9365 Sep 19, 2020, 7:37 AM
Thread; hot thread Re: [Andy] Slow build
Robert 9343 Sep 19, 2020, 7:40 AM
Thread; hot thread Re: [Robert] Slow build
Robert 9345 Sep 19, 2020, 7:52 AM
Thread; hot thread Re: [Robert] Slow build
Andy 9353 Sep 19, 2020, 8:05 AM
Thread; hot thread Re: [Andy] Slow build
Robert 9337 Sep 19, 2020, 9:54 AM
Thread; hot thread Re: [Robert] Slow build
Andy 9350 Sep 19, 2020, 10:11 AM
Thread; hot thread Re: [Andy] Slow build
Robert 9334 Sep 19, 2020, 10:18 AM
Thread; hot thread Re: [Robert] Slow build
Robert 9325 Sep 19, 2020, 10:21 AM
Thread; hot thread Re: [Robert] Slow build
Robert 9324 Sep 19, 2020, 10:24 AM
Thread; hot thread Re: [Robert] Slow build
Robert 9322 Sep 19, 2020, 10:39 AM
Thread; hot thread Re: [Robert] Slow build
Robert 9317 Sep 19, 2020, 10:43 AM
Thread; hot thread Re: [Robert] Slow build
Robert 9301 Sep 19, 2020, 11:01 AM
Post; hot thread Re: [Robert] Slow build
Andy 9273 Sep 19, 2020, 11:08 PM
Post; hot thread Re: [Robert] Slow build
Andy 9256 Sep 19, 2020, 11:06 PM
Post; hot thread Re: [Robert] Slow build
Andy 9316 Sep 19, 2020, 10:23 AM
Post; hot thread Post deleted by Robert
Robert 9324 Sep 19, 2020, 9:55 AM