Welcome To myPHPNuke.com

  Create An Account Home  ·  Topics  ·  Stats  ·  Your Account  ·  Submit News  ·  Top 10 May 22, 2013  

  Main Menu

  Just SOME MPN Driven Sites!!

  What Is myPHPNuke?
myPHPNuke Introduction
Would you like to contribute to our website or software?

Just Click Here and tell us about yourself.

General Discussion
Topic: Add embed Youtube


Search Forums

Moderated By: Kiril, avw
myPHPNuke.com Forum Index
  »» General Discussion
    »» Add embed Youtube

Please Register To Post


Author Add embed Youtube

Kang
Home away from home
Joined: 15-Feb-2003
Posts: 163
From: Malaysia


malaysia    avatar

posticon   Posted: 2009-08-18 06:03

1. Is it possible to embed Youtube to forum? If possible, can we add youtube BBCODE?

2. How to enable BBCODE in signature?

Thank you in advance!


-----------------
Warm regard from Malaysia!



  Member Information For KangProfile   Send Private Message To Kang   Go To Kang's Website   Send YIM Message To Kang   Quote And Reply To This MessageQuote

BigDaveKnight
Quite a regular
Joined: 19-May-2006
Posts: 42
From: Portsmouth, Hampshire, UK


uk    avatar

posticon   Posted: 2009-10-07 14:49

I've not been able to do either of these Kang, although it IS possible to use HTML in signature.



  Member Information For BigDaveKnightProfile   Send Private Message To BigDaveKnight   Send Email To BigDaveKnight   Go To BigDaveKnight's Website   Send YIM Message To BigDaveKnight   BigDaveKnight's MSNM Number Is BigDaveKnight@Hotmail.com   Quote And Reply To This MessageQuote

avw
MPN Developer
Joined: 07-Nov-2001
Posts: 1300
From: Houten


netherlands    avatar

posticon   Posted: 2009-10-16 13:42

Hi Kang,

Interesting question. The embedded code contains a lot of forbidden tags. As soon as you allow them in the sanitizing code, pasting the embedded HTML is likely to give a working embedding but we sanitize the content because a lot of attackers try to abuse the forum for inserting attacking code.

A BBCODE solution would be nice. I can think of a special form with a textarea that we offer to the user where the user can paste them embedded html code and upon close of that form, the system tries to parse the html embedding code into an array of fields for the BBCODE presentation.

Sounds like a lot of work, how often would you need it and which restrictions would you like to apply to the embedded code? Eg, fullscreen HD display in a forum thread seems to be inapropriate. Should display take place in the thread or in a new window?

Any other suggestions?



  Member Information For avwProfile   Send Private Message To avw   Go To avw's Website   Send ICQ Meesage To avw   Send AIM Meesage To avw   Send YIM Message To avw   Quote And Reply To This MessageQuote

p0rt
Not too shy to talk
Joined: 07-Jul-2006
Posts: 25


blank    avatar

posticon   Posted: 2011-01-10 07:30

you can add youtube to bbcode http://nullnuke.netai.net/forum.php?op=topic&topic=20&forum=17&min=0#22

in sanitize.class.php

find var $skip_action_tag     = array( '' );

and below add

var $skip_clickable_tag     = array( 'youtube', 'img' );

then the ghetto bit, in function makeClickable( &$string ) { under $delim = preg_quote( $delim ); add

!!! CODE !!!


foreach( $this -> skip_clickable_tag as $key ) {
            
            if ( eregi( $delim[0] . $key . $delim[1], $string ) ) {

                if ( eregi( $delim[0] . "youtube" . $delim[1], $string ) ) {

                    $string = str_replace("watch?v=", "v/", $string);

                }
                
                return $string;
                
            }

        }


        
        and for the bbcode replacements use
        
        

!!! CODE !!!


$youtubetag_array[] = "#\[youtube]([^?\n\r\t].*?)\[/youtube]#i";

$youtubetagreplacments_array[] = "<object width=\"480\" height=\"385\"><param name=\"movie\" value=\"\\1\"></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src=\"\\1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"480\" height=\"385\"></embed></object>";




  Member Information For p0rtProfile   Send Private Message To p0rt   Quote And Reply To This MessageQuote

todi
Not too shy to talk
Joined: 23-Sep-2004
Posts: 30
From: Germany


blank    avatar

posticon   Posted: 2011-02-05 14:28

And where do we put the bbcode replacements?


-----------------
Regards
todi



  Member Information For todiProfile   Send Private Message To todi   Quote And Reply To This MessageQuote

p0rt
Not too shy to talk
Joined: 07-Jul-2006
Posts: 25


blank    avatar

posticon   Posted: 2011-04-11 22:13

classes/subs/sanitizer/core_CheckInput.subclass.php

!!! CODE !!!


function adjustHTML( &$message, $usersig = NULL )
    {
        $srch = array
        (
             '<code>'
            , '</code>'
            , '<blockquote>'
            , '</blockquote>'
        );

        $repl = array
        (
             '<div class="codefrag"><h6>!!! CODE !!!</h6><hr class="lft" /><code>'
            , '</code><hr class="lft" /></div>'
            , '<div class="quote"><h6>!!! QUOTE !!!</h6><hr class="lft" /><blockquote>'
            , '</blockquote><hr class="lft" /></div>'
        );

}



  Member Information For p0rtProfile   Send Private Message To p0rt   Quote And Reply To This MessageQuote

Trivian
Just popping in
Joined: 18-Oct-2011
Posts: 1


blank    avatar

posticon   Posted: 2011-10-18 14:53

Thanks for the code. It passes perfectly for me!



  Member Information For TrivianProfile   Send Private Message To Trivian   Quote And Reply To This MessageQuote

Member Messages

Forum Search & Navigation


 

Log in to check your private messages



Please Login Or Register





  


 

[ Advanced Search ]

Jump To Forum: 



  ChatBox II
smartvicky >  
sailwell >  hi
sailwell >  any body in?
sailwell >  i have instalation problem
sailwell >  any one help me
duke-leto >  kiril are you on here?
santeriablooms29 >  hello good day....



Click here to open the chatbox...
0 people chatting right now.