[BETA] Spoiler BBcode MOD++

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
MaddoxX
Registered User
Posts: 450
Joined: Sat May 15, 2004 4:43 pm
Location: Russia

Post by MaddoxX » Fri Jan 13, 2006 6:14 pm

I have it installed a long time ago still works here on 2.0.19 ^^ works great and also added moveover mosue thingy so it shows text.. but i dont know where i can find the code again so i cant really help you :/
:D

Mephistox
Registered User
Posts: 96
Joined: Sat Oct 29, 2005 3:12 am
Location: NY
Contact:

Post by Mephistox » Thu Jan 19, 2006 10:42 pm

Can you change your mod so that it is like the IPB spoiler mod?

you do the [spoiler][/spoiler] tags, and anything inside is hidden.
To show the text, you must hit the button above it that says "Spoiler!" and then the text pops back into view.

In effect, it is actually hidden - so you can't accidentally highlight it or anything.

Also, anything can be hidden with the spoiler tags in IPB... images, test, code, etc.... do you think you could do that?

User avatar
beggers
Registered User
Posts: 1257
Joined: Fri Nov 23, 2001 8:19 pm
Location: Las Vegas
Contact:

Post by beggers » Sun Jan 22, 2006 6:54 am

Mephistox wrote: Can you change your mod so that it is like the IPB spoiler mod?

you do the [spoiler][/spoiler] tags, and anything inside is hidden.
To show the text, you must hit the button above it that says "Spoiler!" and then the text pops back into view.

In effect, it is actually hidden - so you can't accidentally highlight it or anything.

Also, anything can be hidden with the spoiler tags in IPB... images, test, code, etc.... do you think you could do that?


The mod you're talking about already exists. I believe it's known as the HIDE mod.

abumslife
Registered User
Posts: 192
Joined: Thu Apr 10, 2003 8:26 pm

Post by abumslife » Tue Mar 21, 2006 6:50 pm

beggers wrote:
Mephistox wrote:Can you change your mod so that it is like the IPB spoiler mod?

you do the [spoiler][/spoiler] tags, and anything inside is hidden.
To show the text, you must hit the button above it that says "Spoiler!" and then the text pops back into view.

In effect, it is actually hidden - so you can't accidentally highlight it or anything.

Also, anything can be hidden with the spoiler tags in IPB... images, test, code, etc.... do you think you could do that?


The mod you're talking about already exists. I believe it's known as the HIDE mod.


link?

User avatar
beggers
Registered User
Posts: 1257
Joined: Fri Nov 23, 2001 8:19 pm
Location: Las Vegas
Contact:

Post by beggers » Wed Mar 22, 2006 6:14 am

If I remember correctly now this mod started as a HIDE mod but there was already one by that name so the author renamed it SPOILER. You can check his web site for a new version.

Code: Select all

################################################################# 
## MOD Title: Expanding DIV Spoiler BBcode MOD
## MOD Author: EGIS < post@mj2k.com > (Mathias Jørgensen) http://www.mj2k.com 
## MOD Description: Adds a spoiler BBcode to your forum, which reveals the hidden 
##     code (images too) when a link is clicked. Great for hiding for example screenshots and 
##     big pictures so they don't screw up the page layout. 
##     Also adds a button for easier accessibility. Usage: [spoiler]Spoiler text here[/spoiler]
## 
## MOD Version: 1.0.0 
## 
## Installation Level: Easy 
## Installation Time: ~10 Minutes 
## Files To Edit: includes/bbcode.php, 
##                templates/subSilver/bbcode.tpl,
##		  language/lang_english/lang_main.php,
##                templates/subSilver/overall_header.tpl,
##		  posting.php,
##		  templates/subSilver/posting_body.tpl
## Included Files: (n/a) 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: 
## Tested in Opera 7.53, Internet Explorer 6.0 on phpBB v. 2.0.10
## Original button coded by cheesypeanut
## IMPORTANT: you MUST first have already installed the Multi BBCode MOD 
##    available at http://www.phpbb.com/mods/
## 
##############################################################
## MOD History: 
## 
##   2004-07-31 - Version 1.0.0
##      - Initial Release
##
##   YYYY-MM-DD - Version 1.1.0
##	- Added [spoiler=Your spoiler text here]
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################

#
# IMPORTANT: you MUST first have already installed the Multi BBCode MOD 
#    available at http://www.phpbb.com/mods/
#

# 
#-----[ OPEN ]------------------------------------------ 
# 
includes/bbcode.php 

#
#-----[ FIND ]------------------------------------------ 
#

define("BBCODE_TPL_READY", true);

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
	$bbcode_tpl['spoiler_open'] = str_replace('{L_SPOILER}', $lang['Spoiler'], $bbcode_tpl['spoiler_open']);
	$bbcode_tpl['spoiler_owntext_open'] = str_replace('{L_SPOILER}', '\\1', $bbcode_tpl['spoiler_owntext_open']);
