Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6123069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:58:21+00:00 2026-05-23T15:58:21+00:00

I have a bbcode for spoilers on my forum. It shows/hides whatever text is

  • 0

I have a bbcode for “spoilers” on my forum.

It shows/hides whatever text is inside the [spoiler] text [/spoiler] bbcode.

HTML replacement for this spoiler bbcode is as follows:

<div class="spoiler"><script>
function showHide(what){
a=what.getElementsByTagName("div")[0];
if(a.style.display=='none'){
a.style.display='block';
}else{
a.style.display='none';
}}
</script>
<input type="button" onclick="showHide(this.parentNode)" value="Spoiler"><b><small> ( Click to show/hide )</small></b><div style="display:none">{param}</div></div>

Where {param} is the text in between the bbcode tags.

Now, this usually works in some forums, where a person can add [center] [/center] bbcode around the spoiler bbcodes to center the spoiler button on the screen.

The [center][/center] tags have the following html:

<p style="text-align: center;"> TEXT </p>

I attempt to center the spoiler bbcode here, in my forum “signature” (under the post)

http://forums.animefushigi.com/showthread.php?2

Still it aligns left. How can I make it work? Preferably making changes to only the spoiler bbcode, as the center one is built-in.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:58:22+00:00Added an answer on May 23, 2026 at 3:58 pm

    While not the best of solutions, if you can change the center tag code to

    <center> TEXT </center>
    

    it does fix your problem. I will edit later if I find a better solution from inside the spoiler div.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this function to parse bbcode -> html: $this->text = preg_replace(array( '/\[b\](.*?)\[\/b\]/ms', '/\[i\](.*?)\[\/i\]/ms',
I have this in my application_helper.rb : def bbcode(text) # Code snippets text.gsub!(/\[code=?[']?(.*?)[']?\](.*?)\[\/code\]/mis) {
I have this code that replaces the BBCode to html, the problem arises when
I have some code with the a structure similar to this function bbcode($Text) {
Have a look at this picture alt text http://www.abbeylegal.com/downloads/2009-04-01/web%20part%20top%20line.jpg Does anyone know what css
I am using a little BBCode parsing function for a forum I have. It
I have a string which contains the text of an article. This is sprinkled
I have this bbcode: [url=http://www.youtube.com/watch?v=h1bIEK1h150]If I offer you my soul[/url] for example. How can
I originally have this preg_match_all pattern for the HTML img tag, but how do
So I have created this function in PHP to output text in the required

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.