Skip to content

Instantly share code, notes, and snippets.

@fidelix
Created May 5, 2012 20:30
Show Gist options
  • Save fidelix/2605438 to your computer and use it in GitHub Desktop.
Save fidelix/2605438 to your computer and use it in GitHub Desktop.
<?php
//Recebe um array contendo os links e retorna um array contendo os codigos
function check_links ($links){
foreach ($links as &$url){
$host = parse_url($url);
$tld = $host['host'];
switch ($tld){
case ($tld == "peeje.com" || "www.peeje.com" || "peejeshare.com" || "www.peejeshare.com"):
$plugin = 'peeje';
break;
case ($tld == "glumbouploads.com" || $tld == "www.glumbouploads.com"):
$plugin = 'glumbo';
break;
default:
avisar_admin('Plugin incompatível! Debug:' . var_dump($host));
break;
}
if(!empty($plugin)) call_user_func_array("link_$plugin", $url);
}
return $links;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment