diff options
author | Robin Millette <millette@controlyourself.ca> | 2009-02-16 17:46:24 +0000 |
---|---|---|
committer | Robin Millette <millette@controlyourself.ca> | 2009-02-16 17:46:24 +0000 |
commit | 9c9b6790ce78296c0b182f03b5f6f2c035e43a7c (patch) | |
tree | 8b01f65f8448570f16bf90f129684ba0365da093 /lib/util.php | |
parent | faf82eebfebf24c7a8aa62b517e15c0a1ad71954 (diff) |
trac #201 Add flowplayer to enable multimedia playback capability.
Diffstat (limited to 'lib/util.php')
-rw-r--r-- | lib/util.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/util.php b/lib/util.php index b065c2d74..094b2750c 100644 --- a/lib/util.php +++ b/lib/util.php @@ -474,11 +474,17 @@ function common_replace_urls_callback($text, $callback) { function common_linkify($url) { // It comes in special'd, so we unspecial it before passing to the stringifying // functions + $ext = pathinfo($url, PATHINFO_EXTENSION); $url = htmlspecialchars_decode($url); + $video_ext = array('mp4', 'flv', 'avi', 'mpg', 'mp3', 'ogg'); $display = $url; $url = (!preg_match('#^([a-z]+://|(mailto|aim|tel):)#i', $url)) ? 'http://'.$url : $url; $attrs = array('href' => $url, 'rel' => 'external'); + + if (in_array($ext, $video_ext)) { + $attrs['class'] = 'media'; + } if ($longurl = common_longurl($url)) { $attrs['title'] = $longurl; |