Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Selective links on "New Page"

Quote Reply
Selective links on "New Page"
Hi,
I am looking for a way to diplay only certain new links on the new page. I have a field in my links database to go on, so I want something like this: if linkfield1=special or if linkfield1=great and the link matches the days old criteria then it would be concidered new, if linkfield1=null or anything else, then it will not be included on the new page.... anyone know how I might be able to do this?
George
Quote Reply
Re: [macbethgr] Selective links on "New Page" In reply to
Anyone?
Quote Reply
Re: [macbethgr] Selective links on "New Page" In reply to
Hi macbethgr

This is probably not exactly what you are looking for but it may get you started.

If there are no links in a certain category, I display the new links for the site instead, here’s how I do it.

Global called newlinks:

sub {
# Displays the new links site wide.
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY ADD_DATE DESC', 'Limit 10');
$sth = $search_db->select ( { isNew => 'Yes'}, { isValidated => 'Yes'});
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link_newlinks', $link);
}
return $output;
}

In category.html Template:

<%if links%>
<%links%>
<%endif%>

<%ifnot links%>
<!-- Inludes the new_links_display.html template -->
<%include new_links_display.html%>
<%endif%>

In new_links_display.html Template:

<%if newlinks%>
New additions to the Directory.
<%newlinks%>
<%endif%>

In link_newlinks.html

<%if LinkType contains 'Classifieds'%>
<%include link_classifieds.html%>
<%endif%>

You could try something like this:

Use the same Global and templates ( Change as required ) as above then:

In new.html Template

<%if new_index%>
<!-- Displays a list of dates and counts for each link -->
<ul><%link_results%></ul>
<%else%>
<!-- Displays the actual new links. -->
<%include new_links_display.html%>
<%endif%>

There’s probably a simpler way to do this, but as mentioned it will get you started.Let me know what you come up with as I might be able to streamline this method for myself.

Regards

minesite
Quote Reply
Re: [minesite] Selective links on "New Page" In reply to
Thanks,
This is a great start...
George