Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

MOD: "updated" files show up in "what's new"

Quote Reply
MOD: "updated" files show up in "what's new"
This is a trivial mod to allow files that have been modified to show up on the "what's New" list. You can flag them as 'updated' by checking the 'isChanged' field in the template.

But, the purpose is so that links that have been changed are also set up to be re-viewed by people, not only links that are newly added.

Just replace the following lines in nph-build.cgi with the changed lines here. I listed the two whole clauses, but really only 2 lines have been changed(one changed, one added).

Code:
# Let's get all the new links and order them alphabetically, grouped by
# category. (isChanged added to pull out updated links)
$sth = $LINKDB->prepare (qq!
SELECT Links.*, Category.Name
FROM Links, Category
WHERE (Links.isNew = 'Yes' or Links.isChanged = 'Yes') AND Links.CategoryID = Category.ID
ORDER BY $LINKS{build_sort_order_new}
LIMIT 1000
!);
$sth->execute();
($sth->rows > 1000) and print "\tWarning: Max New links limit of 1,000 exceeded!\n";

# Build the html organized by date then by category.
$OUT{'total'} = 0;
while ($link = $sth->fetchrow_hashref) {
## The following line is added
## to prevent the updated link from building on it's old date.
($link->{isChanged} eq 'Yes') && ($link->{'Add_Date'} = $link->{'Mod_Date'});
${$link_output{$link->{'Add_Date'}}}{$link->{'Name'}} .= &site_html_link ($link);
$span_totals{$link->{'Add_Date'}}++;
$OUT{'total'}++;
}
http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Subject Author Views Date
Thread MOD: "updated" files show up in "what's new" pugdog 9187 Oct 12, 2000, 1:24 PM
Thread Re: [pugdog] MOD: "updated" files show up in "what's new"
Demolitioncrew 8815 Mar 24, 2003, 12:10 PM
Thread Re: [Demolitioncrew] MOD: "updated" files show up in "what's new"
pugdog 8802 Mar 24, 2003, 6:41 PM
Post Re: [pugdog] MOD: "updated" files show up in "what's new"
Demolitioncrew 8801 Mar 24, 2003, 6:43 PM