English version - [Modification] BBCode spoiler.
evilmc - 10-11-2010, 17:35 Temat postu: [Modification] BBCode spoiler. I have problems with large images that users post on the forum and want to add Spoiler MOD, but not the Spoiler that in quoting like this.
I want to add bbcode like as YouTube, quote button for new topic and new post...
Where can I find this bbcode?
Thanx
Matteo - 10-11-2010, 21:19
evilmc napisał/a: | I have problems with large images that users post on the forum | Could you give adress to topic/post with example?
evilmc napisał/a: | I want to add bbcode like as YouTube, quote button for new topic and new post... | You want add a new bbcode tag, like [youtube] ?
evilmc - 11-11-2010, 16:31
Matteo napisał/a: | You want add a new bbcode tag, like [youtube] ? |
yes!
Matteo napisał/a: | Could you give adress to topic/post with example? |
example:
http://www.serbian-fm.net...on-vt219,40.htm
Matteo - 11-11-2010, 16:44
It's normal. When image is large - forum script decrease the image size and after few seconds the view topic looks great.
evilmc napisał/a: | yes! | You can install this modification.
Bucu - 11-11-2010, 18:20
Cytat: | You can install this modification. |
I do not recommend installing this MOD. If you remove this mod, all posts written when mod was active, will be without bbcodes - there is one solution for them, edit every post and save. If you can wait - i'll try to find some time today, and make spoiler bbcode mod.
Matteo - 11-11-2010, 18:21
Bucu napisał/a: | If you remove this mod, all posts written when mod was active, will be without bbcodes - there is one solution for them, edit every post and save. | Yep. It's true.
Bucu - 11-11-2010, 18:43
Kod: | @@@ open includes/bbcode.php and find:
$bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']);
@@@ after add:
$bbcode_tpl['spoiler'] = str_replace('{SPOILER}', '\\1', $bbcode_tpl['spoiler']);
@@@ find:
// [email]user@domain.tld[/email] code..
$patterns[] = "#\[email\]([a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si";
$replacements[] = $bbcode_tpl['email'];
@@@ after add:
// spoiler code
$patterns[] = "#\[spoiler\]([^?].*?)\[/spoiler\]#si";
$replacements[] = $bbcode_tpl['spoiler'];
@@@ open templates/*/bbcode.tpl and add in the end of the file:
<!-- BEGIN spoiler -->
<div id="spoilerhead" class="thead">
<b><a href="#">Spoiler</a></b></div>
<div id="spoilercontent">{SPOILER}</div>
<!-- END spoiler -->
@@@ open templates/*/overall_header.tpl and find:
</head>
@@@ before add:
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
$("#spoilercontent").hide();
$("#spoilerhead").click(function () {
if ($("#spoilercontent").is(":hidden")) {
$("#spoilercontent").slideDown("slow");
} else {
$("#spoilercontent").slideUp("slow");
}
});
});
</script>
@@@ save and close all files |
Simple, but works excellent.
evilmc - 12-11-2010, 14:22
Bucu, nice work! It is possible that when I click the ''spoiler'' to me back on TOP forum, that you can do to resolve?
thanx again!
[ Added: 26-10-2011, 01:20 ]
Bucu, I add this your mod on my new forum, and spoiler works only first post, when I add second post spoiler not working, when I click on Spoiler take me back to top...How fix?
[ Added: 19-03-2012, 00:34 ]
Does anyone can test the spoiler, and how to solve the problem?
Bucu napisał/a: | Kod: | @@@ open includes/bbcode.php and find:
$bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']);
@@@ after add:
$bbcode_tpl['spoiler'] = str_replace('{SPOILER}', '\\1', $bbcode_tpl['spoiler']);
@@@ find:
// [email]user@domain.tld[/email] code..
$patterns[] = "#\[email\]([a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si";
$replacements[] = $bbcode_tpl['email'];
@@@ after add:
// spoiler code
$patterns[] = "#\[spoiler\]([^?].*?)\[/spoiler\]#si";
$replacements[] = $bbcode_tpl['spoiler'];
@@@ open templates/*/bbcode.tpl and add in the end of the file:
<!-- BEGIN spoiler -->
<div id="spoilerhead" class="thead">
<b><a href="#">Spoiler</a></b></div>
<div id="spoilercontent">{SPOILER}</div>
<!-- END spoiler -->
@@@ open templates/*/overall_header.tpl and find:
</head>
@@@ before add:
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
$("#spoilercontent").hide();
$("#spoilerhead").click(function () {
if ($("#spoilercontent").is(":hidden")) {
$("#spoilercontent").slideDown("slow");
} else {
$("#spoilercontent").slideUp("slow");
}
});
});
</script>
@@@ save and close all files |
Simple, but works excellent. |
|
|
|