holy moly, right now i'm lost! can someone make a final Yahoo mod where everything we need to do is in it? no linking to other webpages. like everything is there that needs to be done? it's all too overwhelming for me to read all these scattered messages. i'm not mad, just confused.
Jul 8, 2001, 9:13 PM
Veteran (17240 posts)
Jul 8, 2001, 9:13 PM
Post #127 of 139
Views: 10988
Glennu already re-wrote this Mod and provided two pages of instructions, one that can be found at:
http://cgi-resource.co.uk/pages/subcat.shtml
and if you go to:
http://cgi-resource.co.uk/pages/
you will see tons of other mods you can add to Links 2.0.
BTW: Glennu did post a link to the above pages quite a few times in this forum...
Regards,
Eliot Lee
http://cgi-resource.co.uk/pages/subcat.shtml
and if you go to:
http://cgi-resource.co.uk/pages/
you will see tons of other mods you can add to Links 2.0.
BTW: Glennu did post a link to the above pages quite a few times in this forum...

Regards,
Eliot Lee
Jul 8, 2001, 9:44 PM
User (70 posts)
Jul 8, 2001, 9:44 PM
Post #128 of 139
Views: 10951
yeah, thanks. but i have several problems with it. i installed the category link template mod and because of that i could not go ahead and install glenn's mod. is there a way around this? it involves a modification i made in site_html_templates:
to sub site_html_print_cat
wherein i replaced:
# 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>|;
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
$output .= qq|</dl>|;
with:
%cat_rec = (url => $url,
numlinks => $numlinks,
category_name => $category_name,
description => $description,
new => $new
);
if (&days_old($mod) < $db_new_cutoff) {$cat_rec{'new'} = 1}
if ($cat_rec{'description'} !~ /^[\s\n]*$/) {delete: $cat_rec{'description'}}
$output .= &site_html_category_link;
glenn requires me to do this:
Go to the print cat sub and find:
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
Replace it with:
$output .= qq|<dd><span class="descript">$description</span></dd>| if (!($description =~ /^[\s\n]*$/));
$output .= qq|<dd><span class="descript">$subcats</span></dd>|;
any thoughts?
to sub site_html_print_cat
wherein i replaced:
# 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>|;
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
$output .= qq|</dl>|;
with:
%cat_rec = (url => $url,
numlinks => $numlinks,
category_name => $category_name,
description => $description,
new => $new
);
if (&days_old($mod) < $db_new_cutoff) {$cat_rec{'new'} = 1}
if ($cat_rec{'description'} !~ /^[\s\n]*$/) {delete: $cat_rec{'description'}}
$output .= &site_html_category_link;
glenn requires me to do this:
Go to the print cat sub and find:
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
Replace it with:
$output .= qq|<dd><span class="descript">$description</span></dd>| if (!($description =~ /^[\s\n]*$/));
$output .= qq|<dd><span class="descript">$subcats</span></dd>|;
any thoughts?
Jul 11, 2001, 11:54 PM
Veteran / Moderator (1936 posts)
Jul 11, 2001, 11:54 PM
Post #129 of 139
Views: 10934
Drewboy,
Yes, the category template mod was not intended for use with any other mods, especially Subcategories Like Yahoo... If you give me some time, I can make a modified version that will work with Glennu's subcategory mod.
Everyone else,
There seems to be quite a bit of problems with this mod. Mostly, the original instructions are a bit incorrect and vague. Most users had a problem with a missing bracket at about line 450. Corrected versions have been posted (and lost over time). Here is a (another) working copy of Subcategories Like Yahoo 2.1:
# --------------------------------------------------------
# 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];
($subcatstyle) = @{$category{$subcat}}[8];
# 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|<a class="catlist" href="$url">$category_name</a> <font class="catlist">($numlinks)</font> |;
$output .= qq|<small><sup class="new">new</sup></small>| if (&days_old($mod) < $db_new_cutoff);
$output .= qq|<BR>|;
if ($subcatstyle =~ m,^\(([^\)]+)\)(\d)$, && $#{$subcategories{$subcat}} >= 0) {
($subcatstyle, $style) = ($1, $2);
$s = 0;
@subcatsub = split (/\|/, $subcatstyle);
$output .= qq~ ~ if ($style eq "1");
foreach $category_name (@subcatsub) {
foreach (sort @{$subcategories{$subcat}}) {
($subcatstyle eq "ALL" && $#subcatsub == 0) ?
($_ =~ m,.*/([^/]+)$, and $category_name = &build_clean($1)) :
($_ eq "$subcat/$category_name" or next);
if ($style eq "1") {
$length += length($category_name);
($length > $subcat_length) and last;
}
if ($s > 0) {
$output .= qq~, ~ and $length += 2 if ($style eq "1");
$output .= qq~ ~ if ($style eq "2");
}
$url = "$build_root_url/" . &urlencode($_) . "/";
$output .= qq~<LI>~ if ($style eq "2");
$output .= qq~<a class="subcat" href="$url">$category_name</a>~;
$s++;
last if ($subcatstyle ne "ALL" && $#subcatsub > 0);
}
}
undef $length;
if ($s < $#{$subcategories{$subcat}}) {
$output .= qq~...~ if ($style eq "1");
}
$output .= qq~<BR>~;
}
else {
}
}
# Don't forget to end the table..
$output .= "</td></tr></table></div>\n";
return $output;
}--Drew
Links 2.0 stuff
http://www.camelsoup.com
Yes, the category template mod was not intended for use with any other mods, especially Subcategories Like Yahoo... If you give me some time, I can make a modified version that will work with Glennu's subcategory mod.
Everyone else,
There seems to be quite a bit of problems with this mod. Mostly, the original instructions are a bit incorrect and vague. Most users had a problem with a missing bracket at about line 450. Corrected versions have been posted (and lost over time). Here is a (another) working copy of Subcategories Like Yahoo 2.1:
Code:
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];
($subcatstyle) = @{$category{$subcat}}[8];
# 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|<a class="catlist" href="$url">$category_name</a> <font class="catlist">($numlinks)</font> |;
$output .= qq|<small><sup class="new">new</sup></small>| if (&days_old($mod) < $db_new_cutoff);
$output .= qq|<BR>|;
if ($subcatstyle =~ m,^\(([^\)]+)\)(\d)$, && $#{$subcategories{$subcat}} >= 0) {
($subcatstyle, $style) = ($1, $2);
$s = 0;
@subcatsub = split (/\|/, $subcatstyle);
$output .= qq~ ~ if ($style eq "1");
foreach $category_name (@subcatsub) {
foreach (sort @{$subcategories{$subcat}}) {
($subcatstyle eq "ALL" && $#subcatsub == 0) ?
($_ =~ m,.*/([^/]+)$, and $category_name = &build_clean($1)) :
($_ eq "$subcat/$category_name" or next);
if ($style eq "1") {
$length += length($category_name);
($length > $subcat_length) and last;
}
if ($s > 0) {
$output .= qq~, ~ and $length += 2 if ($style eq "1");
$output .= qq~ ~ if ($style eq "2");
}
$url = "$build_root_url/" . &urlencode($_) . "/";
$output .= qq~<LI>~ if ($style eq "2");
$output .= qq~<a class="subcat" href="$url">$category_name</a>~;
$s++;
last if ($subcatstyle ne "ALL" && $#subcatsub > 0);
}
}
undef $length;
if ($s < $#{$subcategories{$subcat}}) {
$output .= qq~...~ if ($style eq "1");
}
$output .= qq~<BR>~;
}
else {
}
}
# Don't forget to end the table..
$output .= "</td></tr></table></div>\n";
return $output;
}
Links 2.0 stuff
http://www.camelsoup.com
Oct 5, 2001, 9:20 PM
Veteran (1819 posts)
Oct 5, 2001, 9:20 PM
Post #130 of 139
Views: 10644
Wished I had seen this link earlier ... errr ... I figured out basically what PerlFreak has posted here but I'd like to get the subcats to show the number of links listed and not show if there are no links.
Subcats not showing doesn't seem to be a problem but if even if only " 1 " link exists all subcats show ....
next hopeful is how do you get the number of links per cat to show?
obviously:
$output .= qq~<small><a href="$url">$category_name</a></small> <small class="numlinks">($numlinks)</small>~;
only prints out the total of links for the either the whole category area or comes from the total of subcats ...
Any ideas?
openoffice + gimp + sketch ...
Subcats not showing doesn't seem to be a problem but if even if only " 1 " link exists all subcats show ....

