Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

last links added aka newest links

Quote Reply
last links added aka newest links
Hi,

Andy made a global for me and it works great, but I would like to just have the title of the link appear instead of the whole link contents. The descriptions are 4 -5 lines and it takes up too much room for my space provided.

Is there a way I can modify the global to accomplish this or do I need to make a new one?

Last edited by:

SSmeredith: Jan 16, 2003, 11:23 AM
Quote Reply
Re: [SSmeredith] last links added aka newest links In reply to
We can't help if we can't see the global.
Quote Reply
Re: [Paul] last links added aka newest links In reply to
Ooops, I knew I forgot something...

sub {
my $vals = shift;
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY ID DESC', 'LIMIT 6');
my $sth = $link_db->select( { isNew => "Yes", isValidated => "Yes" } );
my $output = '';
while (my $link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display('link', $link);
}
return $output;
}


Thanks for the speedy response!
Quote Reply
Re: [SSmeredith] last links added aka newest links In reply to
This should do it...

sub {
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY ID DESC', 'LIMIT 6');
my @titles = $link_db->select('DISTINCT(Title)', 'URL', { isNew => "Yes", isValidated => "Yes" } )->fetchall_list;
return join ("<br>", map { qq|<a href="$CFG->{db_cgi_url}/ppc_jump.cgi?id=$link->{ID}">$_</a>| }@titles);
}

Last edited by:

Paul: Jan 16, 2003, 12:14 PM
Quote Reply
Re: [Paul] last links added aka newest links In reply to
It works! (of course)

I have the titles only but they aren't linked up. Can you filter out double and triple listings from showing up on title only?

See: http://constructionclub.com/cgi-bin/linkssql/page.cgi?
Quote Reply
Re: [SSmeredith] last links added aka newest links In reply to
I am truly grateful for your help. I'm not much on contributions of this type but I've got some pretty good ideas for plug-in or add ons the Links program Blush

Last edited by:

SSmeredith: Jan 16, 2003, 12:04 PM
Quote Reply
Re: [SSmeredith] last links added aka newest links In reply to
This should do it...

Code:
sub {
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY ID DESC', 'LIMIT 6');
my $links = $link_db->select('DISTINCT(Title)', 'ID', { isNew => "Yes", isValidated => "Yes" } )->fetchall_arrayref;
return join ("<br>", map { qq|<a href="$CFG->{db_cgi_url}/ppc_jump.cgi?ID=$_->[1]">$_->[0]</a>| }@$links);
}

Last edited by:

Paul: Jan 16, 2003, 12:16 PM
Quote Reply
Re: [Paul] last links added aka newest links In reply to
That's it! I notice you caught the ppc part. I wasn't even going to mention that.

Thanks much and appreciate the support. You are an Angelic

Have a good day,

Meredith

Last edited by:

SSmeredith: Jan 16, 2003, 12:31 PM
Quote Reply
Re: [SSmeredith] last links added aka newest links In reply to
Quote:
That's it! I notice you caught the ppc part. I wasn't even going to mention that.

I'm not just a pretty face you know :)

Quote:
Have a good day,

Thanks :)

It's nearly 9pm but I'll pretend you said "have a good evening"..hehe
Quote Reply
Re: [Paul] last links added aka newest links In reply to
Yeah, about that face?? You should post it sometime, I'm sure we all want to know Wink

Am I going to get in trouble for getting off topic. I hardly ever get out you know. I'm finished.

Bye,

And have a Good evening,

Meredith
Quote Reply
Re: [SSmeredith] last links added aka newest links In reply to
Quote:
Yeah, about that face?? You should post it sometime, I'm sure we all want to know

See: http://gossamer-threads.com/...;;page=unread#unread

Last edited by:

Paul: Jan 16, 2003, 1:00 PM