BBCode DatabaseRandom text signature

BBCode's
Previous topicNext topic
User avatar

Topic Author
all4phone
Donator
Donator
Status: Offline
User theme: Dark
Posts: 75
Joined: May 29th, '16, 11:33
    Windows 7 Firefox

Random text signature

Post by all4phone »

BBCode usage:

Code: Select all

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

Code: Select all

<script type="text/javascript" src="http://your_board_address/sign/{NUMBER}_signature.php"></script>
Help line:

Code: Select all

Signature: [signature]Number[/signature]
Additionally:
1. Create a new PHP file named eg. 1_signature.php
Then put inside a few texts or links, each on a new line.

Code: Select all

<?php
	$quotes = '(first_random_text) <a href="http://phpbbmods.cba.pl">phpbbmods.cba.pl</a>
		(second_random_text) <a href="http://dmzx-web.net">dmzx-web.net</a>
		(third_random_text) <a href="https://phpbb.com">phpbb.com</a>';
	$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
		//-->";
?>
2. Place the PHP file in root/sign/ directory.
3. Edit your signature
sign.png

------------------------------------------------------------------------------------------------------------------

You can create more signatures (more PHP files) for other users. Give them just another number, for example: 2_signature.php 3_signature.php etc.
Then, users should go to UCP and edit your own signature by typing: [signature]2[/signature] or [signature]3[/signature]
You do not have the required permissions to view the files attached to this post! Maybe your post count is too low.
User avatar

dmzx
Founder
Founder
Status: Offline
User theme: Dark
Posts: 6365
Joined: Jan 13th, '14, 20:45
    Windows 10 Firefox

Re: Random text signature

Post by dmzx »

Will check on this :thumbup:
User avatar

Sniper_E
VIP
VIP
Status: Offline
User theme: Dark
Posts: 1151
Joined: Oct 14th, '14, 17:01
    Android Chrome

Re: Random text signature

Post by Sniper_E »

Have you thought about using the member's user ID for the #_signature.php file?
Example: 2011_signature.php would be for all4phone.

But how would these sig php files get into that root/signs/ directory? The user can not upload and edit their sig file.

[ Post made via Samsung Galaxy S5 Active ] Image
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!™
User avatar

Topic Author
all4phone
Donator
Donator
Status: Offline
User theme: Dark
Posts: 75
Joined: May 29th, '16, 11:33
    Windows 7 Firefox

Re: Random text signature

Post by all4phone »

See on my website, the first line of my signature is random :thumbup:
User avatar

Topic Author
all4phone
Donator
Donator
Status: Offline
User theme: Dark
Posts: 75
Joined: May 29th, '16, 11:33
    Windows 7 Firefox

Re: Random text signature

Post by all4phone »

Sniper_E wrote: Jun 5th, '16, 22:07 Have you thought about using the member's user ID for the #_signature.php file?
Example: 2011_signature.php would be for all4phone.

But how would these sig php files get into that root/signs/ directory? The user can not upload and edit their sig file.

[ Post made via Samsung Galaxy S5 Active ] Image
You're right it's not impossible.
But you can prepare signatures only for the chosen few.
Previous topicNext topic