I want users to be able to display embedded video’s (google, youtube, etc) in the comments, but not full html…..
A youtube embed code looks like this:
<object width=“425” height=“356”><param name=“movie” value=“http://www.dailymotion.com/swf/6kb4ACETZligP1tYX”></param><embed src=“http://www.dailymotion.com/swf/6kb4ACETZligP1tYX” type=“application/x-shockwave-flash” width=“425” height=“334”></embed></object>
So what seems logical is to use BBcode (pmcode) for it, right?
Example:
[youtube] <object width=“425” height=“356”><param name=“movie” value=“http://www.dailymotion.com/swf/6kb4ACETZligP1tYX”></param><embed src=“http://www.dailymotion.com/swf/6kb4ACETZligP1tYX” type=“application/x-shockwave-flash” width=“425” height=“334”></embed></object> [/youtube]
I modified the pmcode file in /pm/lib and added a replace string for it: $str = preg_replace(“/\[youtube\](.*?)\[\/youtube\]/i”,“\\1”,$str);
But unfortunately it doesn’t work….it will only show the code itself…(probably cuz html is disabled?)
Does somebody has a good solution to get the code displayed normally between these custom tags (without enabling html for comments)? TIA!
