Gossamer Forum
Home : Products : Links 2.0 : Discussions :

no spaces on Sub's

Quote Reply
no spaces on Sub's
I'm trying to have my sub cat's with now spaces in between them but, I can't find the code any where or I'm looking for the wrong thing.?
Quote Reply
Re: no spaces on Sub's In reply to
Just put a _ where the space belongs, and Links will automatically convert it to a space.
Quote Reply
Re: no spaces on Sub's In reply to
Sorry thats not it I'm looking for a way to have my subs look like this

Sub1
Sub2
Sub3
Sub4

instead of like this
sub1

sub2

sub3

See what I'm talking about?
Quote Reply
Re: no spaces on Sub's In reply to
You will have to edit the sub site_html_print_cat routine in the site_html_templates.pl or site_html.pl (depending on if you use Templates or not).

Look HTML codes with new in them between the $output statement, and take out the <BR> or <P> after the new codes.

(Sorry I can't give you an example...I have modded this sub-routine so much and I do not have access to the original site_html_templates.pl file since I am at the office.)

AND Look for the following codes:

Code:
$output .= qq|$description<br>| if (!($description =~/^[\s\n]*$/));

Change them to the following codes:

Code:
$output .= qq|$description</font>| if (!($description =~/^[\s\n]*$/));

Hope this helps.

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------




[This message has been edited by Eliot (edited November 10, 1999).]
Quote Reply
Re: no spaces on Sub's In reply to
THIS IS WHAT I HAVE

sub site_html_print_cat {
# --------------------------------------------------------
# This routine determines how the list of categories will look.
# We now use a table to split the category name up into two columns.
# For each category you can use the following variables:
#
# $url : The URL to go to that category
# $category_name : The category name with _ and / removed.
# $category_descriptions{$subcat}: The category description (if any).
# $numlinks : The number of links inside that category (and subcategories).
# $mod : The newest link inside of that category.
#

my (@subcat) = @_;
my ($url, $numlinks, $mod, $subcat, $category_name, $description, $output, $i);
my ($half) = int (($#subcat+2) / 2);

# Print Header.
$output = qq|<div class="margin"><table width="80%" border="0" cellspacing="0" cellpadding="0"><tr><td class="catlist" valign="top">\n|;

foreach $subcat (sort @subcat) {
($description) = @{$category{$subcat}}[2];

# First let's get the name, number of links, and last modified date...
$url = "$build_root_url/" . &urlencode($subcat) . "/";
if ($subcat =~ m,.*/([^/]+)$,) { $category_name = &build_clean($1); } else { $category_name = &build_clean($subcat); }
$numlinks = $stats{"$subcat"}[0];
$mod = $stats{"$subcat"}[1];

# We check to see if we are half way through, if so we stop this table cell
# and begin a new one (this lets us have category names in two columns).
if ($i == $half) {
$output .= qq|</td><td class="catlist" valign="top">\n|;
}
$i++;

# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<dl><dt><strong><a class="link" href="$url">$category_name</a></strong> <small class="numlinks">($numlinks)</small> |;
$output .= qq|<small><sup class="new">new</sup></small>| if (&days_old($mod) < $db_new_cutoff);
$output .= qq|</dt>|;
if ($#{$subcategories{$subcat}} >= 0 && $description =~ /^SUB.*/) {
$v = 0;
$sub_length = "";
$output .= qq|<small>|;
foreach $subcatsub (sort @{$subcategories{$subcat}}) {
$suburl = "$build_root_url/" . &urlencode($subcatsub) . "/";
if ($subcatsub =~ m,.*/([^/]+)$,) { $subcategory_name = &build_clean($1); }
else { $subcategory_name = &build_clean($subcatsub); }

$sub_length .= qq|, | if ($description =~ /1$/ && $v ne "0");
$sub_length .= qq|$subcategory_name| if ($description =~ /1$/);

if ($description =~ /1$/ && length($sub_length) > $subcat_length) {
$output .= qq|...|;
last;
}
else {
$output .= qq|, | if ($description =~ /1$/ && $v ne "0");
$output .= qq|<br>| if ($description =~ /2$/ &#0124; &#0124; $v eq "0");
$output .= qq| | if ($description =~ /2$/);
$output .= qq|<a href="$suburl">$subcategory_name</a>|;
$v++;
}
}
$output .= qq|</small>|;
}
else {
$output .= qq|<dd><span class="descript">$description</span></dd>| if (!($description =~ /^[\s\n]*$/));
}


$output .= qq|</dl>|;
}

# Don't forget to end the unordered list..
$output .= "</td></tr></table></div>\n";
return $output;
}

1;

Quote Reply
Re: no spaces on Sub's In reply to
I looked through the script and now I'm confused. I tried removing <br> and it didn't take out the spaces I think it has to do with the perl itself can someone help me out

to look like this?


Amazon.com

Search for:
Archaeology




Sub-Categories:

sub1 (21)
sub2 (4)
sub3 (23)
sub4 (19)
sub5 (9)

Links: