Gossamer Forum
Quote Reply
Yahoo
I have been able to find loads of links that offer the yahoo mod, but all of them that I have found require you to write over your existing files with the the mods files. I have installed a number of mods allready and done allot of work to the templates, layout etc and would like to know if anyone has instrauctions to rather edit existing files rather then ovewritting.

Hamsterpants
Quote Reply
Re: [Hamsterpants] Yahoo In reply to
Here is the simple way to do it:



# 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> |;
my $days_old = &days_old($mod) / $db_new_cutoff;
if ($days_old <= 0.3) { $output .= qq| $new1|; }
elsif ($days_old <= 0.6) { $output .= qq| $new2|; }
elsif ($days_old <= 1) { $output .= qq| $new3|; }
if ($mod eq "Yes") { $output .= qq~ $updated~; }
$output .= qq|</dt>|;

if ($#{$subcategories{$subcat}} >= 0) {
$v = 0;
$output .= qq~<BR><SPAN CLASS="xsmall">~;
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);}
$output .= qq~<A HREF="$suburl">$subcategory_name</A>~ if ($v <= 5);
$output .= qq~<font color="#000000">...</font>~ if ($v eq "5");
$output .= qq~<font color="#000000">, </font>~ if ($v ne $#{$subcategories{$subcat}} && $v <= 5);
$v++;
}
$output .= qq~</SPAN>~;
}


$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
$output .= qq|</dl>|;
}

# Don't forget to end the unordered list..


It's from this post: http://www.gossamer-threads.com/...late-version;#127003 Just watch this part: <SPAN CLASS="xsmall"> You will ned to change it to match what you have (or use HTML).


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Yahoo In reply to
Hi Leonard,

Thanks for the promt response. Added the code, but all thats happened now is that the subcats are displayed on the home page. I assume that there is something that I need to add in the category template inorder for it to display in the yahoo fashion, as the category page has not changed at all yet.

Thanks
Hamsterpants
Quote Reply
Re: [Hamsterpants] Yahoo In reply to
Yes, all that mod changes is the home/index page. You're wanting all sub-pages to list sub-sub-cats? Like this:

Sub-page

subcat1

subsubcat1

subsubcat2


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Yahoo In reply to
Hi Leonard,

It has donr one of the things I wanted it to do, the other thing that I would to do is when you click on a category, the next page displays the subcates. I would like to show the links on this page aswell, i.e. the same as the yahoo mod does.

Hamsterpants