Eliot was kind enough to offer the following code for displaying a graphic depending on a search result (i.e. choose Rating 1 from a drop down,and get a .gif of one star, rating=>2 get two stars etc. in the search result)
I creating a rating field in default.cfg
Rating=> [10,'numer',1,1,1', "],
and formatted it as drop-down
%db_select_fields= ( Rating=>'1,2,3,4');
Now, I'm not sure WHERE the following code should GO in default.cfg (?) right after the definitions? (Radio fields, checkbox) just before authorization options? does it matter?
$rate_img1='img src="http://www.myserver.com/image1.gif" alt="1"'
$rate_img2='im src="http://www.myserver.com/image2.gif' alt="1"'
etc.
and also, WHERE in sub html_record routing do these go? Just where the Rating will print?
if($rec{'Rating'} ="1") {
print qql<$rate_img1>|;
etc.
wherever the Rating field <TD> is now?
Thanks, I couldn't get it to work without errors.
Lenny
I creating a rating field in default.cfg
Rating=> [10,'numer',1,1,1', "],
and formatted it as drop-down
%db_select_fields= ( Rating=>'1,2,3,4');
Now, I'm not sure WHERE the following code should GO in default.cfg (?) right after the definitions? (Radio fields, checkbox) just before authorization options? does it matter?
$rate_img1='img src="http://www.myserver.com/image1.gif" alt="1"'
$rate_img2='im src="http://www.myserver.com/image2.gif' alt="1"'
etc.
and also, WHERE in sub html_record routing do these go? Just where the Rating will print?
if($rec{'Rating'} ="1") {
print qql<$rate_img1>|;
etc.
wherever the Rating field <TD> is now?
Thanks, I couldn't get it to work without errors.
Lenny