1. replace AT_INCLUDE_PATH with TR_INCLUDE_PATH
[acontent.git] / docs / home / classes / ContentUtility.class.php
index 21e8e4d..f90f236 100644 (file)
@@ -140,19 +140,40 @@ class ContentUtility {
        private static function embedFLV($text) {\r
                global $content_base_href;\r
                \r
-               // .flv - uses Flowplayer 3.0 from flowplayer.org (playing file via full URL)\r
-               preg_match_all("#\[media[0-9a-z\|]*\]http://([\w\./-]+)\.flv\[/media\]#i",$text,$media_matches[0],PREG_SET_ORDER);\r
-               $media_replace[0] ="<a class=\"flowplayerholder\"\r
-               style=\"display:block;width:##WIDTH##px;height:##HEIGHT##px;\"\r
-               href=\"http://##MEDIA1##.flv\">\r
-               </a>";\r
-               \r
-               // .flv - uses Flowplayer 3.0 from flowplayer.org (playing file from AT_content_dir)\r
-               preg_match_all("#\[media[0-9a-z\|]*\]([\w\./-]+)\.flv\[/media\]#i",$text,$media_matches[1],PREG_SET_ORDER);\r
-               $media_replace[1] ="<a class=\"flowplayerholder\"\r
-               style=\"display:block;width:##WIDTH##px;height:##HEIGHT##px;\"\r
-               href=\"".TR_BASE_HREF."get.php/".$content_base_href."##MEDIA1##.flv\">\r
-               </a>";\r
+               $media_replace = array();\r
+               $media_matches = array();\r
+               \r
+               // .flv (playing file via full URL)\r
+               preg_match_all("#\[media[0-9a-z\|]*\]http://([\w\./-]+)\.flv\[/media\]#i",$text,$media_matches[],PREG_SET_ORDER);\r
+               $media_replace[] ="<a class=\"flowplayerholder\" style=\"display:block;width:##WIDTH##px;height:##HEIGHT##px;\" href=\"http://##MEDIA1##.flv\"></a>";\r
+               \r
+               // .flv (playing file from TR_content_dir)\r
+               preg_match_all("#\[media[0-9a-z\|]*\]([.\w\d]+[^\s\"]+)\.flv\[/media\]#i",$text,$media_matches[],PREG_SET_ORDER);\r
+               $media_replace[] ="<a class=\"flowplayerholder\" style=\"display:block;width:##WIDTH##px;height:##HEIGHT##px;\" href=\"".TR_BASE_HREF."get.php/".$content_base_href."##MEDIA1##.flv\"></a>";\r
+               \r
+               // .mp4 (playing file via full URL)\r
+               preg_match_all("#\[media[0-9a-z\|]*\]http://([\w\./-]+)\.mp4\[/media\]#i",$text,$media_matches[],PREG_SET_ORDER);\r
+               $media_replace[] ="<a class=\"flowplayerholder\" style=\"display:block;width:##WIDTH##px;height:##HEIGHT##px;\" href=\"http://##MEDIA1##.mp4\"></a>";\r
+               \r
+               // .mp4 (playing file from TR_content_dir)\r
+               preg_match_all("#\[media[0-9a-z\|]*\]([.\w\d]+[^\s\"]+)\.mp4\[/media\]#i",$text,$media_matches[],PREG_SET_ORDER);\r
+               $media_replace[] ="<a class=\"flowplayerholder\" style=\"display:block;width:##WIDTH##px;height:##HEIGHT##px;\" href=\"".TR_BASE_HREF."get.php/".$content_base_href."##MEDIA1##.mp4\"></a>";\r
+               \r
+               // .mov (playing file via full URL)\r
+               preg_match_all("#\[media[0-9a-z\|]*\]http://([\w\./-]+)\.mov\[/media\]#i",$text,$media_matches[],PREG_SET_ORDER);\r
+               $media_replace[] ="<a class=\"flowplayerholder\" style=\"display:block;width:##WIDTH##px;height:##HEIGHT##px;\" href=\"http://##MEDIA1##.mov\"></a>";\r
+               \r
+               // .mov (playing file from TR_content_dir)\r
+               preg_match_all("#\[media[0-9a-z\|]*\]([.\w\d]+[^\s\"]+)\.mov\[/media\]#i",$text,$media_matches[],PREG_SET_ORDER);\r
+               $media_replace[] ="<a class=\"flowplayerholder\" style=\"display:block;width:##WIDTH##px;height:##HEIGHT##px;\" href=\"".TR_BASE_HREF."get.php/".$content_base_href."##MEDIA1##.mov\"></a>";\r
+               \r
+               // .mp3 (playing file via full URL)\r
+               preg_match_all("#\[media[0-9a-z\|]*\]http://([\w\./-]+)\.mp3\[/media\]#i",$text,$media_matches[],PREG_SET_ORDER);\r
+               $media_replace[] ="<a class=\"flowplayerholder\" style=\"display:block;width:##WIDTH##px;height:##HEIGHT##px;\" href=\"http://##MEDIA1##.mp3\"></a>";\r
+               \r
+               // .mp3 (playing file from TR_content_dir)\r
+               preg_match_all("#\[media[0-9a-z\|]*\](.+[^\s\"]+)\.mp3\[/media\]#i",$text,$media_matches[],PREG_SET_ORDER);\r
+               $media_replace[] ="<a class=\"flowplayerholder\" style=\"display:block;width:##WIDTH##px;height:##HEIGHT##px;\" href=\"".TR_BASE_HREF."get.php/".$content_base_href."##MEDIA1##.mp3\"></a>";\r
                \r
                $has_flv = false;\r
                // Executing the replace\r