close Warning: Can't synchronize with repository "(default)" (/home/svn/repos/bb-plugins does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 16 years ago

#19 new enhancement

Updated code for Easy Video Emmbed

Reported by: silasje1 Owned by: kennon
Priority: normal Component: activity-highlights
Keywords: Cc:

Description

	 function ae_detect_ie()
{
    if (isset($_SERVER['HTTP_USER_AGENT']) && 
    (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))
        return true;
    else
        return false;
}


--------- YOUTUBE --------------------------------

​http://www.youtube.com/watch?v=1shNS-udcGQ

 if (ae_detect_ie()) {$post_text = preg_replace('#\[video\]http:\/\/([a-zA-Z0-9]+\.|)youtube\.com\/.*v=([a-zA-Z0-9_-]+).*\[/video\]#i', 
'<object width="640" height="510"><param name="movie" value="http://www.youtube.com/v/\\1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/\\2" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="510"></embed></object>',$post_text); } else { $post_text = preg_replace('#\[video\]http:\/\/([a-zA-Z0-9]+\.|)youtube\.com\/.*v=([a-zA-Z0-9_-]+).*\[/video\]#i', 
'<iframe title="YouTube video player" width="853" height="510" src="http://www.youtube.com/v/\\2"frameborder="0" allowfullscreen></iframe>',$post_text); 
   } 
     return $post_text;
	  }

}

Change History (0)

Note: See TracTickets for help on using tickets.