smokey |
11-25-2007 11:44 PM |
Quote:
Originally Posted by Disasterpiece
(Post 1295996)
is it possible to use php code in the code field? when yes, could you give me the php code for creating a random number? would be great :D
|
Here's a quick fix.
Create a plugin, for the hook location choose postbit_display_complete and paste the following php code in the box:
PHP Code:
$this->post['message'] = preg_replace('/\{rand_string\}/i',rand(0,32768),$this->post['message']);
The above code will change {rand_string} in a post to a random number (making it unique).
In the spoiler bbcode you created, find both:
Replace both with:
Code:
spoiler_{rand_string}
Also I replaced "Spoiler!" in the header to "Spoiler for {option}". Just a suggestion to all.
Thanks for the bbcode btw, it was a great idea!
|