Example #1
0
 function showUrl($url, $icon = true)
 {
     if (strstr($url, "<embed")) {
         $url = String::getUrlFromEmbed($url);
     }
     if (strstr($url, "youtube")) {
         $player = 'youtube';
     }
     if (!strstr($url, "http://")) {
         $url = "http://" . $url;
     }
     if ($icon) {
         $file_parts = explode('.', $url);
         $ext = !$player ? end($file_parts) : $player;
         $file_icon = File::showExtIcon($ext);
     }
     return "{$file_icon} <a href=\"{$url}\">{$url}</a>";
 }