Re: another problem

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 12882
interpreted = N
texte = >I'm including RandomAd in my pages. I have a data of 78 ads and the >problem is that when I want to put more then one ad in page, it would >sometimes pick the two same ads. This is a situation I want to avoid, I >mean, is it possible to say that I want the ads to be random, but different, >when placed in the same pageGood question. Random means truly random, in the sense that it is possible to pick the same one several times. There are a couple of solutions:1) Make 2 databases, with some of the ads in one, and different ones in the other 2) A very tricky technique that encloses your entire page inside a random search with max=2[math]whichItem=1[/math] [search db=RandomAds.db&SEARCHCRITERIA&max=2] [founditems] [showif [math]whichItem[/math]=[index]] [adBody] [/showif] [/founditems] [math]whichItem=2[/math]... the entire contents of your HTML page here ...[founditems] [showif [math]whichItem[/math]=[index]] [adBody] [/showif] [/founditems] [/search]This guarantees uniqueness because the search finds 2 items, and then displays the 1st one at the top of the page, and the 2nd one at the bottom.Grant Hulbert, V.P. Engineering | ===== Tools for WebWarriors ===== Pacific Coast Software | WebCatalog Pro, WebCommerce Solution 11770 Bernardo Plaza Court | SiteEdit Pro, SiteCheck, PhotoMaster San Diego, CA 92128 | SiteGuard 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com Associated Messages, from the most recent to the oldest:

    
  1. Another problem with CyberCash and WebMerchant (Steven Jarvis 2000)
  2. Re: another problem (Grant Hulbert 1997)
  3. Re: another problem (natasha 1997)
>I'm including RandomAd in my pages. I have a data of 78 ads and the >problem is that when I want to put more then one ad in page, it would >sometimes pick the two same ads. This is a situation I want to avoid, I >mean, is it possible to say that I want the ads to be random, but different, >when placed in the same pageGood question. Random means truly random, in the sense that it is possible to pick the same one several times. There are a couple of solutions:1) Make 2 databases, with some of the ads in one, and different ones in the other 2) A very tricky technique that encloses your entire page inside a random search with max=2[math]whichItem=1[/math] [search db=RandomAds.db&SEARCHCRITERIA&max=2] [founditems] [showif [math]whichItem[/math]=[index]] [adBody] [/showif] [/founditems] [math]whichItem=2[/math]... the entire contents of your HTML page here ...[founditems] [showif [math]whichItem[/math]=[index]] [adBody] [/showif] [/founditems] [/search]This guarantees uniqueness because the search finds 2 items, and then displays the 1st one at the top of the page, and the 2nd one at the bottom.Grant Hulbert, V.P. Engineering | ===== Tools for WebWarriors ===== Pacific Coast Software | WebCatalog Pro, WebCommerce Solution 11770 Bernardo Plaza Court | SiteEdit Pro, SiteCheck, PhotoMaster San Diego, CA 92128 | SiteGuard 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com Grant Hulbert

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Webcat causing crashes left and right! (1997) 2 easy questions re: [showif] and [sendmail] (1997) ANother SHOWIF problem (1997) WebCat2b12 - nesting [tags] (1997) time and welcome (1999) webcat 2.1 new cart fields - please explain more (1998) Sorting error (1997) Size limit for tmpl editor ? (1997) This message couldn't reach the list! (multi-column (1998) [ShowNext] feature in 2.0 (1997) PIXO support (1997) using listfiles to build a database? more (2000) [OT] Who's got a cool link (2002) Running 2 two WebCatalog.acgi's (1996) Interfacing WebMerchant to www.fedex.com (1997) 2 easy questions re: [showif] and [sendmail] (1997) background (2001) Calendar (1997) PCS Emailer's role ? (1997) input type=file has no value? (2003)