Wait a sec.... I seem to remember that a "file" in the header/category tag is automatically parsed.
They are special cased:
In nph_build.cgi you need to change
Code:
# Get the category info.
%OUT = (); # Start with a clean hash.
$OUT{category_id} = $category_r->{'ID'};
$OUT{category_name} = $category_r->{'Name'};
$OUT{header} = $category_r->{'Header'};
$OUT{footer} = $category_r->{'Footer'};
$OUT{meta_name} = $category_r->{'Meta_Description'};
$OUT{meta_keywords} = $category_r->{'Meta_Keywords'};
$OUT{description} = $category_r->{'Description'};
$OUT{random} = rand (10000);
$OUT{random1} = rand (10000);
$OUT{random2} = rand (10000);
$OUT{random3} = rand (10000);
to include the new fields:
$OUT{header2}=$category_r->{'Header2'};
etc.
Then, a bit further down,
Code:
# Get the header and footer from file if it exists, otherwise assume it is html.
if ($OUT{header} && (length($OUT{header}) < 20) && ($OUT{header} !~ /\s+/) && (-e "$LINKS{admin_root_path}/headers/$OUT{header}")) {
open (HEAD, "<$LINKS{admin_root_path}/headers/$OUT{header}") or die "Unable to open header file: $LINKS{admin_root_path}/headers/$OUT{header}. Reason: $!";
$OUT{header} = join "", <HEAD>;
close HEAD;
}
if ($OUT{footer} && (length($OUT{footer}) < 20) && ($OUT{footer} !~ /\s+/) && (-e "$LINKS{admin_root_path}/footers/$OUT{footer}")) {
open (FOOT, "<$LINKS{admin_root_path}/footers/$OUT{footer}") or die "Unable to open footer file: $LINKS{admin_root_path}/footers/$OUT{footer}. Reason: $!";
$OUT{footer} = join "", <FOOT>;
close FOOT;
}
You need to add a new test for each of the fields you've added above:
Code:
if ($OUT{header2} && (length($OUT{header2}) < 20) && ($OUT{header2} !~ /\s+/) && (-e "$LINKS{admin_root_path}/headers/$OUT{header2}")) {
open (HEAD, "<$LINKS{admin_root_path}/headers/$OUT{header2}") or die "Unable to open header file: $LINKS{admin_root_path}/headers/$OUT{header2}. Reason: $!";
$OUT{header2} = join "", <HEAD>;
close HEAD;
}
Will probably take a few tries, but that should work now.