MiniVend Akopia Services

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

Re: Beyond Remembering mv_searchspec



******    message to minivend-users from Frank Miedreich <miedreich@acm.org>     ******

>******    message to minivend-users from "Thompson-Jordan"
><Thompson-Jordan@mindspring.com>     ******
>
>In a previous thread it was discussed how to assign mv_searchspec into
>variables using Perl. That works for mv_searchspec, but the other search
>variables do not seem to keep their values (e.g. mv_coordinate,
>mv_search_field) on the results page. For example, if I put the following on
>a results page:
>
>co=[value mv_coordinate]=
>sf=[value mv_search_field]=
>se=[value mv_searchspec]=
>
>I get:
>
>co==
>sf==
>se=mysearch=
>
>How do I access all these search variables that went into generating the
>page? My goal is to have a results page be able to resubmit itself. I will
>then change parts of the page's appearance with other variables. I am using
>MV 3.11
>

Hi,

the perl solution should work with any variable set on any form.

after you set mv_check to search values, you can do:

[set search values]
[perl arg=values interpolate=1]
        $Safe{'values'}{'se'} = '[value mv_searchspec]';
        $Safe{'values'}{'sf'} = '[value mv_search_field]';
        $Safe{'values'}{'co'} = '[value mv_coordinate]';
        return '';
[/perl]
[/set]

no need to do this in perl though, you should be able to do:
[set search values]
[value name="se" set="[value mv_searchspec]"]
[value name="sf" set="[value mv_search_field]"]
[value name="co" set="[value mv_coordinate]"]
[/set]


you can split stacked vars with:

[set search values]
[perl arg=values interpolate=1]
# first for searchspec
        my($msg1)='[value mv_searchspec]';
        my(@items)=split (/\0/, $msg);
        $Safe{'values'}{'se_1'} = $items[0];
        $Safe{'values'}{'se_2'} = $items[1];
# and now for searchfield
	$msg='[value mv_search_field]'
	@items=split (/\0/, $msg);
        $Safe{'values'}{'sf_1'} = $items[0];
        $Safe{'values'}{'sf_2'} = $items[1];
        return '';
[/perl]
[/set]


I just would not overdo it. If you really want to be able for the search
page to resubmit everything, check the urls generated by more list.
minivend remembers the search anyway, so you might not need to do that.

BTW: The variables don't remember their values for a good reason. Otherwise
the next search might not work, e.g. if a previous search was a range_look,
and the current search for a string, you would get unexpected results if
the range_look would still be active.

Happy minivending.

Frank


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


Search for: Match: Format: Sort by: