[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: Remembering mv_searchspec (Was: Re: Thanks a lot!)
****** message to minivend-users from Frank Miedreich <miedreich@acm.org> ******
Hi Joachim,
Yes, you can use a similar scheme with coordinated et al.
The only change is that mv_searchspec will need to be parsed by a simple
perl script. Basically the stacked variables like mv_searchpsec contain the
individual term in a list delimited by '\0'. So here is a simple example:
[set search values]
[perl arg=values interpolate=1]
my($msg)='[value mv_searchspec]';
my($price)='[value mv_range_max]';
my(@items)=split (/\0/, $msg);
$Safe{'values'}{'s_category'} = $items[0];
$Safe{'values'}{'s_subcategory'} = $items[1];
$Safe{'values'}{'s_price'} = $price;
return '';
[/perl]
[/set]
This would be for a two field coordinated search for category and
subcategory combined with a single field range_look, setting an upper limit
on price.
Note:
The only problem with this script is the choice of delimiter. '\0'
worked in minivend 3.11, but this is of course implementation
dependent. If you get problems, dump the content of mv_searchspec
and check what is used.
The delimiter is probably defined some place in the minivend source
code, I just never got around looking. Accessing the delimiter from
minivend directly, would make sure the solution is compatible with
future versions of minivend.
Cheers, Frank
>****** message to minivend-users from "Hans-Joachim Leidinger"
><hans-joachim.leidinger@home.gelsen-net.de> ******
>
>Hello Frank,
>
>can i use this solution with mv_searchspec_map ??? My mv_searchspec_map
>has 5 searchfields and some condition (coordinate, searchtype, etc.).
>
>Joachim
>
>
>
>>****** message to minivend-users from Frank Miedreich
><miedreich@acm.org> ******
>>
>>Put the following stuff on your searchpage:
>>
>>[set search values]
>>[value name="searchterm" set="[value mv_searchspec]"]
>>[/set]
>>
>>and include:
>>
>><INPUT TYPE="hidden" NAME="mv_check" VALUE="search values">
>>
>>in your search definition.
>>
>>this will allow you to display [value searchterm] on all subsequent
>result
>>pages.
>>
>>As an added extra you get the option to let users edit their searchterm
>on
>>subsequent searches by setting mv_searchspec with:
>>
>><INPUT TYPE="Text" NAME="mv_searchspec" VALUE="[value searchterm]">
>>
>>This way they can conveniently correct a search when they dicover a
>simple
>>typo.
>>
>>
>>A second solution is setting a scratch var or value on the result page,
>if
>>mv_searchspec is not empty. Display that variable. Same effect.
>>
>>
>>Greetings, Frank
--
Dual rounds of ROT-13 encryption discontinued. Somebody was able to crack this.
Frank Miedreich
Max-Planck-Institut fuer psychologische Forschung
-
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