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

Re: Featured Site mod help

Quote Reply
Re: Featured Site mod help In reply to
Mornin'. So, I impressed you with my blundering, eh? Smile

I tried the while loop, but that doesn't print anything to the text file... ($Descript should be $descript in the print line.) I moved the foreach line outside the fetchrow_hashref like you suggested, making the subroutine:
Code:
my ($featured_r, $sth, %OUT, %link_output);

$sth = $LINKDB->prepare (qq!
SELECT *
FROM Links
WHERE Links.isFeatured = 'Yes'
!);
$sth->execute();
foreach $featured_r (sort keys %link_output) {
if ($sth->rows) {
$featured_r = $sth->fetchrow_hashref();
}

%OUT = (); # Start with a clean hash.
$OUT{ID} = $featured_r->{'ID'};
$OUT{Title} = $featured_r->{'Title'};
$OUT{URL} = $featured_r->{'URL'};
$OUT{Description} = $featured_r->{'Description'};
}

open (FEATURED, ">$LINKS{build_root_path}/featured_test.txt") or die ("unable to open featured page: $LINKS{build_root_path}/featured_test.txt. Reason: $!");
print FEATURED &site_featured_template(\%OUT);
close(FEATURED);
That still only outputs one link to the file and doesn't recognize the tags:

"<a target="_blank" href="http://run-down.com/cgi-bin/runlinks/jump.cgi?ID=Unkown Tag: ID">Unkown Tag: Title</a> <BR><BR>"

How does sort keys %link_output work?

Thanks,
Dan
Subject Author Views Date
Thread Featured Site mod help Dan Kaplan 8103 Mar 13, 2000, 11:52 AM
Post Re: Featured Site mod help
phoule 7935 Mar 13, 2000, 1:38 PM
Post Re: Featured Site mod help
Dan Kaplan 7934 Mar 13, 2000, 4:39 PM
Post Re: Featured Site mod help
pugdog 7937 Mar 13, 2000, 5:26 PM
Post Re: Featured Site mod help
phoule 7933 Mar 13, 2000, 5:40 PM
Post Re: Featured Site mod help
Dan Kaplan 7938 Mar 13, 2000, 6:57 PM
Post Re: Featured Site mod help
pugdog 7974 Mar 13, 2000, 7:22 PM
Post Re: Featured Site mod help
phoule 7928 Mar 13, 2000, 7:34 PM
Post Re: Featured Site mod help
Dan Kaplan 7946 Mar 13, 2000, 7:52 PM
Post Re: Featured Site mod help
phoule 7929 Mar 13, 2000, 8:27 PM
Post Re: Featured Site mod help
phoule 7955 Mar 14, 2000, 3:39 AM
Post Re: Featured Site mod help
Dan Kaplan 7937 Mar 14, 2000, 3:49 AM
Post Re: Featured Site mod help
phoule 7934 Mar 14, 2000, 4:49 AM
Post Re: Featured Site mod help
Dan Kaplan 7932 Mar 14, 2000, 6:33 AM
Post Re: Featured Site mod help
Dan Kaplan 7941 Mar 14, 2000, 8:43 AM
Post Re: Featured Site mod help
Dan Kaplan 7934 Mar 14, 2000, 9:08 AM
Post Re: Featured Site mod help
phoule 7931 Mar 15, 2000, 3:41 AM
Post Re: Featured Site mod help
Dan Kaplan 7936 Mar 15, 2000, 7:19 AM
Post Re: Featured Site mod help
phoule 7937 Mar 15, 2000, 8:18 AM
Post Re: Featured Site mod help
Dan Kaplan 7948 Mar 15, 2000, 8:18 PM
Post Re: Featured Site mod help
Dan Kaplan 7937 Mar 16, 2000, 7:37 PM
Post Re: Featured Site mod help
pugdog 7941 Mar 16, 2000, 8:54 PM
Post Re: Featured Site mod help
Dan Kaplan 7945 Mar 16, 2000, 9:05 PM
Post Re: Featured Site mod help
Dan Kaplan 7945 Mar 17, 2000, 8:04 AM
Post Re: Featured Site mod help
pugdog 7924 Mar 17, 2000, 8:34 AM
Post Re: Featured Site mod help
pugdog 1380 Mar 17, 2000, 6:21 PM
Post Re: Featured Site mod help
Dan Kaplan 1381 Mar 18, 2000, 7:14 PM