Seite 1 von 1
[BBCODE] Spoiler
Verfasst: 29.05.2007 22:38
von Foren Mitglied
Beispiel:
Diesen Text kann man erst dann sehen, wenn man den Spoiler anzeigen lässt [schild]Hallo, ich bin im Spoiler versteckt...[/schild]
BBCODE:
HTML Replacement:
Code: Alles auswählen
<div class="navbar">
<div class="panel jumpbox" style="display: block;">
<span 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.innerHTML = '<b>Spoiler: </b><a href=\'#\' onClick=\'return false;\'>verstecken</a>';
}
else
{
this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none';
this.innerHTML = '<b>Spoiler: </b><a href=\'#\' onClick=\'return false;\'>anzeigen</a>';
}">
<b>Spoiler: </b>
<a href="#" onclick="return false;">anzeigen</a>
</span>
</div>
<div class="quotecontent">
<div style="display: none;">
{TEXT}
</div>
</div>
</div>
DEMO Spoiler
Verfasst: 22.08.2007 17:06
von Foren Mitglied
Dies ist der erste Spoiler!
Code: Alles auswählen
/**
* Rewritten by Nathan Codding - Feb 6, 2001.
* - Goes through the given string, and replaces xxxx://yyyy with an HTML <a> tag linking
* to that URL
* - Goes through the given string, and replaces www.xxxx.yyyy[zzzz] with an HTML <a> tag linking
* to http://www.xxxx.yyyy[/zzzz]
* - Goes through the given string, and replaces xxxx@yyyy with an HTML mailto: tag linking
* to that email address
* - Only matches these 2 patterns either after a space, or at the beginning of a line
*
* Notes: the email one might get annoying - it's easy to make it more restrictive, though.. maybe
* have it require something like xxxx@yyyy.zzzz or such. We'll see.
*/
function make_clickable($text)
{
$text = preg_replace('#(script|about|applet|activex|chrome):#is', "1:", $text);
// pad it with a space so we can match things at the start of the 1st line.
$ret = ' ' . $text;
// matches an "xxxx://yyyy" URL at the start of a line, or after a space.
// xxxx can only be alpha characters.
// yyyy is anything up to the first space, newline, comma, double quote or <
$ret = preg_replace("#(^|[n ])([w]+?://[w#$%&~/.-;:=,?@[]+]*)#is", "1<a href="2" target="_blank">2</a>", $ret);
// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
// zzzz is optional.. will contain everything up to the first space, newline,
// comma, double quote or <.
$ret = preg_replace("#(^|[n ])((www|ftp).[w#$%&~/.-;:=,?@[]+]*)#is", "1<a href="http://2" target="_blank">2</a>", $ret);
// matches an email@domain type address at the start of a line, or after a space.
// Note: Only the followed chars are valid; alphanums, "-", "_" and or ".".
$ret = preg_replace("#(^|[n ])([a-z0-9&-_.]+?)@([w-]+.([w-.]+.)*[w]+)#i", "1<a href="mailto:2@3">2@3</a>", $ret);
// Remove our padding..
$ret = substr($ret, 1);
return($ret);
}
Dies ist der zweite Spoiler mit URL zum anklicken -->
gallery/ !
Dies ist der dritte Spoiler!
Dies ist der vierte Spoiler!
Re: [BBCODE] Spoiler
Verfasst: 09.01.2008 00:22
von Foren Mitglied
Hallo Doc,
ich habe mit dem MOD ein Problem, nach dem absenden bekomme ich folgende Anzeige im Beitrag:
ausblenden'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerHTML = 'Spoiler: anzeigen'; }" />Spoiler: anzeigen
Hast Du eine Idee dazu?
Danke und Gruß
Pete
Re: [BBCODE] Spoiler
Verfasst: 09.01.2008 08:48
von Foren Mitglied
Einbaufehler Deinerseits.
Extrahinweis: Scrolle mal hier im Forum ganz nach oben....das rot markierte bitte lesen ( Forumsregeln )
Re: [BBCODE] Spoiler
Verfasst: 22.02.2008 15:21
von Foren Mitglied
Re: [BBCODE] Spoiler
Verfasst: 22.02.2008 16:18
von Foren Mitglied
Ein Spoiler im Spoiler ist unsinnig und wird nicht supportet.
Du kannst ja auch keinen [color] in einem [color] verwenden.
-->
Test