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

Re: Featured Site mod help

Quote Reply
Re: Featured Site mod help In reply to
Hey Dan,

Code:
foreach $featured_r (sort keys %link_output) {
if ($sth->rows) {
$featured_r = $sth->fetchrow_hashref();
}



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);

These two parts need to be combined into one. Each time you go through the foreach loop it needs to print a line in featured_test.txt. In this case there are 2 %featured_r in %link_output. Open the file before you start the foreach, then place the print FEATURED inside the foreach after $feature_r gets assigned the right variables. Then close FEATURED after the foreach id done it's iterations.

So it would look more like:
Code:
%OUT = (); # Start with a clean hash.
open (FEATURED, ">$LINKS{build_root_path}/featured_test.txt") or die ("unable to open featured page: $LINKS{build_root_path}/featured_test.txt. Reason: $!");
foreach $featured_r (sort keys %link_output) {
if ($sth->rows) {
$featured_r = $sth->fetchrow_hashref();
$OUT{ID} = $featured_r->{'ID'};
$OUT{Title} = $featured_r->{'Title'};
$OUT{URL} = $featured_r->{'URL'};
$OUT{Description} = $featured_r->{'Description'}; print FEATURED &site_featured_template(\%OUT);

}
close(FEATURED);

As for the other db_select_field thing, I'm not sure it should work if it got added into you SQL database as an enum object. Check that when you edit the field properties you check the box in the first column, otherwie changes you request will not be processed. I know I've done that a few times and couldn't figure out why, realizing much later that it was just that.

Good luck
Subject Author Views Date
Thread Featured Site mod help Dan Kaplan 8020 Mar 13, 2000, 11:52 AM
Post Re: Featured Site mod help
phoule 7855 Mar 13, 2000, 1:38 PM
Post Re: Featured Site mod help
Dan Kaplan 7854 Mar 13, 2000, 4:39 PM
Post Re: Featured Site mod help
pugdog 7857 Mar 13, 2000, 5:26 PM
Post Re: Featured Site mod help
phoule 7852 Mar 13, 2000, 5:40 PM
Post Re: Featured Site mod help
Dan Kaplan 7858 Mar 13, 2000, 6:57 PM
Post Re: Featured Site mod help
pugdog 7894 Mar 13, 2000, 7:22 PM
Post Re: Featured Site mod help
phoule 7848 Mar 13, 2000, 7:34 PM
Post Re: Featured Site mod help
Dan Kaplan 7865 Mar 13, 2000, 7:52 PM
Post Re: Featured Site mod help
phoule 7849 Mar 13, 2000, 8:27 PM
Post Re: Featured Site mod help
phoule 7875 Mar 14, 2000, 3:39 AM
Post Re: Featured Site mod help
Dan Kaplan 7857 Mar 14, 2000, 3:49 AM
Post Re: Featured Site mod help
phoule 7854 Mar 14, 2000, 4:49 AM
Post Re: Featured Site mod help
Dan Kaplan 7851 Mar 14, 2000, 6:33 AM
Post Re: Featured Site mod help
Dan Kaplan 7860 Mar 14, 2000, 8:43 AM
Post Re: Featured Site mod help
Dan Kaplan 7854 Mar 14, 2000, 9:08 AM
Post Re: Featured Site mod help
phoule 7851 Mar 15, 2000, 3:41 AM
Post Re: Featured Site mod help
Dan Kaplan 7856 Mar 15, 2000, 7:19 AM
Post Re: Featured Site mod help
phoule 7856 Mar 15, 2000, 8:18 AM
Post Re: Featured Site mod help
Dan Kaplan 7867 Mar 15, 2000, 8:18 PM
Post Re: Featured Site mod help
Dan Kaplan 7857 Mar 16, 2000, 7:37 PM
Post Re: Featured Site mod help
pugdog 7860 Mar 16, 2000, 8:54 PM
Post Re: Featured Site mod help
Dan Kaplan 7865 Mar 16, 2000, 9:05 PM
Post Re: Featured Site mod help
Dan Kaplan 7864 Mar 17, 2000, 8:04 AM
Post Re: Featured Site mod help
pugdog 7844 Mar 17, 2000, 8:34 AM
Post Re: Featured Site mod help
pugdog 1367 Mar 17, 2000, 6:21 PM
Post Re: Featured Site mod help
Dan Kaplan 1367 Mar 18, 2000, 7:14 PM