# 
#-----[ FIND ]------------------------------------------ 
# 

	// colours
	$text = preg_replace("/\[color=(\#[0-9A-F]{6}|[a-z]+):$uid\]/si", $bbcode_tpl['color_open'], $text);
	$text = str_replace("[/color:$uid]", $bbcode_tpl['color_close'], $text);
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

// Begin 'Expanding DIV Spoiler MOD' 
// [spoiler] Spoiler code [/spoiler]
	$text = str_replace("[spoiler:$uid]", $bbcode_tpl['spoiler_open'], $text);
	$text = str_replace("[/spoiler:$uid]", $bbcode_tpl['spoiler_close'], $text);
	$text = preg_replace("/\[spoiler:$uid=(.*?[^ \"\n\r\t<])\]/si", $bbcode_tpl['spoiler_owntext_open'], $text);
// End 'Expanding DIV Spoiler MOD'

# 
#-----[ FIND ]------------------------------------------ 
# 
	// [color] and [/color] for setting text color
	$text = preg_replace("#\[color=(\#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]#si", "[color=\\1:$uid]\\2[/color:$uid]", $text);

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
	// [spoiler] and [/spoiler] for setting spoiler-text
	$text = bbencode_first_pass_pda($text, $uid, '[spoiler]', '[/spoiler]', '', false, '');
	$text = bbencode_first_pass_pda($text, $uid, '/\[spoiler=(.*?[^ \"\n\r\t<])\]/is', '[/spoiler]', '', false, '', "[spoiler:$uid=\\1]");
# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/bbcode.tpl 

# 
#-----[ FIND ]------------------------------------------ 
# 

<!-- BEGIN b_open --><span style="font-weight: bold"><!-- END b_open --> 
<!-- BEGIN b_close --></span><!-- END b_close --> 
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 

<!-- BEGIN spoiler_open --><script type="text/javascript">
randomId = 'spoiler' + Math.floor(Math.random() * 15000);document.write('<div onclick="openSpoiler(\'' + randomId + '\');return false;" style=\"font-weight: bold;cursor: pointer\">{L_SPOILER}</div><div id="' + randomId + '" style=\"display:none\">');</script><noscript><div></noscript><!-- END spoiler_open -->
<!-- BEGIN spoiler_close --></div><!-- END spoiler_close -->
<!-- BEGIN spoiler_owntext_open --><script type="text/javascript">
randomId = 'spoiler' + Math.floor(Math.random() * 15000);document.write('<div onclick="openSpoiler(\'' + randomId + '\');return false;" style=\"font-weight: bold;cursor: pointer\">{L_SPOILER}</div><div id="' + randomId + '" style=\"display:none\">');</script><noscript><div></noscript><!-- END spoiler_owntext_open -->

# 
#-----[ OPEN ]------------------------------------------ 
# You need to do this for all installed languages
#
language/lang_english/lang_main.php

# 
#-----[ FIND ]------------------------------------------ 
# Full line in English is: $lang['Code'] = 'Code'; // comes before bbcode code output.
#
$lang['Code'] =

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
$lang['Spoiler'] = 'Click to reveal spoiler';

# 
#-----[ FIND ]------------------------------------------ 
# Full line in English is: $lang['bbcode_f_help'] = 'Font size: [size=x-small]small text[/size]'; 
# 
$lang['bbcode_f_help'] = 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# You need to do this for all installed languages 
# 
$lang['bbcode_6_help'] = 'Spoiler: [spoiler]code[/spoiler] or [spoiler=text to be clicked]code[/spoiler] (alt+6)';

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/overall_header.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 
</head>

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
<script type="text/javascript">
<!--
function openSpoiler(id)
{
 var obj = ""; 

 if(document.getElementById)
  obj = document.getElementById(id).style;
 else if(document.all)
  obj = document.all[id];
 else if(document.layers)
  obj = document.layers[id];
 else
  return 1;
  
 if(obj.display == "")
  obj.display = "none";
 else if(obj.display != "none")
  obj.display = "none";
 else
  obj.display = "block";
}
//-->
</script>

# 
#-----[ OPEN ]------------------------------------------ 
# 
posting.php

