vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Spoiler Tag (https://vborg.vbsupport.ru/showthread.php?t=113776)

King Kovifor 07-19-2007 08:52 PM

Quote:

Originally Posted by SirAdrian (Post 1295983)
The unique identifier should be generated by PHP (hash, microtime, etc).

Then you could do [spoiler]HE DIES IN THE END![/spoiler] or if you want ... [spoiler=WARNING]HE DIES IN THE END[/spoiler] which would replace the default caption.

Just an idea to simplify the use. :)

How could I do that within the BBCode Manager?

daboogas94e 08-07-2007 09:29 PM

i can't seem to get the spoiler tags working at all

King Kovifor 08-10-2007 11:46 PM

Quote:

Originally Posted by daboogas94e (Post 1312221)
i can't seem to get the spoiler tags working at all

What do you have in the BBCode Manager?

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:

Code:

spoiler_{option}
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!

TheoMessinis 02-02-2008 12:28 PM

Thank you! Great spoiler! :D

mikkitine 03-28-2008 12:39 PM

Quote:

Originally Posted by Disasterpiece (Post 1295996)
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 :D

Quote:

Originally Posted by smokey (Post 1389405)
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:

Code:

spoiler_{option}
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.

scottevtv 05-16-2009 03:52 PM

The tag begins as "Spoiler about...", and then if the user clicks and cicks again the "Spoiler about" text is gone. This was a bit confusing.


All times are GMT. The time now is 09:47 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01137 seconds
  • Memory Usage 1,747KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete