Famous person:



• nothing was found"; $s = str_replace("s's", "s'", $s); } $s = '
' . $s . '
'; echo $s; $sCache .= $s; } } } addQueryToCache($q, $sCache); } else { echo $sCache; } } ?>
$key, "q" => $q, "start" => $start, "maxResults" => 10, "filter" => true, "restrict" => "", "safeSearch" => false, "lr" => "", "ie" => "", "oe" => "" ); $result = $soapclient->call('doGoogleSearch', $parameters, 'urn:GoogleSearch'); $searchtime = $result['searchTime']; $begin = $start + 1; $end = $start + $parameters["maxResults"]; $total = $result["estimatedTotalResultsCount"]; $searchComments = $result["searchComments"]; $searchTips = $result["searchTips"]; if ($total > 0) { $oldSnippet = ''; $result = $result["resultElements"]; $n = 0; for ($i = 0; $i < $parameters['maxResults'] && $goodOnes < $maxGoodOnes; $i++) { $element = $result[$i]; $snippet = $element['snippet']; $snippet = prepareContent($snippet); $newSnippet = getTextBetween($snippet . '.', $start1, '.'); if ($newSnippet == '') { $newSnippet = getTextBetween($snippet . '.', $start2, '.'); } if ($newSnippet == '') { $newSnippet = getTextBetween( strtolower($snippet . '.'), strtolower($start1), '.'); } if ($newSnippet == '') { $newSnippet = getTextBetween( strtolower($snippet . '.'), strtolower($start2), '.'); } $newSnippet = trim($newSnippet); if ($cutTrash) { if ( !(strpos($newSnippet, '?') === false) ) { $newSnippet = ''; } if ( !(strpos($newSnippet, '(') === false) ) { $newSnippet = ''; } if ( !(strpos($newSnippet, 'http://') === false) ) { $newSnippet = ''; } if ( !(strpos($newSnippet, 'www') === false) ) { $newSnippet = ''; } } if ($newSnippet != '' && $newSnippet != $oldSnippet) { $goodOnes++; $s .= '• ' . $newSnippet . '
'; $oldSnippet = $newSnippet; } } } $s = str_replace('• ," ', '• ', $s); $s = str_replace('• , ', '• ', $s); $s = str_replace('• who ', '• ', $s); $s = str_replace('• \'', '• ', $s); return $s; } function prepareContent($s) { $s = str_replace("", " ", $s); $s = str_replace("", " ", $s); $s = str_replace("& ", "& ", $s); $s = str_replace("
", " ", $s); for ($i = 1; $i <= 5; $i++) { $s = str_replace(" ", " ", $s); } $s = str_replace("'", "'", $s); return $s; } function toAttribute($s) { $s = toXml($s); $s = str_replace('"', '"', $s); return $s; } function toXml($s) { $s = str_replace('&', '&', $s); $s = str_replace('<', '<', $s); $s = str_replace('>', '>', $s); return $s; } function getQueryFromCache($q) { $q = str_replace("'", "''", $q); $sCache = ''; $sSql = "SELECT cachetext FROM family_tree_cache WHERE BINARY query = '$q' LIMIT 1"; $rows = mysql_query($sSql) or die( "SELECT Error: " . mysql_error() ); while ( $columns = mysql_fetch_array($rows) ) { $sCache = $columns['cachetext']; } return $sCache; } function addQueryToCache($q, $sCache) { global $global_count; $q = str_replace("'", "''", $q); $sCache = str_replace("'", "''", $sCache); mysql_query("INSERT INTO family_tree_cache (query, cachetext) VALUES ('$q', '$sCache')"); } ?>