clean($value,'encode');
if(preg_match_all($regexlink,$value,$matches)) {
// $value = ''.$value.'';
$value = preg_replace("/".preg_quote($this->clean($matches[0][0],'encode'),'/')."/",''.$matches[0][0].'',$matches[0][0]);
}
return $value;
}
public function prepareMixedMedia($value) {
if(($value != '') or ($value !=NULL)) {
if(stristr(strtolower($value),'.mp3')) {
return "
";
} elseif(stristr(strtolower($value),'.ogg') || stristr(strtolower($value),'.opus')) {
return "
";
} else {
return "";
}
}
}
public function fetchHTML($url) {
$channel = curl_init();
curl_setopt($channel, CURLOPT_URL, $url);
curl_setopt($channel, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($channel);
curl_close($channel);
if($result) {
return $result;
} else {
return false;
}
}
public function prepareHTML($result) {
if(strlen($result) > 1900) {
return $this->clean(substr($value,'encode'),0,1900);
} else {
$value = $this->clean($result,'encode');
// bandcamp integration
$bandcamp_url = 'PHP/bandcamp.php?embed=';
$bandcamp_error = 'Bandcamp failed to load. Reload the page, or please contact support.';
// initialize an append value.
$value_add = '';
if(preg_match_all('/https:\/\/[a-z0-9]+.bandcamp.com\/track\/[a-z0-9-_]+/i', $value, $matches)) {
$gethtml = $this->fetchHTML($bandcamp_url . $this->clean($matches[0][0],'encode'));
if($gethtml != false) {
$value_add .= PHP_EOL;
$value_add .= $gethtml;
} else {
$value_add .= '