By David Montoya on Friday, 08 April 2016
Posted in General Issues
Likes 0
Views 337
Votes 0
Where in com_easyblog/controllers could I store these functions? If you can point me in the right direction with a tutorial or documentation, I'd greatly appreciate it.

function getfavicon($url){ //get favicon URL from provided URL
$favicon = '';
$html = file_get_contents($url);
$dom = new DOMDocument();
$dom->loadHTML($html);
$links = $dom->getElementsByTagName('link');
for ($i = 0; $i < $links->length; $i++){
$link = $links->item($i);
if($link->getAttribute('rel') == 'icon'){
$favicon = $link->getAttribute('href');
}
}
return $favicon;
}

function strbtw($string, $start, $end){ //get string in between two unique strings
$string = ' ' . $string;
$ini = strpos($string, $start);
if ($ini == 0) return '';
$ini += strlen($start);
$len = strpos($string, $end, $ini) - $ini;
return substr($string, $ini, $len);
}
Got it resolved here. I'm learning!!
·
Friday, 08 April 2016 13:09
·
0 Likes
·
0 Votes
·
0 Comments
·
Also, I know that customizations are generally not supported. I'm willing to pay a little bit for the advice.
·
Friday, 08 April 2016 10:32
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for updating David, glad that your issues are resolved now
·
Friday, 08 April 2016 17:53
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post