next hopeful is how do you get the number of links per cat to show?
obviously:
$output .= qq~<small><a href="$url">$category_name</a></small> <small class="numlinks">($numlinks)</small>~;
only prints out the total of links for the either the whole category area or comes from the total of subcats ...
Any ideas?
openoffice + gimp + sketch ...

Oct 6, 2001, 9:47 PM
New User (1 post)
Oct 6, 2001, 9:47 PM
Post #131 of 139
Views: 10764
Hello,
I did every thing you said and it is working fine, but the categories and subcategories are in the same font size on my catlist output, I'm using templates and my own CSS, and I want to know, (I'm not good on perl) where can I define the font class for subcategories in this mod. I want subcategories in a smaller size. I have created a .class subcat on my CSS. but...
Thanks. (sorry for my english)
Adriana de Hoyos
I did every thing you said and it is working fine, but the categories and subcategories are in the same font size on my catlist output, I'm using templates and my own CSS, and I want to know, (I'm not good on perl) where can I define the font class for subcategories in this mod. I want subcategories in a smaller size. I have created a .class subcat on my CSS. but...
Thanks. (sorry for my english)
Adriana de Hoyos
Oct 7, 2001, 6:31 AM
Veteran (1819 posts)
Oct 7, 2001, 6:31 AM
Post #132 of 139
Views: 10763
try changing this area, it's only really html to deal with ... ....
<small><a href="$url">$category_name</a></small>
this is from the lines in the actual print subcat area ....
$url = "$build_root_url/" . &urlencode($_) . "/";
$output .= qq~<LI>~ if ($style eq "2");
$output .= qq~<small><a href="$url">$category_name</a></small>~;
you can also change out the <small> to something like ....
$output .= qq~<a class="what_you_called_your_class" href="$url">$category_name</a>~;
I'm not sure how browser independant that is though ...
good luck
----------------------------------------
anybody for printing out numlinks at the same line ????
openoffice + gimp + sketch ...
<small><a href="$url">$category_name</a></small>
this is from the lines in the actual print subcat area ....
$url = "$build_root_url/" . &urlencode($_) . "/";
$output .= qq~<LI>~ if ($style eq "2");
$output .= qq~<small><a href="$url">$category_name</a></small>~;
you can also change out the <small> to something like ....
$output .= qq~<a class="what_you_called_your_class" href="$url">$category_name</a>~;
I'm not sure how browser independant that is though ...
good luck
----------------------------------------
anybody for printing out numlinks at the same line ????
openoffice + gimp + sketch ...

