Quote:
Originally Posted by Disasterpiece
Yeah, im kind of a noob in php, i can only html ^^
so, this is my modified code:
Code:
<div class="fieldset">
<table cellpadding="5" cellspacing="0" border="0" align="center">
<tr>
<td colspan="3" align="center"><a href="#top" onclick="return toggle_collapse('spoiler_{option}')"><input type="button" value="{option}" /></a></td>
</tr>
<tbody id="collapseobj_spoiler_{option}" style="display:none;">
<td align="$stylevar[left]" valign="top">{param}</td>
</tbody>
</table>
</div>
i used the option param for the button's value AND the spoiler id. works in 80%; when users use different values for the buttons, but i wanted to use it in the signature. So there would be many buttons with the same id.
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 
|
Quote:
Originally Posted by smokey
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!
|
I combined both of your suggestions and the result was still unchanged. Spoiler tags with the same option only open the first spoiler. In fact, spoiler tags with a different option still only open the first spoiler.