Gossamer Forum
Home : Products : Gossamer Links : Discussions :

All new links on a single page?

Quote Reply
All new links on a single page?
The default for displaying new links is to divide them up into separate pages, eg:
Tuesday, 25 September 2001 (3) -> page 1
Monday, 24 September 2001 (1) -> page 2
Sunday, 23 September 2001 (1) -> page 3


I think this is useful only for projects which get a large number of submissions. When the expected number is low, eg: 2 or 3 per week, it is better to have all the new links on a single page, like this:
Tuesday, 25 September 2001 (3)
Links here
Monday, 24 September 2001 (1)
Links here
Sunday, 23 September 2001 (1)
Links here


It is easy to modify in flatfile Links 2.0, but I really can't figure out what I have to do in Links SQL.

Any pointers please?


Quote Reply
Re: [YoYoYoYo] All new links on a single page? In reply to
Hello Yoyo,

Well i try to help u:). Change in the admin under setup / build options the
parameter build_new_gb to yes (?). Then u have all links in 1 page.

Then on the same page change build_sort_order_new with first Add_Date (if u like Add_Date DESC).

Only u have 2 figure a way for the header:
Tuesday, 25 September 2001 (3) (btw: i would never put in the number like 3, looks really ugly:))

Maybe with globals and tweaking the what's new template.

Hope i did put u on the way and maybe someone else can give u the complete solution;)

Good luck with it.

Regards startpoint.
Quote Reply
Re: [startpoint] All new links on a single page? In reply to
Hi startpoint ...

That is how I have it already: build_new_gb = yes
It doesn't put them on one page -- it groups them by category on the multiple pages I don't want.

It's the only real flaw I have found in the Links SQL interface -- maybe not very significant, but it has to go.

Any more suggestions?


Quote Reply
Re: [YoYoYoYo] All new links on a single page? In reply to
Hi,

If you turn span pages off, it will do what you want, but has the side effect of turning off spanning in category pages. It really needs to get separated into two options (will do for the next version).

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] All new links on a single page? In reply to
Thanks Alex. I can survive without category spanning.
Quote Reply
Re: [Alex] All new links on a single page? In reply to
Is ther some way how to turn this new page dividing before some patch comes out? i really don't like this feature Unsure
Quote Reply
Re: [Alex] All new links on a single page? In reply to
I mean, is there some way how to TURN OFF spanning new links page into several days pages? I see that the post about that "it needs to be fixed" is quite old. So, is there some way how to do it? To have all new links on one page? Because if not, I would prefer to turn off new links page completely and not bother user with such a monstrous contruction.

Thank you in ahead for any advice :-)

Robo
Quote Reply
Re: [Robo] All new links on a single page? In reply to
Hi Robo ... bear in mind that it is not a fatal error, but it does result in an odd user interface that might look unprofessional on some sites.

Compared to other design and usability issues we are dealing with, it's very minor. Eventually, we decided that we had to use category spannning as the amount of information in most links is large. We found an easy workaround for building New without spanning by date, but now we have dropped it. The principle is "if the users don't need it, don't build it". Flagging new and updated links is more than enough.

Anyway, you could try this ...

In nph-build.cgi, in sub _build_new about line 350, comment out
Code:
if ($CFG->{build_span_pages}) {
and replace it with
Code:
if (0) {
and (of course) make sure you insert an inline comment stating what you did, why and when so that you can find it again.

Then set build_span_pages = Yes.

I'm doing this mainly from memory, but I think that is all you need to do.

A warning: this workaround is satisfactory only for static builds. It's no good for dynamic pages (try it and see).
Quote Reply
Re: [YoYoYoYo] All new links on a single page? In reply to
Thank you TuTuTuTu !!!

I am amazed of what can such a small piece of code do Smile. It works great (I am using dynamic view only for design testing anyway). I really think if it such a easy thing, you should provide it to the users, as they use LSQL to run small directories very often.

Thank you again Laugh

Robo

P.S. Just curious: are you an user or GT programmer?
Quote Reply
Re: [Robo] All new links on a single page? In reply to
Well, a workaround hack is not a solution. Every hack has a risk of side-effects, and should be considered temporary until GT fix it properly.

In Reply To:
P.S. Just curious: are you an user or GT programmer?
Me? A GT programmer? I'm just an ordinary GT customer like most people here.

Last edited by:

YoYoYoYo: Jul 25, 2002, 1:01 AM
Quote Reply
Re: [Robo] All new links on a single page? In reply to
>>
P.S. Just curious: are you an user or GT programmer?
<<

GT programmers have "staff" under their username Wink

Last edited by:

Paul: Jul 25, 2002, 2:52 AM
Quote Reply
Re: [YoYoYoYo] All new links on a single page? In reply to
OH I forgot:

There are some lines that NEED to be deleted from Build.pm for this mod to work correctly. Otherwise it will still show the dates in What's New page:

Code:
my $seen = 0; my @dates; my $output = ''; DATE: foreach my $date (@date_order) { my @links; if ($opts->{gb}) { CAT: foreach my $cat (sort keys %{$grouped_output->{$date}}) { my $title = build ('title_linked', { name => $cat, complete => 1 }); $output .= $title; $output .= join ("", map { Links::SiteHTML::display('link', $_) } @{$grouped_output->{$date}->{$cat}}); $grouped_output->{$date}->{$cat}->[0]->{title_linked} = $title; push @links, @{$grouped_output->{$date}->{$cat}}; } } else { $output .= join ("", map { Links::SiteHTML::display('link', $_) } @{$grouped_output->{$date}->{'none'}}); push @links, @{$grouped_output->{$date}->{'none'}}; } push @dates, { date => $date, links => \@links }; } return Links::SiteHTML::display ('new', { total => $total, grand_total => $GRAND_TOTAL, link_results => $output, title => $title, title_linked => $title_l, title_linked_loop => \@dates });}END_OF_SUB
Quote Reply
Re: [YoYoYoYo] All new links on a single page? In reply to
In Reply To:
A warning: this workaround is satisfactory only for static builds. It's no good for dynamic pages (try it and see).

The reason is doesn't work for dynamic pages is because dynamic pages don't use nph-build.cgi -- they use page.cgi !

To get the same effect in dynamic mode,
in /admin/Links/User/Page.pm, sub generate_new_page, at about line 155, comment out
Code:
elsif ($CFG->{build_span_pages}) {
and replace it with
Code:
elsif (0) {
and (of course) make sure you insert an inline comment stating what you did, why and when so that you can find it again.