Jun 29, 2002, 7:35 PM
Novice (12 posts)
Jun 29, 2002, 7:35 PM
Post #136 of 139
Views: 10550
I've installed everything I think..
However, when attempting to build, i get the following error:
Error including libraries: Unmatched right curly bracket at /home/virtual/site18/fst/var/www/cgi-bin/links/admin/site_html_templates.pl line 452, at end of linesyntax error at /home/virtual/site18/fst/var/www/cgi-bin/links/admin/site_html_templates.pl line 452, near "}"Compilation failed in require at nph-build.cgi line 33.Make sure they exist, permissions are set properly, and paths are set correctly. Anyone have any Ideas?
However, when attempting to build, i get the following error:
Error including libraries: Unmatched right curly bracket at /home/virtual/site18/fst/var/www/cgi-bin/links/admin/site_html_templates.pl line 452, at end of linesyntax error at /home/virtual/site18/fst/var/www/cgi-bin/links/admin/site_html_templates.pl line 452, near "}"Compilation failed in require at nph-build.cgi line 33.Make sure they exist, permissions are set properly, and paths are set correctly. Anyone have any Ideas?
Jun 29, 2002, 11:05 PM
Veteran (17240 posts)
Jun 29, 2002, 11:05 PM
Post #137 of 139
Views: 10556
1) Go back to your original set of your files (before you attempted to add the mod).
2) Then (like I posted a year ago), use GLENNU's MOD:
http://cgi-resource.co.uk/pages/subcat.shtml
It is better written and should be easier to install.
========================================
Buh Bye!
Cheers,
Me
2) Then (like I posted a year ago), use GLENNU's MOD:
http://cgi-resource.co.uk/pages/subcat.shtml
It is better written and should be easier to install.
========================================
Buh Bye!
Cheers,
Me
Jan 6, 2006, 12:14 PM
Enthusiast (550 posts)
Jan 6, 2006, 12:14 PM
Post #138 of 139
Views: 10150
Hello - I got this mod to working without any problems:
GLENNU's MOD:
http://cgi-resource.co.uk/pages/subcat.shtml
However, I don't anything on how to change how many of the subcats actually display on the page. I don't want to list them all just a sampling. Can I limit the number of subcats displayed? How about the length of characters displayed?
Ooop's - ok, I found how to limit the characters of the subcat. But my question now is this. Say my subcat_length is set to 50 and at 50 instead of it just stopping... is there a way for it to print "..." indicating that there are more sub categories available than what appears on the page?
Thanks!
GLENNU's MOD:
http://cgi-resource.co.uk/pages/subcat.shtml
However, I don't anything on how to change how many of the subcats actually display on the page. I don't want to list them all just a sampling. Can I limit the number of subcats displayed? How about the length of characters displayed?
Ooop's - ok, I found how to limit the characters of the subcat. But my question now is this. Say my subcat_length is set to 50 and at 50 instead of it just stopping... is there a way for it to print "..." indicating that there are more sub categories available than what appears on the page?
Thanks!