-
- }
- } elseif ($siteinfo["image"] != "") {
- $src = completeurl($siteinfo["image"], $url);
-
- unset($siteinfo["image"]);
-
- $photodata = get_photo_info($src);
-
- if (($photodata) && ($photodata[0] > 10) and ($photodata[1] > 10))
- $siteinfo["images"][] = array("src"=>$src,
- "width"=>$photodata[0],
- "height"=>$photodata[1]);
- }
-
- if ((@$siteinfo["text"] == "") AND (@$siteinfo["title"] != "") AND !$no_guessing) {
- $text = "";
-
- $list = $xpath->query("//div[@class='article']");
- foreach ($list as $node)
- if (strlen($node->nodeValue) > 40)
- $text .= " ".trim($node->nodeValue);
-
- if ($text == "") {
- $list = $xpath->query("//div[@class='content']");
- foreach ($list as $node)
- if (strlen($node->nodeValue) > 40)
- $text .= " ".trim($node->nodeValue);
- }
-
- // If none text was found then take the paragraph content
- if ($text == "") {
- $list = $xpath->query("//p");
- foreach ($list as $node)
- if (strlen($node->nodeValue) > 40)
- $text .= " ".trim($node->nodeValue);
- }
-
- if ($text != "") {
- $text = trim(str_replace(array("\n", "\r"), array(" ", " "), $text));
-
- while (strpos($text, " "))
- $text = trim(str_replace(" ", " ", $text));
-
- $siteinfo["text"] = trim(html_entity_decode(substr($text,0,350), ENT_QUOTES, "UTF-8").'...');
- }
- }
-
- logger("parseurl_getsiteinfo: Siteinfo for ".$url." ".print_r($siteinfo, true), LOGGER_DEBUG);
-
- call_hooks('getsiteinfo', $siteinfo);
-
- return($siteinfo);
-}
-
-function arr_add_hashes(&$item,$k) {
- $item = '#' . $item;
-}
-
-function parse_url_content(&$a) {
-
- require_once("include/items.php");
-
- $text = null;
- $str_tags = '';
-
- $textmode = false;
-
- if(local_user() && (! feature_enabled(local_user(),'richtext')))
- $textmode = true;
-
- //if($textmode)
- $br = (($textmode) ? "\n" : '<br />');
-
- if(x($_GET,'binurl'))
- $url = trim(hex2bin($_GET['binurl']));
- else
- $url = trim($_GET['url']);
-
- if($_GET['title'])
- $title = strip_tags(trim($_GET['title']));
-
- if($_GET['description'])
- $text = strip_tags(trim($_GET['description']));
-
- if($_GET['tags']) {
- $arr_tags = str_getcsv($_GET['tags']);
- if(count($arr_tags)) {
- array_walk($arr_tags,'arr_add_hashes');
- $str_tags = $br . implode(' ',$arr_tags) . $br;