From: Cindy Li Date: Thu, 13 Oct 2011 16:47:00 +0000 (-0000) Subject: http://atutor.ca/atutor/mantis/view.php?id=4894 X-Git-Tag: v1.2~1 X-Git-Url: https://iam.tj/gitweb/gitweb.cgi?p=acontent.git;a=commitdiff_plain;h=5cc4ff108fa80474c41183932b87b2bad0a7112e http://atutor.ca/atutor/mantis/view.php?id=4894 The proper functioning of flowplayer requires flash to be installed. Coverts the [media] tag into flowplayer type only when the flash is available, otherwise, converts to a plain link instead. --- diff --git a/docs/home/classes/ContentUtility.class.php b/docs/home/classes/ContentUtility.class.php index 1a217de..0baae42 100644 --- a/docs/home/classes/ContentUtility.class.php +++ b/docs/home/classes/ContentUtility.class.php @@ -147,26 +147,30 @@ class ContentUtility { // .flv preg_match_all("#\[media[0-9a-z\|]*\]([.\w\d]+[^\s\"]+)\.flv\[/media\]#i",$text,$media_matches[],PREG_SET_ORDER); - $media_replace[] ="\n". - "
\n". - " \n". - "
\n". - "
\n". - " ##MEDIA1##.flv\n". - "
\n". - "
"; + + if (isset($_SESSION['flash']) && $_SESSION['flash'] == "yes") { + $media_replace[] = "
\n". + " \n". + "
\n"; + } else { + $media_replace[] = "
\n". + " ##MEDIA1##.flv\n". + "
\n"; + } // .mp4 preg_match_all("#\[media[0-9a-z\|]*\]([.\w\d]+[^\s\"]+)\.mp4\[/media\]#i",$text,$media_matches[],PREG_SET_ORDER); - //$media_replace[] =""; - $media_replace[] ="\n". - "
\n". - " \n". - "
\n". - "
\n". - " ##MEDIA1##.mp4\n". - "
\n". - "
"; + + if (isset($_SESSION['flash']) && $_SESSION['flash'] == "yes") { + $media_replace[] = "
\n". + " \n". + "
\n"; + } else { + $media_replace[] = "
\n". + " ##MEDIA1##.mp4\n". + "
\n"; + } + // Executing the replace for ($i=0;$i