Gossamer Forum
Home : Products : Links 2.0 : Customization :

SUBCATEGORIES LIKE YAHOO v2.1

(Page 5 of 6)
> > > >
Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
I have a problem with this mod because I installed 3 Level of New Graphics mod. The subcategories are shoing up but the problem is not in the right place. Here is the code for

sub site_html_print_cat {
my (@subcat) = @_;
my ($url, $numlinks, $mod, $subcat, $category_name, $description, $output, $i);
$columns = 1;
$output = qq|<table width="100%" border="0" cellspacing="0" cellpadding="0">\n|;
$output .= qq|<tr>\n|;
foreach $subcat (sort @subcat) {
my $mod = $stats{"$subcat"}[3];
my $new_add = $stats{"$subcat"}[4];
($description) = @{$category{$subcat}}[2];
($subcatstyle) = @{$category{$subcat}}[9];


$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];
if ($i == $columns) {
$output .= qq|</tr>\n<tr>|;
$i = 0;
}
$output .= qq|<td vAlign="top">\n|;
$output .= qq|<a href="$url">$category_name</a>\n|;
$output .= qq|<i>($numlinks)</i> \n|;
if ($new_add eq "Yes") {
$days_old = &days_old($stats{"$subcat"}[2]);
if ($days_old <= 2) { $output .= qq| $new_1|; }
elsif ($days_old <= 7) { $output .= qq| $new_3|; }
elsif ($days_old <= 14) { $output .= qq| $new_7|; }
}
if ($mod eq "Yes") { $output .= qq~ $updated~; }

$output .= qq|
|;
$output .= qq|$description\n| if (!($description =~ /^[\s\n]*$/));
$output .= qq|</td>\n|;
$i++;

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 { }}


$output .= "</tr>\n</table>\n";
return $output;
}
1;


I don"t know what it"s doing but when I tried this for Business section at http://searchat.virtualave.net, instead of the subcategories being printed below Business, it printed directly above the whole categories.

Please help in correcting this.


SearchAt!- Directory of Services
http://webbusinessservices.hypermart.net
Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
I have added the mod in the hope of getting the (ALL)1 layout but subcategories are not displaying. I have added the modifications to links.cfg, added new field to category.def, deliniated the category.db, and modified the site_html_template.pl as follows:
# 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;
}

I am confused however about what is added to SubCatStyle in modify categories. As the field only accepts one line, which line of ALL 1 is meant to be inserted and is it to each category I want listed Yahoo-like or somewhere else. Quite simply, I want the subcategories to display under the category headings without any descriptions but with total number and "new" displaying when appropriate.

Your help is appreciated.

Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
Can someone please help me with the above problem.

SearchAt!- Directory of Services
http://webbusinessservices.hypermart.net
Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
One line of your code looks like

$output .= qq|
|;

it is actually $output .= qq|< >|; with a br inside the < >. Your actual code is probably correct. Just this msg board accepts the html code.

----------------------------------------
But look at this

$output .= qq~<LI>~ if ($style eq "2");

mine looks like ( well now it does, but it did look like yours )
$output .= qq~ ~ if ($style eq "2");

I had to delete the <LI> from the above. While I am no HTML expert, removing it did wonders for my printing....!

I did the 3 levels of graphics mod also with the Yahoo mod....Looks great when I got it to work.

Gene


Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
The subcategories worked fine on my site. However once you click the main category on the home page.. the next page will display subcategories underneath the next set of categories.. i do not want this to display. I just want the normal set of categories listed to show.. How do i rid the subs from this page? is this something to be corrected on the category.html page or within the site_html_templates.pl file?

thanks
James (netman)

PS!!! I found the problem. It was in my editing of the categories. I had included the (ALL)1 notation by accident. THANKS GUYS.

But of course!
Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
Thanks Gene you helped me solve a problem, but your solution did nothing for me. When I looked closer at the code, the problem was in the table < /td > was in the wrong place. So I moved it from before if subcategories to after subcategories. Here is the code you look for

$output .= qq|</td>\n|;

and you remove that code and put that same code after
$output .= qq~<BR>~;
in the subcategories and now it is working fine for me. If I have any more problems I will post them here which I probably will.

Again thanks for the help gene,
Kevin
http://searchat.virtualave.net



SearchAt!- Directory of Services
http://webbusinessservices.hypermart.net
Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
Hi!

I've installed this MOD, but am having problems using (ALL)1 as the Style. (ALL)2 works fine.

When using (ALL)1 I get , (commas) displayed but no sub cat names!

