[ic] feasibility of random components

Paul Jordan interchange-users@interchange.redhat.com
Wed Apr 24 12:31:01 2002


> I need some input on this idea, to see if it would even be feasible, and
> perhaps more importantly, (somewhat) simple to do.  Maybe someone has
> done this or has another solution.
>
> Im thinking about having components on some pages be random.  -- One
> time you visit this page, it might show specials, the next time you
> visit it might show "tips" or "testimonials" components or whatever
> else.  Here's my idea on maybe how to do it:
>
> = put the "random" component in each page you want this done in.



Hi, Ed Lafrance just helped me out with something similar. We made a table
called list.txt, and in that, made a table of "includes" like:

include
file1.txt
file2.txt
file3.txt

Then in a page you can:

[loop
          random=1
          search="
                  fi=list
                  st=db
                  ra=yes
                  ml=1000
          "
]
here is the randon result:<br>
[include file="path/to/random_file/dir/[loop-code]"]
[/loop]

In that directory, just put file1.txt, file2.txt....... These txt files
would include the html that you want to "include". I suppose that this html
could have a component, like specials.

...I suppose.


Paul