Gossamer Forum
Home : Products : Links 2.0 : Customization :

Last Links not build in category

Quote Reply
Last Links not build in category
I can't use "build all" anymore. So I have to use "auto build staggered"
Works fine for me, but I have one small problem Unimpressed

When I use "build all" my last 5 links are shown on every page below my menu.
When I use "auto build staggered" my last 5 links are only shown in home.html but not in all other category.html pages???

Do you have suggestions to fix this?

Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Last Links not build in category In reply to
Which mod are you using? Post what you have changed from nph-build.cgi (not the whole file)...


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Last Links not build in category In reply to
###############################################################################################
# Eingefügt für lastlinks mod #
###############################################################################################
my $LASTX = 4;
open (DB, "<$db_file_name") or &cgierr("Kann die Datei bzw. Verzeichnis nicht öffnen:$db_file_name.\nGrund: $!");
my @lines = <DB>;
close DB;
for ($i=$#lines; $i>=$#lines - $LASTX; $i--) {
chomp $lines[$i];
@tmp = &split_decode ($lines[$i]);
%tmp = &array_to_hash (0, @tmp);
$lastlink .= &site_html_lastlink (%tmp);
}
###############################################################################################
# Ende lastlinks mod #
###############################################################################################

above thats the part in nhp-build.cgi

Its strange! When I build links with "auto staggerd" the last links in categories disappear, but are still there in home.html
When I "build all" after that. The last links are there again in categories and home.html???

Matthias


Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Last Links not build in category In reply to
According to the mod instructions, that code should be in sub build_home_page. Did you also put it in sub build_category_pages? If not, try that. Put it just after

# Let's make sure the directory exists, build it if it doesn't.
$dir = &build_dir ($cat);
print "\tDirectory: $dir\n";
print "\tFilename : $dir/$build_index\n";

You must have also put the <%lastlink%> tag in your category template?

The only other thing that I can think of right off is to try renaming the array, as the name is common:

@temp = &split_decode ($lines[$i]);
%temp = &array_to_hash (0, @temp);
$lastlink .= &site_html_link (%temp);


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Last Links not build in category In reply to
Hi Leonard,
I put the code in sub build_category_pages, too.
In "build staggered auto" everything works fine now, but when I use "build all" the last links appear two times???
Strange isn't it?

The e in temp made no difference.

Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Last Links not build in category In reply to
Try removing the code from sub build_category_pages, and putting it in sub build_single_category, between these lines:

$name = $values[$db_main_category];
here
if ($name eq $category) {

That sub is only used during a staggered build, so maybe that's where to fix it?


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Last Links not build in category In reply to
Hi Leonard,
that's it "Last link mod" is working now in home.html and category.html even when I use "build staggered auto"

but

now after "build staggered auto" some categories loose their subcategories?

When I "build all" the subcategories appear again?

One fix causes another problem Unsure

Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Last Links not build in category In reply to
This is all just shootin' in the dark, but we're gettin' closer...

Try moving the code down (in the same sub) to between these lines:

close DB;
here
# Sort the links.

That will put it after all the category work is done...
Anyone else have any ideas, feel free to jump in!


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Last Links not build in category In reply to
Hi Leonard,
I think that's it.
So far, I can't find any errors anymore.

Thank you very much, again.
Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Last Links not build in category In reply to
Smile I hope that fixes it!
So, you have it there, and in sub build_home_page?


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Last Links not build in category In reply to
In Reply To:
So, you have it there, and in sub build_home_page?


Yes, I have it in

sub build_single_category
and
sub build_home_page


Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Last Links not build in category In reply to
Thinkin' about it, you could probably remove it from sub build_home_page and move it to sub build_category_pages (where shown in previous post), and also leave it in sub build_single_category.

I think the mod was originally intended to only put the new links on the home page, so the author put the code in that sub, but actually, the calculating of what's new occurs in the other two subs: one for build-all, the other for build-staggered.

If you test this theory, let me know what the results are...


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Last Links not build in category In reply to
In Reply To:
Thinkin' about it, you could probably remove it from sub build_home_page and move it to sub build_category_pages (where shown in previous post), and also leave it in sub build_single_category.

Just tested, by this way you are loosing "last links" in home.html Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Last Links not build in category In reply to
So, putting it in sub build_home_page and sub build_single_category works OK with both build-all and build-staggered? And you put the <%lastlink%> tag in the home and category templates? Just wanting to clarify, for future reference...


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Last Links not build in category In reply to
That's what I did.
And it works fine for me.

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Last Links not build in category In reply to
Hi Leonard,
I just detected another problem with the lastlink mod, when I use auto_build_staggered!
In home.html everthing is O.K.
see on the left side under "Neue Materialien"
http://www.gpaed.de/unterrichtsmaterial/

in categories.html everthing is O.K. too?
see on the left side under "Neue Materialien"
http://www.gpaed.de/...ial/Arbeitsblaetter/

BUT in the subcategories the last links are build two times?
see on the left side under "Neue Materialien"
http://www.gpaed.de/...itsblaetter/Deutsch/

And when there is a subsubcategory the last links are build even three times?

When I use build all everthing is O.K.
The problem exists only in auto_build_staggerd.

Do you have a solution?

Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Last Links not build in category In reply to
This may solve the problem...

http://www.gossamer-threads.com/...?post=292239#p292239


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Last Links not build in category In reply to
Thanks Leonard,
but I moved over to gossamer links.

Matthias

Matthias
gpaed.de