Page 1 of 1

Random Signature Text BBCode

Posted: 09 Mar 2010, 06:41
by BBCode Bot
Random Signature Text BBCode

Author: Highway of Life
Description: The Random Signature Text BBCode lets you use a random signature. It changes from post to post or when you reload the page.
Image

Create a new PHP file, and I place a bunch of quotes in it, each quote is on a newline.
You need to change Signature 1, Signature 2 and so on to what ever you like. You can have as many lines as you like.

Code: Select all

<?php
    $quotes = 'Signature 1
    Signature 2
	Signature 3
	Signature 4
	Signature 5';
    $split_array = explode("\n", $quotes);
    $rand_keys = array_rand($split_array, 1);

    header("content-type: application/x-javascript");
    echo "<!--\n
    document.write('{$split_array[$rand_keys]}');\n
    //-->";  
?>
Save the php file as 1_signature.php and upload it to your forum root.
You offer this to your members. Then you will have to create a signature.php for each member. Cal them 2_signature.php, 3_ signature.php etc.

BBCode:

Code: Select all

[signature]{NUMBER}[/signature]
HTML:

Code: Select all

<script type="text/javascript" src="./path/to/scripts/{NUMBER}_signature.php"></script>
Helpline:

Code: Select all

Signature: [signature]Number[/signature]
Example:

Code: Select all

[signature]1[/signature]
Demo:
[signature]1[/signature]

Re: Random Signature Text BBCode

Posted: 04 Jul 2010, 17:25
by MasterZ