This happens wether I specify the Sub cat names manualy or by hand (i.e. all '2' style works, and none '1' style works.

I havn't modified the mod in any way...

Any ideas?

Thanks!

Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
You are missing the $subcat_length variable as mentioned quite a few times in this forum....

Make sure that you have the variable in your links.cfg file and that you set it to a high number like 50....

Code:

$subcat_length = 50;


Good luck!

Regards,

Eliot Lee
Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
Is this the complete, tested, working and proven code for the Yahoo like subcategories mod?

Roberto Perez
Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
Yep...sure is...although there are a few bugs, but they have been cleared up in this forum.

Good luck!

Regards,

Eliot Lee
Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
What page are you refering to below, it's the last part of the yahoo cat mod?
Also is there a place where I can get this mod with all the bugs worked out?
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.




Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
In Reply To:
What page are you refering to below, it's the last part of the yahoo cat mod?
PAGE 1 of this Thread...read the posts more carefully.

In Reply To:
Also is there a place where I can get this mod with all the bugs worked out?
Nope...just in this Thread.

In Reply To:
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.
Yep...Read the Mod instructions again.



Regards,

Eliot Lee
Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
I have a problem with this mod. Where exactly is the
" SubCategoryStyle field in the category modify form ", where would it be, in what directory?,folder, what's the name of the file.
I can't seem to get this mod working.
http://www.primefind.com/cgi-bin/pages

Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
You need to add the SubCatStyle field in your category.def (like mentioned in the MOD instructions) and then you need to upgrade your EXISTING categories.db as mentioned in the MOD instructions. Read them again.

Regards,

Eliot Lee
Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
Hello,
I have tried installing this mod atleast 4 times and everytime I get the same result. When I build the pages and view the page it shows as (1). There is no category link just the #. Anyone have any ideas? I have read all 5 pages of this post thoroughly and searched this message board and it seems others have had the same problem as me.
Please Help,

Jason


Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
I just finished instaling this mod on my site yesterday, and it works great but I have a tiny glitch that I can't seem to overcome...

When I click on the category and go to the categories page, only one subcategory shows up... I was under the impression that all subcategories listed should showup...

http://www.talkstox.com/pages/Biotechs_and_Pharmaceuticals/

It's still under construction...

Can somebody please advise how to fix this problem...

Re: JasonSR... Can you provide a link to your site... I had quite a learning curve with the installation of this mod myself...

Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
http://simreview.com/directory

i need some serious help
I have a template ready but i wanna get all my mods installed first.

Jason

Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
Put in a test category and build.... You've got a link but no category for it to go into...

Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
Many thanks to Paul Wilson for fixing my mess....

Again!!!!!!!!

...Ed

Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
The problem is in the sub link home in nph-build.cgi I believe. It's been a while since I have done this. On the interface on the adminstration part only (all)2 works properly. You have to form the nphbuild.cgi that builds the page the way you want it to come out.

I hope this helps, if it doesn't let me know and when I find more time I will see what I did and let you know for sure.

SearchAt!- Directory of Services
http://webbusinessservices.hypermart.net
Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
http://www.simgoracing.com/Jason/directory/
you guys see how it doesnt show the main dir?

Im just gonna give up on this. Does anyone have widgetz old mod for this? If so i NEED it bad.

Jason

Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
Can anyone help?

I made some modifications to the site_html_templates a while back using variations to this mod I picked up from this forum, however I cant remember which alterations I got where.

Can anyone tell me how I modify the already modified code that follows to generate 2, or possibly 3 columns for the category output?

Thanks.

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="100%" border="0" cellspacing="0" cellpadding="0"><tr><td class="catlist" valign="top">\n|;

sub byfield { $category{$a}[$cat_sort_field] cmp $category{$b}[$cat_sort_field] };
foreach $subcat (sort byfield @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];

# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<BR><font size=2><a class="catlist" href="$url"><b>$category_name</b></a><font> <font size=2 class="catlist">($numlinks)</font> |;
$output .= qq|<small><sup class="new">new</sup></small>| if (&days_old($mod) < $db_new_cutoff);
$output .= qq|
|;
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");
$category_name =~ tr/_/ /;
$output .= qq~<font size=2><a class="subcat" href="$url">$category_name</a>~;
$s++;
last if ($subcatstyle ne "ALL" && $#subcatsub > 0);
}
$output .= qq||;
}
undef $length;
if ($s < $#{$subcategories{$subcat}}) {
$output .= qq~<font size=2>....(more)</font>~ if ($style eq "1");
}
$output .= qq~
<font size=2>$description</font>
~ if(!($description=~/^[\s\n]*$/))
}
else {
$output .= qq|<font size=2>$description</font>
| if(!($description=~/^[\s\n]*$/));
}}
# Don't forget to end the table..
$output .= "</td></tr></table></div>\n";
return $output;
}

Quote Reply
Main cats not showing up In reply to
Hello,

I am having the same problem as Jason was having. It seems he gave up. Here is what happens when I build: When I build the pages and view the page it shows as (1). There is no category link just the #. Anyone have any ideas? In every category the subs show up, but not the main cat itself. Only (3) or whatever. Can someone give me input on this? Here is the URL The site is not designed yet just basic Links so it's ugly.
http://www.isolove.net/...g-sites/Adults_Only/

Thanks,
Doug

You might look at this dir too;
http://www.isolove.net/dating-sites/

Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
AnthroRules,

Hey, I'm really glad you posted this suggestion for change:
$output .= qq|<a class="catlist" href="$url">$category_name</a> <font class="catlist">($numlinks)</font> |;

I have went over this mod, and never got it to create the Main Categories. It would create the subs fine but NO Main Categories. I just found out it is because I was using this:
$output .= qq|<a class="catlist" href="$url">$description</a> <font class="catlist">($numlinks)</font> |;
Which adds the "description" in place of the main category name. I never added any descriptions for the categories as I did not want any so my "Main Categories" did not show up at all.

Thanks again, I appreciate it.

Doug

Quote Reply
Re: SUBCATEGORIES LIKE YAHOO v2.1 In reply to
Hello,
i,ve a problem with Style Types...
Vertical Layout (ordered by you)(Games|Utilites|Hacks)2

If I insert (Games)2
works,

but if I insert |(Games|Utilites|Hacks)2
don't works...
Wich is the problem..
Tanks


> > > >