# 
#-----[ FIND ]--------------------------------- 
# 
$EMBB_keys = array('' 
$EMBB_widths = array('' 
$EMBB_values = array('' 

# 
#-----[ IN-LINE FIND ]--------------------------------- 
# 
$EMBB_keys = array('' 

# 
#-----[ IN-LINE AFTER, ADD ]--------------------------------- 
# 
,'6' 

# 
#-----[ IN-LINE FIND ]--------------------------------- 
# 
$EMBB_widths = array('' 

# 
#-----[ IN-LINE AFTER, ADD ]--------------------------------- 
# 
,'55' 

# 
#-----[ IN-LINE FIND ]--------------------------------- 
# 
$EMBB_values = array('' 

# 
#-----[ IN-LINE AFTER, ADD ]--------------------------------- 
# 
,'Spoiler' 

# 
#-----[ FIND ]------------------------------------------ 
# 
   'L_EMPTY_MESSAGE' => $lang['Empty_message'], 

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
   'L_BBCODE_6_HELP' => $lang['bbcode_6_help'], 

# 
#-----[ OPEN ]------------------------------------------ 
# You need to do this for all of your installed template styles 
# 
templates/subSilver/posting_body.tpl 

# 
#-----[ FIND ]------------------------------------------ 
# 
f_help = "{L_BBCODE_F_HELP}"; 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
n6_help = "{L_BBCODE_6_HELP}"; 

# 
#-----[ FIND ]--------------------------------- 
# 
# NOTE: the actual line to find is MUCH longer, containing all the bbcode tags 
# 
bbtags = new Array( 

# 
#-----[ IN-LINE FIND ]--------------------------------- 
# 
'[url]','[/url]' 

# 
#-----[ IN-LINE AFTER, ADD ]--------------------------------- 
# 
,'[spoiler]','[/spoiler]' 


# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM

abumslife
Registered User
Posts: 192
Joined: Thu Apr 10, 2003 8:26 pm

Post by abumslife » Fri Mar 24, 2006 4:34 am

beggers wrote: If I remember correctly now this mod started as a HIDE mod but there was already one by that name so the author renamed it SPOILER. You can check his web site for a new version.


and that's the button one... not the text?

User avatar
beggers
Registered User
Posts: 1257
Joined: Fri Nov 23, 2001 8:19 pm
Location: Las Vegas
Contact:

Post by beggers » Fri Mar 24, 2006 5:57 am

That's what you asked me for.

abumslife
Registered User
Posts: 192
Joined: Thu Apr 10, 2003 8:26 pm

Post by abumslife » Mon Apr 03, 2006 11:05 pm

i don't have this in my posting.php:

Code: Select all

#

#
#-----[ FIND ]---------------------------------
#
$EMBB_keys = array(''
$EMBB_widths = array(''
$EMBB_values = array(''

#
#-----[ IN-LINE FIND ]---------------------------------
#
$EMBB_keys = array(''

#
#-----[ IN-LINE AFTER, ADD ]---------------------------------
#
,'6'

#
#-----[ IN-LINE FIND ]---------------------------------
#
$EMBB_widths = array(''

#
#-----[ IN-LINE AFTER, ADD ]---------------------------------
#
,'55'

#
#-----[ IN-LINE FIND ]---------------------------------
#
$EMBB_values = array(''

#
#-----[ IN-LINE AFTER, ADD ]---------------------------------
#
,'Spoiler'

User avatar
MHobbit
Former Team Member
Posts: 4761
Joined: Thu Mar 18, 2004 5:32 pm
Location: There and Back Again

Post by MHobbit » Mon Apr 03, 2006 11:07 pm

abumslife: You have to have the Multiple BBCodes MOD installed.
Former phpBB MOD Team member
No private support is offered.
"There’s too many things to get done, and I’m running out of days..."

abumslife
Registered User
Posts: 192
Joined: Thu Apr 10, 2003 8:26 pm

Post by abumslife » Mon Apr 03, 2006 11:23 pm

MennoniteHobbit wrote: abumslife: You have to have the Multiple BBCodes MOD installed.


i do mennonitehobbit... and i just checked the multiple bbcode file to see if it adds those lines to the posting.php file and it doesn't

abumslife
Registered User
Posts: 192
Joined: Thu Apr 10, 2003 8:26 pm

Post by abumslife » Wed Apr 05, 2006 6:34 am

any other suggestions?

abumslife
Registered User
Posts: 192
Joined: Thu Apr 10, 2003 8:26 pm

Post by abumslife » Sat Apr 08, 2006 3:24 am

anyone? thanks

Mephistox
Registered User
Posts: 96
Joined: Sat Oct 29, 2005 3:12 am
Location: NY
Contact:

Post by Mephistox » Sat Apr 29, 2006 4:18 am

http://oftheshrub.org/forums/phpbb2/vie ... php?t=5691

Can anyone tell me why the text isn't being displayed when i click the box?

Mephistox
Registered User
Posts: 96
Joined: Sat Oct 29, 2005 3:12 am
Location: NY
Contact:

Post by Mephistox » Sat Apr 29, 2006 3:37 pm

whoops. I posted in the wrong spoiler topic. Ignore that last post of mine - delete it if you want to mods.

mattr0x
Registered User
Posts: 155
Joined: Wed May 21, 2003 1:31 am
Contact:

Post by mattr0x » Sun May 21, 2006 12:49 pm

I installed this (along with the multi bbcode) but the Spoiler button still does not show up for me :cry:

Post Reply

Return to “[2.0.x] MODs in Development”