Its a random changing signature.
Here is how I do it.
I create a new PHP file, and I place a bunch of quotes in it, each quote is on a newline.
I then split it line-by-line, and randomly pick one of the lines.
I send the content type to be javascript, and print the result of the random quote.
- Code: Select all
<?php
$quotes = 'Lots of
quotes';
$split_array = explode("\n", $quotes);
$rand_keys = array_rand($split_array, 10);
header("Content-type: application/x-javascript");
echo "<!--\n";
echo 'var Quote = new Array()' . "\n";
foreach ($rand_keys as $i => $value)
{
echo 'Quote[' . $i . '] = \'' . $split_array[$rand_keys[$i]] . '\';' . "\n";
}
echo 'var Q = Quote.length;
var whichQuote = Math.round(Math.random() * (Q - 1));
function showQuote()
{
document.write(Quote[whichQuote]);
}
showQuote();' . "\n";
echo '-->';
?>
I save the file as a PHP file with the name:
7_signature.php, and place it anywhere in my webroot directory.
Then I created a new BBCode:
BBCode:
- Code: Select all
[signature]{NUMBER}[/signature]
HTML:
- Code: Select all
<script type="text/javascript" src="./path/to/scripts/{NUMBER}_signature.php"></script>
And then in my signature, I use:
- Code: Select all
[signature]7[/signature]
Thats it!!
And I get:
Now everytime you reload this page, you will get a new quote.