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 5071 Jul 22, 2000, 9:53 AM
Thread Re: Display link away from others?
Stealth 4947 Jul 22, 2000, 11:41 AM
Thread Re: Display link away from others?
jeffb 4924 Jul 23, 2000, 3:26 AM
Thread Re: Display link away from others?
Stealth 4904 Jul 23, 2000, 10:01 AM
Thread Re: Display link away from others?
jeffb 4942 Jul 23, 2000, 1:39 PM
Thread Re: Display link away from others?
Stealth 4923 Jul 23, 2000, 1:48 PM
Post Re: Display link away from others?
jeffb 4919 Jul 23, 2000, 1:52 PM
Thread Re: Display link away from others?
pugdog 4908 Jul 23, 2000, 2:54 PM
Thread Re: Display link away from others?
jeffb 4919 Jul 23, 2000, 3:21 PM
Thread Re: Display link away from others?
pugdog 4920 Jul 23, 2000, 4:17 PM
Thread Re: Display link away from others?
jeffb 4856 Jul 24, 2000, 9:55 AM
Thread Re: Display link away from others?
Stealth 4863 Jul 24, 2000, 9:59 AM
Post Re: Display link away from others?
pugdog 4845 Jul 24, 2000, 10:00 AM
Thread Re: Display link away from others?
jeffb 4868 Jul 24, 2000, 10:38 AM
Post Re: Display link away from others?
Stealth 4863 Jul 24, 2000, 10:48 AM
Post Re: Display link away from others?
pugdog 4836 Jul 24, 2000, 10:52 AM
Thread Re: Display link away from others?
jeffb 4819 Jul 24, 2000, 3:40 PM
Thread Re: Display link away from others?
pugdog 4798 Jul 25, 2000, 12:09 AM
Thread Re: Display link away from others?
jeffb 4795 Jul 25, 2000, 2:39 AM
Post Re: Display link away from others?
pugdog 4805 Jul 25, 2000, 10:25 AM