Re: WebCatalog for guestbook ?
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 10302
interpreted = N
texte = >> Has anyone used it for GuestBooks ?>>>>The permissions would have to be set pretty carefully, but given the ease>>with which web-based additions can be made, it would seem to be a natural>>to use WebCatalog for guest books if it is already being used for other>>catalogs anyway.>>While we're at it how about adapting webcatalog to do online polls - it's>pretty easy to see how one could set it up to accept the data but how about>turning it around and computing the results?This is tremendously easy and it takes only two templates!Here's the basic concept:Start with template #1 - the 'append' template. This is where you let yourusers vote. When they make their choices and click the 'Submit' button,this form appends the data to the 'votes.db'. For simplicity, let's say yougive your voters a simple ballot with only two possible responses: Yes orNo.When the user makes his/her choice and clicks the Submit button,WebCatalog 2.0 appends a new record to the votes.db database file whichincludes the 'choice made by that voter - either 'Yes' or 'No'. Now here'sthe fun part ...In template #2 - the 'results' template - you put two different [search]contexts. Make the first [search] retrieve all the records with a 'yes'vote in the 'votes.db', and put a [numfound] inside this search contextlike this: Number of 'Yes' votes = [numfound]Now, do the same thing with the other [search] context, but make this oneretrieve all the records with a 'No' vote, and label this one: Number of'No' votes = [numfound]. That's all there is to it!This example is very basic, of course, because it shows how to do it withjust two choices. But you can expand this technique simply by addinganother [search] context for every new choice you give your voters.If you have five different choices on your 'append' template, you put fivedifferent searches on your 'results' template ... :)Sincerely,Ken
Associated Messages, from the most recent to the oldest:
>> Has anyone used it for GuestBooks ?>>>>The permissions would have to be set pretty carefully, but given the ease>>with which web-based additions can be made, it would seem to be a natural>>to use WebCatalog for guest books if it is already being used for other>>catalogs anyway.>>While we're at it how about adapting webcatalog to do online polls - it's>pretty easy to see how one could set it up to accept the data but how about>turning it around and computing the results?This is tremendously easy and it takes only two templates!Here's the basic concept:Start with template #1 - the 'append' template. This is where you let yourusers vote. When they make their choices and click the 'Submit' button,this form appends the data to the 'votes.db'. For simplicity, let's say yougive your voters a simple ballot with only two possible responses: Yes orNo.When the user makes his/her choice and clicks the Submit button,WebCatalog 2.0 appends a new record to the votes.db database file whichincludes the 'choice made by that voter - either 'Yes' or 'No'. Now here'sthe fun part ...In template #2 - the 'results' template - you put two different
[search]contexts. Make the first
[search] retrieve all the records with a 'yes'vote in the 'votes.db', and put a [numfound] inside this search contextlike this: Number of 'Yes' votes = [numfound]Now, do the same thing with the other
[search] context, but make this oneretrieve all the records with a 'No' vote, and label this one: Number of'No' votes = [numfound]. That's all there is to it!This example is very basic, of course, because it shows how to do it withjust two choices. But you can expand this technique simply by addinganother
[search] context for every new choice you give your voters.If you have five different choices on your 'append' template, you put fivedifferent searches on your 'results' template ... :)Sincerely,Ken
Kenneth Grome
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:
PCS Emailer's role ? (1997)
Location of Webcat site in folder hierarchy (1997)
suffix mapping for NT? (1997)
PCS Frames (1997)
cart info (1998)
WebCat2b13MacPlugIn - [include] doesn't allow creator (1997)
Round up prices (2000)
more info on [setlineitems] (1997)
[if][/if] weirdness (2000)
my price won't move (1997)
Browser Reloads and AddlineItem (1997)
Re:Searching for ALL / empty form field (1997)
Updating a database once per day - An example (1998)
WebCat2.0 [format thousands .0f] no go (1997)
Still trying to email... (1998)
adding up in a db (1997)
RE: Purchased cart being overwritten (1997)
Newbie questions (1999)
Quickie question on the email templates (1997)
Cart Database (1999)