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

Re: Display link away from others?

Quote Reply
Re: Display link away from others? In reply to
I replaced the old mod:


for my $i (0 .. $numlinks - 1) {
$tmp = $LINKDB->array_to_hash (${$links_r}[$i]);
if ($tmp->{Priority} > 0) {
$OUT{featured} .= &site_html_link ($tmp);
}
}


with your code above, i.e.


for my $i (0 .. $numlinks - 1) {
$tmp = $LINKDB->array_to_hash (${$links_r}[$i]);
## $tmp is now a pointer to a hash of the Link values _NOT_ an array pointer!
## delete()ing tmp would do nothing to the original array elements.
if ($tmp->{Priority} > 0) {
$OUT{featured} .= &site_html_link ($tmp);
splice (@$links_r, $i, 1); ## need to dereference the array
$numlinks=$numlinks-1; ## need to reset the size of the array
$i=$i-1; ## need to re-check the new element $1
}
}


But I get this error when I build:

DBSQL (9687): Fatal Error: Invalid argument type '' passed to array_to_hash at nph-build.cgi line 461

Did I need to add any other code around the new code or what have I done wrong?

JeffB



Subject Author Views Date
Thread Display link away from others? jeffb 5172 Jul 22, 2000, 9:53 AM
Thread Re: Display link away from others?
Stealth 5045 Jul 22, 2000, 11:41 AM
Thread Re: Display link away from others?
jeffb 5023 Jul 23, 2000, 3:26 AM
Thread Re: Display link away from others?
Stealth 5002 Jul 23, 2000, 10:01 AM
Thread Re: Display link away from others?
jeffb 5041 Jul 23, 2000, 1:39 PM
Thread Re: Display link away from others?
Stealth 5021 Jul 23, 2000, 1:48 PM
Post Re: Display link away from others?
jeffb 5017 Jul 23, 2000, 1:52 PM
Thread Re: Display link away from others?
pugdog 5007 Jul 23, 2000, 2:54 PM
Thread Re: Display link away from others?
jeffb 5017 Jul 23, 2000, 3:21 PM
Thread Re: Display link away from others?
pugdog 5019 Jul 23, 2000, 4:17 PM
Thread Re: Display link away from others?
jeffb 4955 Jul 24, 2000, 9:55 AM
Thread Re: Display link away from others?
Stealth 4961 Jul 24, 2000, 9:59 AM
Post Re: Display link away from others?
pugdog 4943 Jul 24, 2000, 10:00 AM
Thread Re: Display link away from others?
jeffb 4967 Jul 24, 2000, 10:38 AM
Post Re: Display link away from others?
Stealth 4963 Jul 24, 2000, 10:48 AM
Post Re: Display link away from others?
pugdog 4934 Jul 24, 2000, 10:52 AM
Thread Re: Display link away from others?
jeffb 4917 Jul 24, 2000, 3:40 PM
Thread Re: Display link away from others?
pugdog 4896 Jul 25, 2000, 12:09 AM
Thread Re: Display link away from others?
jeffb 4894 Jul 25, 2000, 2:39 AM
Post Re: Display link away from others?
pugdog 4903 Jul 25, 2000, 10:25 AM