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
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