[BBCode] Random text signature

Mods, snippets and styles postet and supported by the users
Forum rules
As the forum title says this is for User Contributions
Post a support request in this forum and you will be banned!
Locked
User avatar
all4phone
BBCoder IV
BBCoder IV
Posts: 150
Joined: 11 Feb 2011, 13:50
BBCodes: 28
Favourite BBCode: Random text signature
Favourite MOD: BBCode Strikethrough MOD
Location: Poland
Contact:

[BBCode] Random text signature

Post by all4phone »

Title: Random text signature
Description: Adds a random text signature. BBCode Random text signature allows you to use randomly changing the signature. Is changed from post to post or reload the page.
Author: I'm sorry but I do not remember where I found it and who is the author of this script, I just adapted and I use on my board (forum).

Create a new PHP file and put the a few citations, each in a new line.
Instead of Signature 1 Signature 2 and so on, insert your own text. You can have as many lines as you like.
[spoiler]Here is a sample code file:

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);
                 $order   = array("\r\n", "\n", "\r");
                 $replace = '<br />';
                 $los = str_replace($order, $replace, $split_array[$rand_keys]);
                    header("content-type: application/x-javascript");
                    echo "<!--\n
                    document.write('$los');\n
                    //-->";
                ?>
Save the file as 1_signature.php php and send it to the root of your board (forum). This signature can be offered to a few users. Therefore, you must create a file signature.php for each of them and call them 2_signature.php, 3_ signature.php etc.

bbcode usage:

Code: Select all

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

Code: Select all

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

Code: Select all

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

Code: Select all

[signature]5[/signature]
[/spoiler]
Demo: See my signature on my test board (forum).
master412160
BBCoder II
BBCoder II
Posts: 39
Joined: 04 Jun 2011, 14:17

[BBCode] Random text signature

Post by master412160 »

can you use bold, bbcodes for this in the .php file?

could someone give a better example with this, like use
[quote]
$quotes = 'Signature 1
Signature 2
Signature 3
Signature 4
Signature 5';
[/code]
Hello please check out my Interview Site, Interviewed You
User avatar
all4phone
BBCoder IV
BBCoder IV
Posts: 150
Joined: 11 Feb 2011, 13:50
BBCodes: 28
Favourite BBCode: Random text signature
Favourite MOD: BBCode Strikethrough MOD
Location: Poland
Contact:

[BBCode] Random text signature

Post by all4phone »

master412160 wrote:can you use bold, bbcodes for this in the .php file?
Easily you can use bbcode's directly in your signature, eg
{color=#4080bF]{b]{signature]1{/signature]{/b]{/color] (I intentionally changed the parentheses)

master412160 wrote:could someone give a better example with this, like use
Read the hidden information inside the spoiler please.
Locked