Origianl Post, added to:
pugdog thanks for your help on this one too, your thoughts were insightful and it was your questions that brought the solution to me...
for my $i (0 .. $#{$links_r}) {
last if (ref $links_r->[$i] ne 'ARRAY');
$tmp = $LINKDB->array_to_hash ($links_r->[$i]);
$OUT{links} .= &site_html_link ($tmp, $in);
}
for my $i (0 .. $#{$alt_r}) {
last if (ref $alt_r->[$i] ne 'ARRAY');
$tmp = $FAKEDB->array_to_hash ($alt_r->[$i]);
$OUT{links} .= &site_html_slink ($tmp, $in);
}With this in page.cgi and nph-build.cgi as well as adding a fake .def file to read in the the extra fields from CategoryAlternates, I was able to get my Link extension fields into the templates. Now each link can basically have as many additional field values as I choose to put in the alternates table. I just hope it works in the long haul...
If anyone is interested in doing something like this send me a private message and I can give you more details. PS: pugdogs comment about this not being the best solution was indeed accurate if you only plan on having a couple few 'stores'. But for the purposes of my site this was my best option where the BGII game has prolly close to 45-50 stores that will need populating and having an extra 45-50 fields in the links table not to mention 45-50 <%if%> statements in my templates for just one field wasn't the way to go, then add in a 'store' for each major encounter and that number is closer to 200/300. Sorry pugdog I hadn't really made it clear as to why I was going about it the way I was.
pugdog thanks for your help on this one too, your thoughts were insightful and it was your questions that brought the solution to me...
Code:
# Generate the links listing. for my $i (0 .. $#{$links_r}) {
last if (ref $links_r->[$i] ne 'ARRAY');
$tmp = $LINKDB->array_to_hash ($links_r->[$i]);
$OUT{links} .= &site_html_link ($tmp, $in);
}
for my $i (0 .. $#{$alt_r}) {
last if (ref $alt_r->[$i] ne 'ARRAY');
$tmp = $FAKEDB->array_to_hash ($alt_r->[$i]);
$OUT{links} .= &site_html_slink ($tmp, $in);
}
If anyone is interested in doing something like this send me a private message and I can give you more details. PS: pugdogs comment about this not being the best solution was indeed accurate if you only plan on having a couple few 'stores'. But for the purposes of my site this was my best option where the BGII game has prolly close to 45-50 stores that will need populating and having an extra 45-50 fields in the links table not to mention 45-50 <%if%> statements in my templates for just one field wasn't the way to go, then add in a 'store' for each major encounter and that number is closer to 200/300. Sorry pugdog I hadn't really made it clear as to why I was going about it the way I was.