Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

[mv] decrementing the increment variable



******    message to minivend-users from "Russ Mann" <tech@khouse.org>     ******

Hello,

i would like to fix the bug in the search results in MV3.14-3 that causes a
search to look funny (with non-consecutive numbering) using the increment
variable when the [item-next] tag is used.

The code for this i found to be in Interpolate.pm line 3517 (ish).

Original Code:
        $item->{quantity}), $1)!geo;
                $run =~ s#$T{'item-last'}\]
                    \s* ($Some) \s*
                $T{'/item-last'}\]#
                    my $tmp = interpolate_html($1);
                    if($tmp && $tmp < 0) {
                        last;
                    }
                    elsif($tmp) {
                        $return = 1;
                    }
                    '' #xoge;
                $run =~ s#$T{'item-next'}\]
                    \s* ($Some) \s*
                $T{'/item-next'}\]#
                  interpolate_html($1) != 0 ? next : '' #xoge;
                $r .= $run;
                delete $item->{mv_cache_price};
                last if $return;

My attempt at fixing this:

        $item->{quantity}), $1)!geo;
                $run =~ s#$T{'item-last'}\]
                    \s* ($Some) \s*
                $T{'/item-last'}\]#
                    my $tmp = interpolate_html($1);
                    if($tmp && $tmp < 0) {
                        last;
                    }
                    elsif($tmp) {
                        $return = 1;
                    }
                    '' #xoge;
                $run =~ s#$T{'item-next'}\]
                    \s* ($Some) \s*
                $T{'/item-next'}\]#
                    my $jmp = interpolate_html($1);

               if($jmp && $jmp != 0) {
#               $run =~ s:$T{'item-increment'}\]:$i - 1:geo; #This, i was
hoping, would perform the actual decrement, but it cannot for obvoius
reasons.
               next;
               }
               '' #xoge;

                $r .= $run;
                delete $item->{mv_cache_price};
                last if $return;

This code fails with lots of problems, and i'm sure someone knows how to do
this right!

Thank you,

Russ Mann

-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: