[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] Randomly pick a product
What I wound up doing is including a field 'days' in products.asc which I
populated with the days (as in 'day of the month') that the particular item
should be featured on the home page. Then, on the home page, an in-page
search looks in that field for the day, returned from a brief Perl script
held in [calc] tags, as follows:
[loop search="
se=[calc]@timelist = localtime;$mday = $timelist[3];return $mday;[/calc]
su=yes
sf=days
ml=1
"]
[loop-description]
All loop-code goes here.
[page href="[loop-code]" send=1]More Information[/page]
[/loop]
For what it's worth,
Rob Maurer :o)
In a message dated 10/23/99 11:12:12 AM Eastern Daylight Time, cfm@maine.com
writes:
> ****** message to minivend-users from "Mr. Christopher F. Miller" <cfm@
> maine.com> ******
>
>
> In some cases we do it on a per page request basis but generally
> use cached files instead.
>
> So you could do:
>
> [file name=adfadf] # I forget, is it [file or [include? See manual
>
> and generate the contents of "adfadf" by another process perhaps on
> cron or triggered otherwise.
>
> On Windows you might rebuild "adfadf" at reboot. ;^>
>
> cfm
>
>
> On Sat, Oct 23, 1999 at 08:34:27AM -0400, Handytman@aol.com wrote:
> > ****** message to minivend-users from Handytman@aol.com ******
> >
> > I need to pick a product, at random, from an ever-changing
'products.asc,'
>
> > for display on the initial catalog page. Therefore, using the random
tags
> > seems inappropriate. Counting through all the items in 'products.asc'
> seems
> > too time-consuming for the server. Has anybody accomplished this? Care
to
> > pass on some perls of wisdom?
> >
> > Much appreciated,
> > Rob Maurer