external links
Forum rules
You dont have to use ModX or make your mod AutoMod compatible. A simple textfile is fine
But if you post Mods here You also have to give support
You dont have to use ModX or make your mod AutoMod compatible. A simple textfile is fine
But if you post Mods here You also have to give support
external links
lol RICH ( damn so hard to get names right when your are not English mother tongue!) Thanks again for your help. It is very much appreciated.
external links
And if we want to support non english characters like æøå?RMcGirr83 wrote:Try this instead
Code: Select all
$curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5); $result = curl_exec($curl); curl_close($curl); if(!empty($result)) { $dom = new DOMDocument(); if (@$dom->loadHTML($result)) { $title = $dom->getElementsByTagName('title'); if (!empty($title->item(0)->nodeValue)) { $text = str_replace("\n", " ", $title->item(0)->nodeValue); break; } } }
external links
New Code
Code: Select all
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt ($curl, CURLOPT_CONNECTTIMEOUT, 5);
$result = curl_exec($curl);
curl_close($curl);
if(!empty($result))
{
$dom = new DOMDocument();
$result = mb_convert_encoding($result, 'HTML-ENTITIES', "UTF-8");
if (@$dom->loadHTML($result))
{
$title = $dom->getElementsByTagName('title');
if (!empty($title->item(0)->nodeValue))
{
$text = str_replace("\n", " ", $title->item(0)->nodeValue);
break;
}
}
}
Last edited by RMcGirr83 on 24 Apr 2013, 10:03, edited 1 time in total.
external links
Works good but gives errors in the acpRMcGirr83 wrote:New Code
Code: Select all
$curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5); $result = curl_exec($curl); curl_close($curl); if(!empty($result)) { $dom = new DOMDocument(); $result = mb_convert_encoding($result, 'HTML-ENTITIES', "UTF-8"); if (@$dom->loadHTML($result)) { $title = $dom->getElementsByTagName('title'); if (!empty($title->item(0)->nodeValue)) { $text = str_replace("\n", " ", $title->item(0)->nodeValue); break; } } }
line code
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5);
You do not have the required permissions to view the files attached to this post.