I'm trying to break up related categories into two columns, just like subcategories are broken up in <b>site_html_templates.pl</b> under sub site_html_print_cat. Somewhere (I can't remember where) I got this code to modify sub build_category_pages in <b>nph_build.cgi</b>:
# Calculate the related entries and put in a <LI> list.
@related = split(/\Q$db_delim\E/, $related);
$half = int (($#related) / 2);
$related = "<div class=margin><table width=80% border=0 cellspacing=0 cellpadding=0><TR><TD VALIGN=TOP WIDTH=50%>";
foreach $relation (@related) {
$related .= qq|<b><a href="$build_root_url/|;
$related .= &urlencode($relation);
$related .= qq|/$build_index">|;
@onerelated = split(/\//, $relation);
$related .= &build_clean($onerelated[$#onerelated]) . "\@\n";
$related .= "</a></b><br><img src=\"http://www.evjcc.org/images/clear.gif\[/url]" vspace=1 border=0><br>";
if ($i == $half) {
$related .= qq|</td><td valign=top WIDTH=50%>\n|;
}
$i++;
}
$related .= "</TD></TR></TABLE></div>";
I keep playing with the code--it sure looks like it should work. Sigh. But it isn't consistent. If it does manage to break them into two columns (not always the case), it doesn't break them up evenly. Does anyone have an idea what I'm doing wrong? Am I missing a change I should make somewhere else?
BTW, whatever happened to Phoenix's great Add Confirmation Mod? I have been trying to run an old copy, but came on a strange glitch. Searched the forum for discussion on the mod and came up pretty empty. Can I ask questions about a mod no longer offered?
Thanks for your help (and all the great mods everyone's added here).
# Calculate the related entries and put in a <LI> list.
@related = split(/\Q$db_delim\E/, $related);
$half = int (($#related) / 2);
$related = "<div class=margin><table width=80% border=0 cellspacing=0 cellpadding=0><TR><TD VALIGN=TOP WIDTH=50%>";
foreach $relation (@related) {
$related .= qq|<b><a href="$build_root_url/|;
$related .= &urlencode($relation);
$related .= qq|/$build_index">|;
@onerelated = split(/\//, $relation);
$related .= &build_clean($onerelated[$#onerelated]) . "\@\n";
$related .= "</a></b><br><img src=\"http://www.evjcc.org/images/clear.gif\[/url]" vspace=1 border=0><br>";
if ($i == $half) {
$related .= qq|</td><td valign=top WIDTH=50%>\n|;
}
$i++;
}
$related .= "</TD></TR></TABLE></div>";
I keep playing with the code--it sure looks like it should work. Sigh. But it isn't consistent. If it does manage to break them into two columns (not always the case), it doesn't break them up evenly. Does anyone have an idea what I'm doing wrong? Am I missing a change I should make somewhere else?
BTW, whatever happened to Phoenix's great Add Confirmation Mod? I have been trying to run an old copy, but came on a strange glitch. Searched the forum for discussion on the mod and came up pretty empty. Can I ask questions about a mod no longer offered?
Thanks for your help (and all the great mods everyone's added here).