I made a hop to box for links categories that works and looks like the ubb hop to box. Saw a links1 version in the resource center and thought I'd make one
at the bottom of site_html_templates.pl just before the 1; ADD
sub hopto_category {
#################################
$output = qq~<script>
<!--
function taking()
{
location=
document.take.take2.options[document.take.take2.selectedIndex].value
}
//-->
</script>~;
$output .= qq(<form name="take"><b><font size="2">Hop to: </font></b><select name="take2">
<option selected value="">Select a Category</option>
<option value="">-------------------------------</option> );
CATEGORY: foreach $cat (sort keys %category) {
next CATEGORY if ($cat =~ /^\s*$/); # How'd that get in here? =)
$title = &build_unlinked_title ($cat);
@categorylist = split (/\//, $cat);
$output .= qq~<option value="$build_root_url/$cat/">$title</option>~;
}
$output .= qq~</select><input type="button" value="Go!" name="B1" onClick="taking()"></form>~;
return $output;
}
#########################################
then add hopto => &hopto_category,to the template load for the approriate page like the example below
# --------------------------------------------------------
# This routine will build a home page. It is not meant to have any
# links on it, only subcategories.
return &load_template ('home.html', {
category => $category,
hopto => &hopto_category,
grand_total => $grand_total,
astlink => $lastlink,
%globals
});
}
then in your templete put <%hopto%> where you want the box to appear. I put it on the home.html and category.html. Hope you like it
---------------------------
bartour.hypermart.net
[This message has been edited by Mutt (edited December 12, 1999).]
at the bottom of site_html_templates.pl just before the 1; ADD
Code:
################################# sub hopto_category {
#################################
$output = qq~<script>
<!--
function taking()
{
location=
document.take.take2.options[document.take.take2.selectedIndex].value
}
//-->
</script>~;
$output .= qq(<form name="take"><b><font size="2">Hop to: </font></b><select name="take2">
<option selected value="">Select a Category</option>
<option value="">-------------------------------</option> );
CATEGORY: foreach $cat (sort keys %category) {
next CATEGORY if ($cat =~ /^\s*$/); # How'd that get in here? =)
$title = &build_unlinked_title ($cat);
@categorylist = split (/\//, $cat);
$output .= qq~<option value="$build_root_url/$cat/">$title</option>~;
}
$output .= qq~</select><input type="button" value="Go!" name="B1" onClick="taking()"></form>~;
return $output;
}
#########################################
then add hopto => &hopto_category,to the template load for the approriate page like the example below
Code:
sub site_html_home { # --------------------------------------------------------
# This routine will build a home page. It is not meant to have any
# links on it, only subcategories.
return &load_template ('home.html', {
category => $category,
hopto => &hopto_category,
grand_total => $grand_total,
astlink => $lastlink,
%globals
});
}
then in your templete put <%hopto%> where you want the box to appear. I put it on the home.html and category.html. Hope you like it

---------------------------
bartour.hypermart.net
[This message has been edited by Mutt (edited December 12, 1999).]