embedding youtube/etc? (25)

1 Name: dirtypants : 2008-05-21 22:06 ID:xtBUBKh9 [Del]

I found this bit of code from back in 2006, and it makes sense to me:

use constant ALLOWED_HTML => (

'a'=>{args=>{'href'=>'url'}},
'b'=>{},'i'=>{},'u'=>{},'sub'=>{},'sup'=>{},
'em'=>{},'strong'=>{},
'ul'=>{},'ol'=>{},'li'=>{},'dl'=>{},'dt'=>{},'dd'=>{},
'p'=>{},'br'=>{empty=>1},'blockquote'=>{},

)

But putting it in there causes a server error.

How can I parse allowed HTML so that people can embed stuff like this?

Thanks!

11 Name: llama : 2009-03-21 08:50 ID:y7Xzo/8H [Del]

It cant be easier to do something like this. Here is what you do for all the noobs out there

-In wakaba, open your config.pl file. Scroll down to the very bottom where it says "1;". It should be the last line.

Above that last line, there is this "# no encoding; # Uncomment this if you uncommented the "use encoding" at the top of the file"

IN the middle of both those lines, put this code (as shown above)
use constant ALLOWED_HTML => (
'a'=>{args=>{'href'=>'url'},forced=>{'rel'=>'nofollow'}},
'object'=>{forced=>{'width'=>'425','height'=>'350'}},
'param'=>{args=>{'value'=>'url'},forced=>{'name'=>'movie'}},
'embed'=>{args=>{'src'=>'url'},forced=>{'type'=>'application/x-shockwave-flash','wmode'=>'transparent','width'=>'425','height'=>'350'}},
'b'=>{},'i'=>{},'u'=>{},'sub'=>{},'sup'=>{},
'em'=>{},'strong'=>{},
'ul'=>{},'ol'=>{},'li'=>{},'dl'=>{},'dt'=>{},'dd'=>{},
'p'=>{},'br'=>{empty=>1},'blockquote'=>{},
);

--------

The final statement should read"

# no encoding; # Uncomment this if you uncommented the "use encoding" at the top of the file
# Allowed HTML tags and attributes. Sort of undocumented for now, but feel free to
# learn by example.
use constant ALLOWED_HTML => (
'a'=>{args=>{'href'=>'url'},forced=>{'rel'=>'nofollow'}},
'object'=>{forced=>{'width'=>'425','height'=>'350'}},
'param'=>{args=>{'value'=>'url'},forced=>{'name'=>'movie'}},
'embed'=>{args=>{'src'=>'url'},forced=>{'type'=>'application/x-shockwave-flash','wmode'=>'transparent','width'=>'425','height'=>'350'}},
'b'=>{},'i'=>{},'u'=>{},'sub'=>{},'sup'=>{},
'em'=>{},'strong'=>{},
'ul'=>{},'ol'=>{},'li'=>{},'dl'=>{},'dt'=>{},'dd'=>{},
'p'=>{},'br'=>{empty=>1},'blockquote'=>{},
);
1;

12 Name: llama : 2009-03-21 08:51 ID:y7Xzo/8H [Del]

The when you embed a video, simply just copy the embed code from youtube, etc and just paste it in the textbox as is.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: