Is there anyone out there who knows where i can find a modification to give me yahoo style subcategories
Aug 30, 2000, 11:06 PM
Veteran / Moderator (1936 posts)
Aug 30, 2000, 11:06 PM
Post #3 of 6
Views: 2040
[flame]
I'm starting to get peeved . There are threads coming out the wazoo on this subject and links in the resource center, yet no one seems to bother to look for them. What really bugs me, is when I logged in and saw this thread, then counted how many times this mod shows up in the same page. Counting this thread, there are 8. And I know for a fact at least 3 of them have the complete source codes either linked to or posted in them more than once.
[/flame]
Good night . Gotta get up early tomorrow for orientation at my new job.
--Drew
I'm starting to get peeved . There are threads coming out the wazoo on this subject and links in the resource center, yet no one seems to bother to look for them. What really bugs me, is when I logged in and saw this thread, then counted how many times this mod shows up in the same page. Counting this thread, there are 8. And I know for a fact at least 3 of them have the complete source codes either linked to or posted in them more than once.
[/flame]
Good night . Gotta get up early tomorrow for orientation at my new job.
--Drew
Aug 30, 2000, 11:37 PM
Novice (34 posts)
Aug 30, 2000, 11:37 PM
Post #4 of 6
Views: 2033
SUBCATEGORIES LIKE YAHOO v2.1(Modified)
A Mod to the Yahoo Style SubCategory Listings Mod by Widgetz.
THIS MOD MUST BE USED ONLY IN site_html.pl (NO TEMPLATES).
Modified for no templates by
Eduin Yesid Carrillo yecarrillo@hotmail.com (aug 9 /2000)
I wanted to use the Yahoo style Sub-Category listings on my site, but I also wanted to
keep the ability to us category descriptions. So I came up with this mod to Widgetz
Mod to allow just that.
Notes: Remember to backup files to be edited before proceeding. This Mod assumes
no previous mods are installed and you are using templates.
Notes:
1. Remember to backup files to be edited before proceeding.
2. This Mod assumes no previous mods are installed and you are using templates.
3. If you have an existing categories.db file, you should review the information
in Bobsie's upgrade script at http://www.gossamer-threads.com/...um3/HTML/001090.html
With some work it will help you add the new field spacing to your categories.db.
links/cgi-bin/admin/category.def
Find this section: (it's at the top)
# Definition of your database file.
ID => [0, 'numer', 5, 8, 1, '', ''],
Name => [1, 'alpha', 40, 75, 1, '', '^[\w\d/_-]+$'],
Description => [2, 'alpha', '40x3', 500, 0, '', ''],
Related => [3, 'alpha', 0, 255, 0, '', ''],
'Meta Description' => [4, 'alpha', 40, 75, 0, '', ''],
'Meta Keywords' => [5, 'alpha', 40, 75, 0, '', ''],
Header => [6, 'alpha', 40, 75, 0, '', ''],
Footer => [7, 'alpha', 40, 75, 0, '', '']
);Palace this line under the last entry in the list just before the );
^ ^
Filed ID Default EntryThe field id, in this case 8 should be changed to reflect the fields sequence in your database.
Don't forget to place a comma at the end of the entry on the line above SubCatStyle. You can
indicate a default style by placing one of the styles from the bottom of this post in the Default
Entry section of the field definition.
links/cgi-bin/admin/site_html.pl
Find this:
($description) = @{$category{$subcat}}[2];Place this just below it
Change the filed ID to match the one you entered in the category.def
Find this sub
Insert this below the my ($output); entry
Change the filed ID to match the one you entered in the category.def
Find this text:
$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>~;Replace with:
$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>~;
$maxitems = 3;
if ($subcatstyle =~ m,^\(([^\)]+)\)(\d)$, && $#{$subcategories{$subcat}} >= 0) {
($subcatstyle, $estilo) = ($1, $2);
$s = 0;
@subcatsub = split (/\|/, $subcatstyle);
$output .= qq~ <small>~;
$output .= qq~
~ if ($estilo 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 ($estilo eq "3") {
$length += length($category_name);
($length > $subcat_length) and last;
}
if ($s > 0) {
$output .= qq~, ~ and $length += 2 if ($estilo eq "1");
$output .= qq~ ~ if ($estilo eq "2");
}
$url = "$build_root_url/" . &urlencode($_) . "/";
$output .= qq~<LI>~ if ($estilo eq "2");
$category_name =~ s/_/ /g;
$output .= qq~<a class="subcat" href="$url">$category_name</a>~;
$s++;
# last if ($subcatstyle ne "ALL" && $#subcatsub > 0);
last if (($subcatstyle ne "ALL" && $#subcatsub > 0)||($s>$maxitems - 1));
}
}
undef $length;
# if ($s < $#{$subcategories{$subcat}}) {
if ($s >= $maxitems) {
$output .= qq~ ...~ if ($estilo eq "1");
$output .= qq~<li> ...~ if ($estilo eq "2");
}
$output .= qq~</small><BR>~;
}
else {
}Change the $maxitems value to match the number of subcats
that you want to show for each category.
That's it for the CGI Work. No you need to add the place holder for the new field to your category
database (links/cgi-bin/admin/data/categories.db). To do this just add a | (see note 3 above)
to the end of each record in your database.
To use this mod indicate what style of subcategory listing you would like by entering one of the
styles below in the SubCatStyle filed in the Modify Category screen of the Links Admin page.
Horizontal Layout (alphabetical.. up to subcat_length)
(ALL)1
Category (#)
Subcategory1, Subcategory2, Subcategory3...
Vertical Layout (alphabetical)
(ALL)2
Category (#)
* Subcategory1
* Subcategory2
* Subcategory3
* Subcategory4
Horizontal Layout (ordered by you)
(Games|Utilities|Hacks)1
Category (#)
Games, Utilities, Hacks
Vertical Layout (ordered by you)
(Games|Utilites|Hacks)2
Category (#)
* Games
* Utilities
* HacksThat should do it.
If you have problems I will do my best to help you.
Just email me to yecarrillo@hotmail.com
and post to the original mod
thread at http://www.gossamer-threads.com/...um3/HTML/004954.html
and I will respond as quickly as possible.
A Mod to the Yahoo Style SubCategory Listings Mod by Widgetz.
THIS MOD MUST BE USED ONLY IN site_html.pl (NO TEMPLATES).
Modified for no templates by
Eduin Yesid Carrillo yecarrillo@hotmail.com (aug 9 /2000)
I wanted to use the Yahoo style Sub-Category listings on my site, but I also wanted to
keep the ability to us category descriptions. So I came up with this mod to Widgetz
Mod to allow just that.
Notes: Remember to backup files to be edited before proceeding. This Mod assumes
no previous mods are installed and you are using templates.
Notes:
1. Remember to backup files to be edited before proceeding.
2. This Mod assumes no previous mods are installed and you are using templates.
3. If you have an existing categories.db file, you should review the information
in Bobsie's upgrade script at http://www.gossamer-threads.com/...um3/HTML/001090.html
With some work it will help you add the new field spacing to your categories.db.
links/cgi-bin/admin/category.def
Find this section: (it's at the top)
# Definition of your database file.
Code:
%db_def = ( ID => [0, 'numer', 5, 8, 1, '', ''],
Name => [1, 'alpha', 40, 75, 1, '', '^[\w\d/_-]+$'],
Description => [2, 'alpha', '40x3', 500, 0, '', ''],
Related => [3, 'alpha', 0, 255, 0, '', ''],
'Meta Description' => [4, 'alpha', 40, 75, 0, '', ''],
'Meta Keywords' => [5, 'alpha', 40, 75, 0, '', ''],
Header => [6, 'alpha', 40, 75, 0, '', ''],
Footer => [7, 'alpha', 40, 75, 0, '', '']
);
Code:
SubCatStyle => [8, 'alpha' ,40, 100, 0, '(ALL)1', ''] ^ ^
Filed ID Default Entry
Don't forget to place a comma at the end of the entry on the line above SubCatStyle. You can
indicate a default style by placing one of the styles from the bottom of this post in the Default
Entry section of the field definition.
links/cgi-bin/admin/site_html.pl
Find this:
Code:
foreach $subcat (sort @subcat) { ($description) = @{$category{$subcat}}[2];
Code:
($subcatstyle) = @{$category{$subcat}}[8];Find this sub
Code:
sub site_html_category {Code:
$subcatstyle = $category{$category_name}[8];Find this text:
Code:
# 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>~;
Code:
# 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>~;
$maxitems = 3;
if ($subcatstyle =~ m,^\(([^\)]+)\)(\d)$, && $#{$subcategories{$subcat}} >= 0) {
($subcatstyle, $estilo) = ($1, $2);
$s = 0;
@subcatsub = split (/\|/, $subcatstyle);
$output .= qq~ <small>~;
$output .= qq~
~ if ($estilo 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 ($estilo eq "3") {
$length += length($category_name);
($length > $subcat_length) and last;
}
if ($s > 0) {
$output .= qq~, ~ and $length += 2 if ($estilo eq "1");
$output .= qq~ ~ if ($estilo eq "2");
}
$url = "$build_root_url/" . &urlencode($_) . "/";
$output .= qq~<LI>~ if ($estilo eq "2");
$category_name =~ s/_/ /g;
$output .= qq~<a class="subcat" href="$url">$category_name</a>~;
$s++;
# last if ($subcatstyle ne "ALL" && $#subcatsub > 0);
last if (($subcatstyle ne "ALL" && $#subcatsub > 0)||($s>$maxitems - 1));
}
}
undef $length;
# if ($s < $#{$subcategories{$subcat}}) {
if ($s >= $maxitems) {
$output .= qq~ ...~ if ($estilo eq "1");
$output .= qq~<li> ...~ if ($estilo eq "2");
}
$output .= qq~</small><BR>~;
}
else {
}
that you want to show for each category.
That's it for the CGI Work. No you need to add the place holder for the new field to your category
database (links/cgi-bin/admin/data/categories.db). To do this just add a | (see note 3 above)
to the end of each record in your database.
To use this mod indicate what style of subcategory listing you would like by entering one of the
styles below in the SubCatStyle filed in the Modify Category screen of the Links Admin page.
Code:
Style Types... Horizontal Layout (alphabetical.. up to subcat_length)
(ALL)1
Category (#)
Subcategory1, Subcategory2, Subcategory3...
Vertical Layout (alphabetical)
(ALL)2
Category (#)
* Subcategory1
* Subcategory2
* Subcategory3
* Subcategory4
Horizontal Layout (ordered by you)
(Games|Utilities|Hacks)1
Category (#)
Games, Utilities, Hacks
Vertical Layout (ordered by you)
(Games|Utilites|Hacks)2
Category (#)
* Games
* Utilities
* Hacks
If you have problems I will do my best to help you.
Just email me to yecarrillo@hotmail.com
and post to the original mod
thread at http://www.gossamer-threads.com/...um3/HTML/004954.html
and I will respond as quickly as possible.
Aug 31, 2000, 4:54 AM
User (365 posts)
Aug 31, 2000, 4:54 AM
Post #5 of 6
Views: 2008
Junko,
that's why I'm hoping that the new resource center will be built, so much frustration would be gone by having something more "explanatory" set-up. So many of you help so much and there are so many new users always asking the same thing. Can you realy blame them, I've done it and felt the same today when I say this but the poor soul who wrote this is only to blame for not reading the instructions, don't we all do that too. If feel for the both of you. Hang in there, Alex, just needs to put more work in the service side of his site and most of this would disappear.
Hope you get a good nights rest and that the orientation goes well.
that's why I'm hoping that the new resource center will be built, so much frustration would be gone by having something more "explanatory" set-up. So many of you help so much and there are so many new users always asking the same thing. Can you realy blame them, I've done it and felt the same today when I say this but the poor soul who wrote this is only to blame for not reading the instructions, don't we all do that too. If feel for the both of you. Hang in there, Alex, just needs to put more work in the service side of his site and most of this would disappear.
Hope you get a good nights rest and that the orientation goes well.
Aug 31, 2000, 2:54 PM
Veteran / Moderator (1936 posts)
Aug 31, 2000, 2:54 PM
Post #6 of 6
Views: 1994
Hm...well maybe I was a bit too harsh -- looking at his profile this seems to be his first thread .
Ha! 8 hours of pure hell watching 'helpful get to know the company' and other non-informative videos and dozens of forms. Who the heck has never heard of Wal-Mart? And besides that, looks like the only time I get to touch a pc is for training myself, with no chance of transfering to the computer/electronics department for at least a year.
--Drew
Ha! 8 hours of pure hell watching 'helpful get to know the company' and other non-informative videos and dozens of forms. Who the heck has never heard of Wal-Mart? And besides that, looks like the only time I get to touch a pc is for training myself, with no chance of transfering to the computer/electronics department for at least a year.
--Drew