zenin Posted January 21, 2007 Share Posted January 21, 2007 Hi. I would like to include a spoiler function in my blog and id like to know if there is any way to do it simple. I use MyBloggie from mywebland.com. And yes i tried to get help there but i never get any answer in the forums over there. And i also would like to know if there is any way to make the bbcode thumbnails smaller. Thx in advance Quote Link to comment https://forums.phpfreaks.com/topic/35103-spoiler-function-in-blog-and-bbcode-thumbnail-question/ Share on other sites More sharing options...
trq Posted January 21, 2007 Share Posted January 21, 2007 Take a look at [url=http://php.net/substr]substr[/url] for your first question. As for your second, you'll need to post the relevent code in the 'third party scripts' forum. Quote Link to comment https://forums.phpfreaks.com/topic/35103-spoiler-function-in-blog-and-bbcode-thumbnail-question/#findComment-165656 Share on other sites More sharing options...
zenin Posted January 21, 2007 Author Share Posted January 21, 2007 Could you specify what you mean for my first question? Iam an absolute newbie to php so you have to take it from the start :P i know that i have to have some knowledge in javascript also. To be perfectly clear on what i want: I want a bbcode [spoiler]hiddent text[/spoiler] like code. where you have to press on a Show test button so the hidden text gets visible. Quote Link to comment https://forums.phpfreaks.com/topic/35103-spoiler-function-in-blog-and-bbcode-thumbnail-question/#findComment-165664 Share on other sites More sharing options...
redbullmarky Posted January 21, 2007 Share Posted January 21, 2007 that would be more something you could achieve via either Javascript, or CSS (background/foreground colour exactly the same until you select the text).nothing really to do with PHP itself. Quote Link to comment https://forums.phpfreaks.com/topic/35103-spoiler-function-in-blog-and-bbcode-thumbnail-question/#findComment-165665 Share on other sites More sharing options...
smc Posted January 21, 2007 Share Posted January 21, 2007 This is the code I use for my spoiler function on http://stlegacyalliance.com[code]<div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" 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="alt2" style="margin: 0px; padding: 6px; border: 1px inset;"> <div style="display: none;"> Earth is in the sol system. </div> </div> </div>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/35103-spoiler-function-in-blog-and-bbcode-thumbnail-question/#findComment-165666 Share on other sites More sharing options...
zenin Posted January 21, 2007 Author Share Posted January 21, 2007 Sorry redbullmarky but I wish to have a button that a visitor can press so the testarea expands and show the hidden text. I see that this has nothing to do with php but i thought that maybe i have to edit my bbcode file to make an spoiler function. And the bbcode is in php.Thx smc...in wich file did you place this code? Quote Link to comment https://forums.phpfreaks.com/topic/35103-spoiler-function-in-blog-and-bbcode-thumbnail-question/#findComment-165700 Share on other sites More sharing options...
zenin Posted January 21, 2007 Author Share Posted January 21, 2007 Thank you very much smc! I figures out by my self where to put that code. It works perfectly :D thank you very very much! :D Quote Link to comment https://forums.phpfreaks.com/topic/35103-spoiler-function-in-blog-and-bbcode-thumbnail-question/#findComment-165716 Share on other sites More sharing options...
smc Posted January 21, 2007 Share Posted January 21, 2007 Glad to help :) Quote Link to comment https://forums.phpfreaks.com/topic/35103-spoiler-function-in-blog-and-bbcode-thumbnail-question/#findComment-165718 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.