Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
How-to: Display Random Forms ?
Hi,
I know you can use random articles, but is it possible to somehow output a random form?
The scenario is I want to place advertisements in forms (ad_1, ad_2, etc.) and have them displayed on the individual article page between the end of the article and the before the comments.
How could I best accomplish this?
Thanks!
Sam Brown
sambrown.me | welovetxp.com
Offline
Re: How-to: Display Random Forms ?
Perhaps something like this (not tested):
<txp:php>
$forms = array('form1', 'form2', 'form3');
echo output_form(array('form' => $forms[rand(0, count($forms)-1)]));
</txp:php>
Offline
Re: How-to: Display Random Forms ?
Interesting.. that worked perfectly!
Thanks ruud!
Sam Brown
sambrown.me | welovetxp.com
Offline
Pages: 1