1 (edited by Pascal Gibert 01-06-2013 10:21:39)

Topic: Smartness to show a block of unpredictable quotes

How to add an unpredictable block of quote simply in your sidebar or elsewhere :

We need a quotes.txt file called and to call upon a function php.

To do it quotes we are going to insert a quotes line by line, we can put the number which they want.

Example file quotes :

If the United States of America or Britain is having elections, they don't ask for observers from Africa or from Asia. But when we have elections, they want observers. Nelson Mandela. Etc...

The function PHP to be inserted in default.bit :

<?php
       $f_contents = file ("http:/yourwebsite.com/quotes.txt");
       $line = $f_contents[array_rand ($f_contents)];
       print $line;
?>

When a visitor will make F5 or change page or article every time it will be a different quote.

Enjoy! smile

Re: Smartness to show a block of unpredictable quotes

Simple. I like it that way.