+ Reply to Thread
Results 1 to 5 of 5

Thread: BB code question

  1. Join Date
    Jan 2008
    Posts
    3

    BB code question

    Hello and thank for the script

    I have a question about bbcode:

    I have installed this forum news scrip in my web. I have in my forum IPB 2.1.7 a bbcode for youtube video, but this videos not are published in the news (only see the code)

    Thanks

  2. Join Date
    Aug 2004
    Posts
    781

    Re: BB code question

    The class file for Invision Power Board 2.1+ does not pull bbcode from the forum's database.

    Editing the class to do this may be beyond your PHP experience (you did not indicate if you knew anything about PHP). However, it is relatively easy to add bbcode manually to the class file.

    If you post your bbcode (give an example of what bbcode you put in and what comes out in the forum post) I can show you the small modification to a file that you must make.

  3. Join Date
    Jan 2008
    Posts
    3

    Re: BB code question

    Thanks

    I know a few about php

    The bbcode is :

    <object width="425" height="350"><embed src="http://www.youtube.com/v/{content}" type="application/x-shockwave-flash" width="425" height="350"></embed></object>
    and when i post, i write:

    [youtube]hu3oV1WUEQY[/youtube]

  4. Join Date
    Aug 2004
    Posts
    781

    Re: BB code question

    Open classes/sources/Forum/Invision_Power_Board_2.1.php

    Find:
    PHP Code:
            $search_array = array(
                            
    "/\[left\]/i",
                            
    "/\[\/left\]/i",
                            
    "/\[center\]/i",
                            
    "/\[\/center\]/i",
                            
    "/\[right\]/i",
                            
    "/\[\/right\]/i",
                            
    "/\[s\](.*?)\[\/s\]/is",
                            
    "/\[topic=([^\]]*)\](.*?)\[\/topic\]/i",
                            
    "/\[codebox\](.*?)\[\/codebox\]/is"
                            
    ); 
    And replace it with:
    PHP Code:
            $search_array = array(
                            
    "/\[left\]/i",
                            
    "/\[\/left\]/i",
                            
    "/\[center\]/i",
                            
    "/\[\/center\]/i",
                            
    "/\[right\]/i",
                            
    "/\[\/right\]/i",
                            
    "/\[s\](.*?)\[\/s\]/is",
                            
    "/\[topic=([^\]]*)\](.*?)\[\/topic\]/i",
                            
    "/\[codebox\](.*?)\[\/codebox\]/is",
                            
    "/\[youtube\](.*?)\[\/youtube\]/is"
                            
    ); 
    Find:
    PHP Code:
            $replace_array = array(
                            
    "<div align=\"left\">",
                            
    "</div>",
                            
    "<div align=\"center\">",
                            
    "</div>",
                            
    "<div align=\"right\">",
                            
    "</div>",
                            
    "<s>\$1</s>",
                            
    "<a href=\"" $this->LINKS['thread'] . "\$1\">\$2</a>",
                            
    "<div class='codemain' style='height:200px;white-space:pre;overflow:auto'>\$1</div>"
                            
    ); 
    And replace it with:
    PHP Code:
            $replace_array = array(
                            
    "<div align=\"left\">",
                            
    "</div>",
                            
    "<div align=\"center\">",
                            
    "</div>",
                            
    "<div align=\"right\">",
                            
    "</div>",
                            
    "<s>\$1</s>",
                            
    "<a href=\"" $this->LINKS['thread'] . "\$1\">\$2</a>",
                            
    "<div class='codemain' style='height:200px;white-space:pre;overflow:auto'>\$1</div>",
                            
    "<object width=\"425\" height=\"350\"><embed src=\"http://www.youtube.com/v/\$1\" type=\"application/x-shockwave-flash\" width=\"425\" height=\"350\"></embed></object>"
                            
    ); 
    Save & re-upload.

    Notice that we have simply added in the bbcode tags & replacement text into their respective search and replace arrays.

  5. Join Date
    Jan 2008
    Posts
    3

    Re: BB code question

    Thanks, go perfect.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts