[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] help with multiple defined [random] banners?
At 10:39 PM 10/14/1999 , you wrote:
>****** message to minivend-users from mikeh@minivend.com ******
>
>Quoting Ryan Hertz (rhertz@gyb.baits.com):
>>> from Victor Nolton <ven@pragakhan.com>
>> >>How would each file of the random list do this? Would it call its own
>> >>[random] tag? If so, how would it be diferent from the others? I thought
>> >>random couldn't be restricted to specified banners from a list either.
>>
>> [if [item-category] eq "business"]
>> <IMG SRC="businessbanner.gif">
>> [/if]
>> [if [item-category] eq "lordsofacid"]
>> <IMG SRC="loa2.gif">
>> [/if]
>> [if [item-category] eq "pragakhan"]
>> <IMG SRC="pragakhan.gif">
>> [/if]
>>
>
>This will definitely not work, as it is not proper syntax for
>the [if ...] tag.
I was just illustrating my idea - not proving my MV prowess. :-)
>Is the only thing to go above 16? Whoosh, you are relieved of
>that limitation. I did it quite a long time ago and forgot to change
>the docs.
I'm healed! Is that v3.14 and above?
>
>I did a banner tag quite a while ago which does things based
>on a database and a category.
>
>UserTag banner Order place
>UserTag banner AddAttr
>UserTag banner Routine <<EOF
>sub {
> my ($place, $opt) = @_;
> my $totrot;
> my $db = $opt->{table} || 'banner';
> my $ad_field = $opt->{ad_field} || 'notes_field';
> my $rot_field = $opt->{rotate_field} || 'rotate';
> do {
> $totrot = Vend::Interpolate::tag_data($db, $rot_field, $place);
> if(! $totrot) {
> # Do nothing, not an active ad
> }
> elsif ($totrot) {
> my $current = $Vend::Session->{scratch}->{"rotate_$place"}++
|| 0;
> my $data = Vend::Interpolate::tag_data($db, $ad_field, $place);
> my(@ads) = split /\n\n/, $data;
> return '' unless @ads;
> return $ads[$current % scalar(@ads)];
> }
> else {
> return Vend::Data::database_field($db, $place, $ad_field);
> }
> } while $place =~ s/(.*):.*/$1/;
>}
>EOF
>
>Basically, it allows you to set up a "banner" database that can
>either rotate or place single ads. The default would work with
>a catalog.cfg entry of:
>
>Database banner banner.asc LINE
>Database banner CONTINUE NOTES
>
>And data in banner.asc of:
>
>--- begin banner.asc
>code
>ad
>
>code: Surrealists
>rotate: 1
>
>Freak out with Keiko!
>
>Dali is peachy!
>~
>code: Renaissance
>rotate: 0
>
>Leonardo is the man.
>~
>code: Americana
>
>This will never be displayed.
>~
>--- end banner.asc
>
>In the above example (which per my normal policy I will not go interactive
on)
>
> Surrealists: [banner [item-field category]] would rotate between two
messages
> since rotate field is set to non-zero.
> Renaissance: [banner [item-field category]] would always be the same
message,
> since rotate field is set to zero.
> Americana: [banner [item-field category]] would never be displayed,
> since rotate field is blank.
>
>If I were to do it today, I would probably return a pointer to a database
>structure so I could keep ads in a second database based on campaign. Even
>now, it wouldn't be too difficult.
>
>Above:
>< my(@ads) = split /\n\n/, $data;
>< return '' unless @ads;
>< return $ads[$current % scalar(@ads)];
>New:
>> my(@ads) = Text::ParseWords::shellwords($data);
>> return '' unless @ads;
>> return $ads[$current % scalar(@ads)];
>
>Now [data table=ads field=ad_html key="[banner Surrealists]"]
>would work if you had a space-separated list of keys to the
>ads.
>
>--
>Mike Heins http://www.minivend.com/ ___
> Internet Robotics |_ _|____
>Fast, reliable, cheap. 131 Willow Lane, Floor 2 | || _ \
>Pick two and we'll talk. Oxford, OH 45056 | || |_) |
> -- unknown <mikeh@minivend.com> |___| _ <
> 513.523.7621 FAX 7501 |_| \_\
>-
>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
>
Ryan Hertz tel 800-645-BAIT
Webmaster fax 520-645-2588
Advertising Director http://www.insideline.net
Gary Yamamoto Custom Baits, Inc. http://www.yamamoto.baits.com