[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
[mv] Problem with mv_search_field in one-click-searches
****** message to minivend-users from Chris Rapier <rapier@psc.edu> ******
I'm using the following code to conduct some one click searches in this
site...
<a
href="http://__SERVER_NAME____CGI_URL__/scan/sf=bluechip/se=%22baseball%22/va=category_name%3dBlue%20Chip%20Cards/tf=bluechip%2cyear/ml=5.html">
On the results pages I originally had some code set up to generate
apropriate titles and header images based on the value in mv_searchspec.
[seti catname][value-extended name=mv_searchspec][/seti]
[perl]
$search = $Scratch->{catname};
($title, $junk) = split /\\/, $search;
$title =~ tr/a-z/A-Z/;
if ($title eq "BASEBALL") {
$Scratch->{'title'} = "Baseball Cards";
$Scratch->{'titleimage'} =
"http://__SERVER_NAME____IMAGE_DIR__/baseballtitle.jpg";
}
elseif (.... [and so on]
This worked rather well... I then tried to expand it to use information
in mv_search_field as well. This was necessary for two special cases.
When the quesry was made as the result of a form action everything works
the way that I expect - However, when its the result of a one click
search then it doesn't seem like the specified searchfield is actually
being used...
Here is the new code:
[seti catname][value-extended name=mv_searchspec][/seti]
[seti blackandblue][value name=mv_search_field][/seti]
[perl]
$search = $searchbnb = $title = $titlebnb = "";
$search = $Scratch->{catname};
($title, $junk) = split /\\/, $search;
$title =~ tr/a-z/A-Z/;
$searchbnb = $Scratch->{blackandblue};
($titlebnb, $junk) = split /\\/, $searchbnb;
$titlebnb =~ tr/a-z/A-Z/;
$Scratch->{'foo'} = $titlebnb;
if ($titlebnb eq "BLUECHIP") {
$Scratch->{'title'} = "Blue Chip Cards";
$Scratch->{'titleimage'} =
"http://__SERVER_NAME____IMAGE_DIR__/bluechiptitle.jpg";
}
elsif ($titlebnb eq "BLACKANDGOLD") {
$Scratch->{'title'} = "Black and Gold Sports Cards";
$Scratch->{'titleimage'} =
"http://__SERVER_NAME____IMAGE_DIR__/blackngoldtitle.jpg";
}
elsif ($title eq "BASEBALL") {
$Scratch->{'title'} = "Baseball Cards";
$Scratch->{'titleimage'} =
"http://__SERVER_NAME____IMAGE_DIR__/baseballtitle.jpg";
} [and so on]
Here is the fun thing!
You'll note that I set the scratch value of foo to $titlebnb which
shoudl correspond to mv_search_field
With the following url (which was generated with the href mentioned
above)
http://adsl-151-201-20-18.bellatlantic.net/cgi-bin/SteelCityCards/scan/sf=bluechip/se=%22baseball%22/va=category_name%3dBlue%20Chip%20Cards/tf=bluechip%2cyear/ml=5.html
[scratch foo] comes back with BEANIE, which was the *last*
mv_search_field submitted via a form action. BUT and this is the part
thats really getting to me... The searches come back with the right data
from the right category.
I think I'm losing my mind on this. Does anyone have any idea why this
is happening or what I am doing wrong?
-
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