_dynamic_format
Site Infrastructure / _dynamic_format

[
	$b = $_args.0;

	$orig = "/\[youtube:([^\"\[]*)\]/i";
	if(getu("video-embed") == 1)
		$new = {<center><a href="http://youtube.com/watch?v=$1">(youtube: $1)</a></center>}
	else
		$new = {<iframe class="ytplayer" type="text/html" width="640" height="390" src="http://youtube.com/embed/$1" frameborder="0"></iframe>};
	$b = regreplace($b, $orig, $new);

	$b;
]