From: brockhaus Date: Wed, 22 Aug 2007 17:57:57 +0000 (+0000) Subject: pingback fetchData: Retreive content from first

tag, if found in order to have... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=af779a4720628b7ebabc23c67ea3af2459ee5170;p=s9y.git pingback fetchData: Retreive content from first

tag, if found in order to have the article content instead of menu structure as content. If no

tag is found, the tag is the starting point to fetch content. --- diff --git a/include/functions_trackbacks.inc.php b/include/functions_trackbacks.inc.php index 315426b..cb9dd1f 100644 --- a/include/functions_trackbacks.inc.php +++ b/include/functions_trackbacks.inc.php @@ -510,10 +510,16 @@ function fetchPingbackData( &$comment) { $comment['title'] = strip_tags($matches[1]); } + // Try to get content from first

tag on: + if (preg_match('@]*>(.*?)@is',$fContent,$matches)) { + $body = $matches[1]; + } + if (empty($body) && preg_match('@]*>(.*?)@is',$fContent,$matches)){ + $body = $matches[1]; + } // Get a part of the article - if (preg_match('@]*>(.*?)@is',$fContent,$matches)) { - - $body = strip_tags($matches[1]); + if (!empty($body)) { + $body = strip_tags($body); //TODO: Serendipity comes into trouble wit html_entity_decode and "Umlaute" $body = str_replace(array(" "),array(' '),$body);