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 other2) 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 Solution11770 Bernardo Plaza Court | SiteEdit Pro, SiteCheck, PhotoMasterSan Diego, CA 92128 | SiteGuard619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com
Associated Messages, from the most recent to the oldest:
>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 other2) 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 Solution11770 Bernardo Plaza Court | SiteEdit Pro, SiteCheck, PhotoMasterSan Diego, CA 92128 | SiteGuard619/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:
Online reference (1997)
Location of Browser Info.txt file (1997)
Adding Items to Cart (2003)
Updating a database once per day - An example (1998)
F3 crashing server (1997)
Ken Grome (2006)
Counting LineItems (2000)
For those of you not on the WebCatalog Beta... (1997)
off topic - dna snipets (1997)
Re[2]: Monthly Reports (2000)
Show shoppingcart after remove last item (1997)
syntax question, not in online refernce (1997)
[table] and simultaneous users (2008)
[protect admin] (1997)
Include a big block of text (1997)
Emailer prefs in two places ... (1997)
WebCatalog f2 Installation (1997)
Re:Running 2 two WebCatalog.acgi's (1996)
Search returns all, not 20 (1997)
Math (1997)