[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] Dynamic Generation of Clickbars: Better Solution
****** message to minivend-users from Chris Rapier <rapier@psc.edu> ******
One chunk of embedded perl. Much cleaner.
Results can be accessed via [scratch subcat_clickbar]
Everything else should be obvious.
Again, if anyone has any improvements or suggestions just let me know.
[perl catopts]
$Scratch->{'subcat_clickbar'} = "";
my $ref = $Db{'catopts'};
my $rowname= $Values->{'mv_searchspec'}[0];
if ($ref->record_exists($rowname)) {
my @subcats = split /,/, $ref->field($rowname, "subcats");
foreach (@subcats) {
$Scratch->{'subcat_clickbar'} .= "<a
href=\"$Config->{'VendURL'}/scan/sf=category,subcat,category2,subcat2/se=$rowname/se=$_/os=no/ml=5.html/tf=description,brand\"><img
border=0 src =\"/windfallfoods/images/$_.gif\"></a>";
}
$Scratch->{'category_title'} = $ref->field($rowname, "title");
$Scratch->{'titleimage'} = $ref->field($rowname, "title_image");
} else {
$Scratch->{'category_title'} = "Your Search";
$Scratch->{'titleimage'} = "yrsearchtitle.jpg";
}
return "";
[/perl]
-
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