Dear FireBoard users,
In order to further develope the need of Joomla for a robust forum, FireBoard component has been moved to its own new home and new name. You can find more information regarding the Kunena, the successor of FireBoard, at kunena.com. The current forum here will stay for some time more for referencing needs. You can find the FireBoard files under joomlacode.org and other files
Upgrading to Kunena is highly recommended!

Kunena! - To Speak!

A revolution is coming... Kunena - Swahili for: To Speak! THE Next generation of native Joomla based Forum ultra component. Forget what you know about Joomla based forums...
Amazingly Simple Lean and Clean Easier Customization
Kunena is about to redefine the world of Joomla! with the most simplistic ultra component out there. For ultimate performance based on state of the art development techniques, Kunena! is about to bring you... With an integrated plugin system that will allow you to extend Kunena beyond your wildest imaginations...
TOPIC: Spoiler Features
#5353
Spoiler Features 10 Years, 6 Months ago  
I run several television show fan site and a feature that is important to me is being able to restrict content deemed \"Spoilerish\".

I would like a way to:

- Omit certain forum categories/boards from the Recent Post module
- Omit certain forum categories/boards from the Search
- Create a \"Spoiler\" tag to black-out stuff people want to post in general forums.

Thank you.
#5353
Spoiler Features 10 Years, 6 Months ago  
I run several television show fan site and a feature that is important to me is being able to restrict content deemed \"Spoilerish\".

I would like a way to:

- Omit certain forum categories/boards from the Recent Post module
- Omit certain forum categories/boards from the Search
- Create a \"Spoiler\" tag to black-out stuff people want to post in general forums.

Thank you.
#5369
Re:Spoiler Features 10 Years, 6 Months ago  
Well, here\'s a spoiler tag for you.

Open smile.class.php in your templates folder.

Find:
[code:1]
// italic

$fb_message_txt = preg_replace(\"/(\\[i\\])(.*?)(\\[\\/i\\])/si\",\"<em>\\\\2</em>\",$fb_message_txt);
[/code:1]

Insert after:
[code:1]
//Spoiler Tag. Make sure to adjust stylesheet to include div.spoiler-header, div.spoiler-block, div.spoiler-body.
$fb_message_txt = preg_replace(\"/\\[spoiler\\](.*?)\\[\\/spoiler\\]/si\",\"<div class=\\\"spoiler-block\\\"><div class=\\\"spoiler-header\\\">Warning, Spoiler: <input type=\\\"button\\\" class=\\\"form-button\\\" value=\\\"Show\\\" onclick=\\\"if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'\') { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'\';this.innerText = \'\'; this.value = \'Hide\'; } else { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\'; this.innerText = \'\'; this.value = \'Show\'; }\\\" /></div><div class=\\\"spoiler-body\\\"><div style=\\\"display: none;\\\">\\\\1</div></div></div>\",$fb_message_txt);

[/code:1]

If line breaks appear after copying into your editor, be sure to remove them or the code will not function.

To your stylesheet add the following. I just threw the css together quickly so you\'ll probably need to adjust it to better suit your needs.

[code:1]
div.spoiler-block {
width: 451px;
height: 50px;
border:hidden;
}

div.spoiler-header {
font: Arial, Helvetica, sans-serif;
font-size: 9px;
color:#0066FF;
}

div.spoiler-body {
height: 40px;
width: 450px;
}
[/code:1]

EDIT: It seems the div classes arent being outputted. All the divs have no class assigned to them. You might be better off adding style attributes to each div individually.

Post edited by: Goanna, at: 2007/05/07 06:07
#5371
Re:Spoiler Features 10 Years, 6 Months ago  
Hey wow...I totally wasn\'t expecting someone to just come up with some code right away. I truly appreciate that! Thank you! I was thinking of a typical \"Black-Out\" spoiler tag, but what you came up with works really well.
#5372
Re:Spoiler Features 10 Years, 6 Months ago  
Hey wow...I totally wasn\'t expecting someone to just come up with some code right away. I truly appreciate that! Thank you! I was thinking of a typical \"Black-Out\" spoiler tag, but what you came up with works really well.
#5608
Re:Spoiler Features 10 Years, 6 Months ago  
As im not any good in coding could someone please tell me how i can simply have the text \"Show Text\" and when i click on it \"Hide Text\"

I dont want buttons, just plain text....
#29190
Re:Spoiler Features 10 Years ago  
Hi all.
Very cool spoiler code there and it\'s very handy!
However, is there a way of making the box adjustable depending on how much text is to be spoiled?
At the moment it\'s a fixed width and height and if anyone spoils too much it spills out onto unspoiled text, and if too little it looks very strange with all that empty space for just one word.
#29198
Re:Spoiler Features 10 Years ago  
Have you tried setting the height to auto?
#29202
Re:Spoiler Features 10 Years ago  
Ah that would work!
I\'m guessing the section that\'s in the CSS file? Which CSS tag/word would work? Is it just \"width: auto;\" for example?

EDIT
No bother, I fixed the height and width with \'auto\'.
I\'m currently trying to make the spoiler text a different colour, if anyone knows how?
I\'ve tried adding the following to the CSS file....

[code:1]div.spoiler-body {
height: auto;
width: auto;
background-color:white;
color:#FF0000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
}[/code:1]

But it doesn\'t do anything. Any help would be greatly appreciated.
#29253
Re:Spoiler Features 10 Years ago  
Can\'t get it working :(

What i did

edit smile.class.php under com_fireboard/template/default

add this line after the //italic code
[code:1]
//Spoiler Tag. Make sure to adjust stylesheet to include div.spoiler-header, div.spoiler-block, div.spoiler-body.
$fb_message_txt = preg_replace(\"/\\[spoiler\\](.*?)\\[\\/spoiler\\]/si\",\"Warning, Spoiler: \\\\1\",$fb_message_txt);[/code:1]

then add this to my forum css

[quote]div.spoiler-block {
width: 451px;
height: 50px;
border:hidden;
}

div.spoiler-header {
font: Arial, Helvetica, sans-serif;
font-size: 9px;
color:#0066FF;
}

div.spoiler-body {
height: auto;
width: auto;
}[/quote]

am i missing something here?
#29270
Re:Spoiler Features 10 Years ago  
\"If line breaks appear after copying into your editor, be sure to remove them or the code will not function.\".
Page: 12