in2edu_education_resources_ict
education_apple_downloads
$key, 'q' => $sitequery, 'start' => $start, 'maxResults' => 10, 'filter' => false, 'restrict' => '', 'safeSearch' => false, 'lr' => '', 'ie' => '', 'oe' => '' ); // Here's where we actually call Google using SOAP. // doGoogleSearch is the name of the remote procedure call. $ret = $soapclient->call('doGoogleSearch', $params, $soapoptions); $err = $soapclient->getError(); if ($err) { print("
An error occurred!
"); print(" Error: $err
\n"); return false; } return true; } //////////////////////////////////////////////// // Does Google search with retry. // Retry is useful because sometimes the connection will // fail for some reason but will succeed when retried. function search( $q, $type, $key, $start, &$ret ) { $result = false; $max_retries = 5; $retry_count = 0; while( !$result && $retry_count < $max_retries ) { $result = do_search( $q, $type, $key, $start, $ret ); if( !$result ) { print( "Attempt $retry_count failed.
\n"); } $retry_count++; } if( !$result ) { print("
Sorry, connection to Google failed after retrying several times.
\n"); } return $result; } //////////////////////////////////////////////////////////// // Calls the Google API and retrieves the suggested spelling correction // function do_spell( $q, $key, &$spell ) { global $soapclient; global $soapoptions; $params = array( 'key' => $key, 'phrase' => $q, ); $spell = $soapclient->call('doSpellingSuggestion', $params, $soapoptions); $err = $soapclient->getError(); if ($err) { print("
An error occurred!
"); print(" Error: $err
\n"); return false; } return true; } ////////////////////////////////////////////////////////// // The main part of this script if( $q != "" ) { // remove the slashes that are automatically added by PHP before each quotation mark $q = stripslashes($q); if( do_search( $q, $type, $key, $start, $ret ) ) { $count = $ret['estimatedTotalResultsCount']; // total number of results $secs = round($ret['searchTime'],2); // time taken to search (in seconds) $min = $ret['startIndex']; // first record returned $max = $ret['endIndex']; // last record returned if ($max) { // Truncate query for display if (strlen($q) > 36) { $short_q = substr($q,0,33)."..."; } else { $short_q = $q; } // print header with search box and details of search results print "
"; print "\n"; print "\n"; print " results $min - $max of about $count for $short_q "; print " ($secs seconds) 
"; // list results foreach($ret['resultElements'] as $result) { // Make URLs more friendly for user by removing http:// and highlighting where necessary $friendly_URL = $result['URL']; $friendly_URL = str_replace("http://","",$friendly_URL); $friendly_URL = str_replace("$q","$q",$friendly_URL); print "

"; if (!$title = $result['title']) { $title = $result['URL']; print "".$friendly_URL."\n"; } else { print "".$title."
\n"; if ($result['snippet']) { print $result['snippet']."
\n"; } print "$friendly_URL"; } print "

\n\n"; } } else { print "

Sorry, no results were found on this site for $q. "; do_spell($q, $key, $spell); if ($spell[0]) { print "Did you mean ".$spell."? "; } print "Occasionally no results will be returned when there are problems with the link between this site and Google. If you believe the information is on the site but it tells you that it's not, please try again.

"; } } } // Show forward/backward navigation if there are results if ($count) { print "
"; if ($min>1) { if ($min >10) { $prevpage = $min-10; } else { $prevpage = 1; } print " previous page | "; } else { print " previous page | "; } if ($count>$max) { $nextpage = $max+1; print " next page "; } else { print " next page "; } print "
"; } print "
"; print " "; print "
"; ?>
Link to Register http://www.in2edu.com/members/login/signup.php
Dislosure Information http://www.in2edu.com/criteria_copyright.html#personal
(c) Copyright, 2005 in2edu All Rights Reserved. resource_top JavaScript Menu, DHTML Menu Powered By Milonic

 

mac os x apple