Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2013-07-25 14:37:44

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,196
Website

[MOD] Spoiler 1.1.0

http://fluxbb.org/resources/mods/spoiler/

Adds bb-code [spoiler].
Test topic -

77f342b4ec4d724d3a6533dc97555ecc.jpg

Last edited by Visman (2016-07-22 08:08:14)

Offline

#2 2013-08-18 10:11:16

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,196
Website

Re: [MOD] Spoiler 1.1.0

v 1.0.1
For FluxBB 1.5.4.
If version 1.0.0 is installed, updating isn't required!

Last edited by Visman (2013-08-18 16:00:14)

Offline

#3 2014-01-06 18:23:14

nono18120
Member
Registered: 2012-07-20
Posts: 52

Re: [MOD] Spoiler 1.1.0

hello ,


But I does not understand(include) there too much.
I shall like a beacon(tag) where he(it) has to mark "to Show" there then when we rest(support) "to Hide" who(which) does not make all the size of the div but the just man the size of the text, a button which big_smile and the color of the spoiler of the same that the good button on coach the it is black and white blink.
Thank you in advance


if (strpos($text, '[spoiler') !== false)
	{
		$text = str_replace('[spoiler]', "</p><div class=\"quotebox\" style=\"padding: 0px;\"><div onclick=\"var e,d,c=this.parentNode,a=c.getElementsByTagName('div')[1],b=this.getElementsByTagName('span')[0];if(a.style.display!=''){while(c.parentNode&&(!d||!e||d==e)){e=d;d=(window.getComputedStyle?getComputedStyle(c, null):c.currentStyle)['backgroundColor'];if(d=='transparent'||d=='rgba(0, 0, 0, 0)')d=e;c=c.parentNode;}a.style.display='';a.style.backgroundColor=d;b.innerHTML='&#9650;';}else{a.style.display='none';b.innerHTML='&#9660;';}\" style=\"font-weight: bold; cursor: pointer; font-size: 0.9em;\"><span style=\"padding: 0 5px;\">&#9660;</span>".$lang_common['Hidden text']."</div><div style=\"padding: 6px; margin: 0; display: none;\"><p>", $text);
		$text = preg_replace('#\[spoiler=(.*?)\]#s', '</p><div class="quotebox" style="padding: 0px;"><div onclick="var e,d,c=this.parentNode,a=c.getElementsByTagName(\'div\')[1],b=this.getElementsByTagName(\'span\')[0];if(a.style.display!=\'\'){while(c.parentNode&&(!d||!e||d==e)){e=d;d=(window.getComputedStyle?getComputedStyle(c, null):c.currentStyle)[\'backgroundColor\'];if(d==\'transparent\'||d==\'rgba(0, 0, 0, 0)\')d=e;c=c.parentNode;}a.style.display=\'\';a.style.backgroundColor=d;b.innerHTML=\'&#9650;\';}else{a.style.display=\'none\';b.innerHTML=\'&#9660;\';}" style="font-weight: bold; cursor: pointer; font-size: 0.9em;"><span style="padding: 0 5px;">&#9660;</span>$1</div><div style="padding: 6px; margin: 0; display: none;"><p>', $text);
		$text = str_replace('[/spoiler]', '</p></div></div><p>', $text);
	}

Offline

#4 2014-12-18 16:19:06

chris98
Member
From: England, United Kingdom
Registered: 2013-05-31
Posts: 1,292
Website

Re: [MOD] Spoiler 1.1.0

Hi Visman,

This mod seems to be using preg_replace rather than preg_replace_callback. Should it be using preg_replace_callback just as it was changed for the rest of FluxBB?

Last edited by chris98 (2014-12-18 16:19:39)

Offline

#5 2014-12-18 16:48:48

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,196
Website

Re: [MOD] Spoiler 1.1.0

Everything is working properly.

Offline

#6 2014-12-18 17:12:32

Otomatic
FluxBB Donor
From: Paris - France
Registered: 2010-01-26
Posts: 566
Website

Re: [MOD] Spoiler 1.1.0

chris98 wrote:

This mod seems to be using preg_replace rather than preg_replace_callback. Should it be using preg_replace_callback just as it was changed for the rest of FluxBB?

You must use preg_replace_callback only if preg_replace use the modifier "e".

PHP Documentation wrote:

5.5.0     The /e modifier is deprecated. Use preg_replace_callback() instead. See the PREG_REPLACE_EVAL documentation for additional information about security risks.


Ce n'est pas parce que l'erreur se propage qu'elle devient vérité. Ghandi
An error does not become truth by reason of multiplied propagation. Ghandi

Offline

#7 2015-01-25 08:14:50

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,196
Website

Re: [MOD] Spoiler 1.1.0

Works in FluxBB 1.5.8.

Offline

#8 2016-07-21 19:06:11

Gamer
Member
Registered: 2013-10-09
Posts: 72
Website

Re: [MOD] Spoiler 1.1.0

works on the last version?

Offline

#9 2016-07-22 08:07:56

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,196
Website

Re: [MOD] Spoiler 1.1.0

v 1.1.0
The regular expression has more strict idea.
---

[spoiler='Куку 	' [ddd] ' !']
Привет!
Миру Мир!
[/spoiler]

2bb58fdcd48916c530b9a9eab69bc894.png

Last edited by Visman (2016-07-22 08:27:30)

Offline

#10 2016-07-22 15:24:11

grognard
Member
From: UK
Registered: 2014-09-18
Posts: 66
Website

Re: [MOD] Spoiler 1.1.0

Thank you Visman for updating this mod. smile

Offline

Board footer

Powered by FluxBB