Autor Tema: Problemas con mi google  (Leído 4513 veces)

Desconectado boLaS

  • PHPerit@
  • *
  • Mensajes: 2
  • Karma: 0
    • Ver Perfil
Problemas con mi google
« en: 07 de Diciembre de 2007, 08:45:58 am »
Bueno, pues tengo unos codiGos que es paRa hacerte tu pRopio gooGle


peRo no se como se haCe paRa que se pueda

aLguien me ayudaría?

Aqui los codes


Foter :


</p>
<p align="center">Copyright 2006 by EnDLeSs-4uM.CoM™ - All rights reserved.
Legal Docs™ Attached</p>
</body>
</html>


Header :



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Endless Search [ Powered By EnDLeSs-4uM.CoM ]</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>

<body>
<div align="center">
  <p>
    <script language="javascript">
function checkform (form) {
  if (form["query"].value == "") {
    alert("Please insert keyword(s) to search for");
    form["query"].focus();
    return false ; }
 return true; }
    </script>
  </p>
  <p>&nbsp;</p>
  <p><img src="images/logo.jpg"><br>
      </p>
</div>
<form name="googleFrm" method="get" action="search.php" onsubmit="return checkform(this);">
  <div align="center">
   <span class="white_bold_small"><p align="center"><b>Web</b><font size="-1">&nbsp;&nbsp;&nbsp;&nbsp;</font><a href="http://forum.endless-4um.com/index.php"><span style="text-decoration: none">Community</span></a><font size="-1">&nbsp;&nbsp;&nbsp;&nbsp;</font><a href="http://topsites.endless-4um.com/"><span style="text-decoration: none">Top Sites</span></a><font size="-1">&nbsp;&nbsp;&nbsp;&nbsp;</font><a href="http://theatre.endless-4um.com/"><span style="text-decoration: none">Theatre</span></a><br>
  </span>
    <input name="query" onfocus="this.value='';" type="text" id="query" size="60" value="Start searching here, then press Enter"> <br>
    &nbsp;<input name="www" type="hidden" id="www" value="true"><input type="submit" value="Endless Search"></p></div>
</form>



Index :

<html credits and footer  ||| PLEASE DO NOT REMOVE COPYRIGHTS, Thanks ||| www.Endless-4um.com>
<?php include("header.php");?>


<div align="center">


<?php include("footer.php");?>



Search :

<?

// insert your google key here, if you don't have one http://www.google.com/apis/ (it's free)
$yourGoogleKey = "RYffrqdQFHLkxmjMQv196fMU37pfKKde";

// insert your website url here 
$yourWebsite = "http://www.search.Endless-4um.com/";             


//----------------------------------------------------------------------------------------------
// build search query and connect to google
//----------------------------------------------------------------------------------------------

require_once("nusoap.php");

if($_GET) { extract($_GET, EXTR_PREFIX_SAME, "get_"); }
if($_POST) { extract($_POST, EXTR_PREFIX_SAME, "post_"); }

if ($yourGoogleKey == "insert your Google key here") {
  echo "You didn't insert a Google Key Yet ! Get one at www.google.com/apis/ ..";
  break;
}

if ($query && $www) {

  $q = urldecode($query);
  if ($www != "true") { $q.= " site:$yourWebsite"; }
  if(!$start) { $start=0; } else { $start = intval($start); }

  $parameters = array(
    "key"         => $yourGoogleKey,   // google developer key
    "q"           => $q,               // search query
    "start"       => $start,           // result start index
    "maxResults"  => 10,               // 10 is the maximum
    "filter"      => false,            // filtering similar entries
    "restrict"    => "",               // country and topic restrictions
    "safeSearch"  => false,            // adult content filter
    "lr"          => "",               // language restrictions
    "ie"          => "",               // deprecated and ignored parameter
    "oe"          => ""                // deprecated and ignored parameter
  );

  $soapclient = new soapclient("http://api.google.com/search/beta2");
  $result = $soapclient->call("doGoogleSearch", $parameters, "urn:GoogleSearch");
  $begin = $start + 1;
  $end = $start + $parameters["maxResults"];
  $total = $result["estimatedTotalResultsCount"];
}

//----------------------------------------------------------------------------------------------
// html headers, stylesheet and search form
//----------------------------------------------------------------------------------------------

?>

<?php include("header_search.php");?>


<?

//----------------------------------------------------------------------------------------------
// display results table if a search has been done
//----------------------------------------------------------------------------------------------

if ($query && $www) {

  echo "<table width=\"609\" cellspacing=\"0\" cellpadding=\"10\" border=\"0\">\n";
  echo "<tr class=\"row\"><td width=\"90%\" class=\"row\"></td></tr>\n";
 

  if ($total == 0){
     echo "<tr><td class=\"alert\">Your search returned no results ..</td></tr>\n";
  }
 
  if ($total > 0) {
    $result = $result["resultElements"];
    for ($i = 0; $i < $parameters["maxResults"]; $i++) {
      $element = $result[$i];
      $url = $element["URL"];
      $title = $element["title"];
      $snippet = $element["snippet"];
      if ($url != "") {
      
         echo "<tr>\n";
      
      echo "<td><span class='list'>".($i+$begin).".</span> <a href='$url' class='link'>$title</a><br><span class='gray_small'>$snippet</span><br><a href='$url' class='link_small'>$url</a></td></tr>\n";
      }
   }
  }
       

  echo "<tr><td><br>";
  if($begin > 1) { echo "<a href=\"google.php?query=$query&www=$www&start=".($start - 10)."\">previous 10 results</a> | "; }
  echo "showing $begin to $end of $total results";

  if ($end < $total) { echo " | <a href=\"search.php?query=$query&www=$www&start=".($start + 10)."\">next 10 results</a>"; }
  echo "</td></tr>\n";
 
  echo "</table>";
}

//----------------------------------------------------------------------------------------------
// html credits and footer  ||| PLEASE DO NOT REMOVE COPYRIGHTS, Thanks ||| www.Endless-4um.com
//----------------------------------------------------------------------------------------------

?><?php include("footer_search.php");?>



Footer_search :



</td>
<td background="images/blu_line.gif" width="10"></td>
    <td width="200" valign="top"><div align="center">Sponsored Links</div><br>
   
<script type="text/javascript"><!--
google_ad_client = "pub-1348335941961536";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "FFFFFF";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
   
   </td>
  </tr>
</table>
<p>&nbsp;</p>
      <table width="100%"  border="0" cellspacing="0" cellpadding="10" id="table1">
        <tr>
          <td bgcolor="#e5ecf9">
         <p align="center">
            <td align="center" bgcolor="#e5ecf9"><form name="googleFrm" method="get" action="search.php" onsubmit="return checkform(this);">
      <table width="100%"  border="0" cellspacing="0" cellpadding="10">
        <tr>
          <td>
         <p align="center">
         <img border="0" src="/images/logo_small.gif"> <input name="query" type="text" id="query" value="<?php echo $_GET['query'];?>" size="40">
              <input type="submit" value="Search Again">
              <input name="www" type="hidden" id="www" value="true">
              </td>
        </tr>
      </table>
</body>
</table>
<p align="center">Copyright 2006 by EnDLeSs-4uM.CoM™ - All rights reserved.
Legal Docs™ Attached</p>

</html>



Header_search


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Endless Search [ Powered By EnDLeSs-4uM.CoM ]</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>

<body>
<script language="javascript">
function checkform (form) {
  if (form["query"].value == "") {
    alert("Please insert keyword(s) to search for");
    form["query"].focus();
    return false ; }
 return true; }
</script>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="250"><a href="<?php echo $www.habboneox.com/index.php;?>"><img src="images/logo_sm.jpg" border="0"></a></td>
    <td><form name="googleFrm" method="get" action="search.php" onsubmit="return checkform(this);">
      <table width="100%"  border="0" cellspacing="0" cellpadding="10">
        <tr>
          <td><span class="white_bold_small"><b>Web</b><font size="-1">&nbsp;&nbsp;&nbsp;&nbsp;</font><a href="http://forum.endless-4um.com/index.php"><span style="text-decoration: none;">Community</span></a><font size="-1">&nbsp;&nbsp;&nbsp;&nbsp;</font><a href="http://topsites.endless-4um.com/"><span style="text-decoration: none;">Top
         Sites</span></a><font size="-1">&nbsp;&nbsp;&nbsp;&nbsp;</font><a href="http://theatre.endless-4um.com/"><span style="text-decoration: none;">Theatre</span></a></span><br>
            <input name="query" type="text" id="query" value="<?php echo $_GET['query'];?>" size="40">
              <input type="submit" value="Search Again">
              <input name="www" type="hidden" id="www" value="true">
              </td>
        </tr>
      </table>
    </form></td>
  </tr>
</table>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="1" colspan="4" class="td_search_color"></td>
  </tr>
  <tr class="td_search_color">
    <td width="10" bgcolor="#e5ecf9">&nbsp;</td>
    <td height="25" bgcolor="#e5ecf9"><strong>Search Results</strong></td>
    <td height="25" bgcolor="#e5ecf9"><div align="right">Results <?php echo $begin;?>
      - <?php echo $end;?> of about <?php echo $total;?> results</i> for <i><?php echo $query;?></i></div></td>
    <td width="10" bgcolor="#e5ecf9">&nbsp;</td>
  </tr>
</table><br>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>



Nusoap


Este es muy largo y no lo ponGo

Pues eso que me ayudeis a ponerlo en mi web =)



Comunidad PHPeros

Problemas con mi google
« en: 07 de Diciembre de 2007, 08:45:58 am »

Desconectado kekoman

  • PHPero Master
  • ******
  • Mensajes: 1.180
  • Karma: 45
  • Sexo: Masculino
  • Mi nuevo usuario es marco811
    • Ver Perfil
Re: Problemas con mi google
« Respuesta #1 en: 07 de Diciembre de 2007, 11:45:46 am »
hacer tu propio google? En que sentido?  ::) ::)


Este usuario ya no lo uso, mi nuevo usuario es marco811

Conectado naveda

  • Administrador General
  • PHPero Master
  • *****
  • Mensajes: 2.282
  • Karma: 165
  • Sexo: Masculino
    • Ver Perfil
    • naveda.me
Re: Problemas con mi google
« Respuesta #2 en: 07 de Diciembre de 2007, 23:46:16 pm »
Entre mis primeras modificaciones entrarian:

// insert your google key here, if you don&#39;t have one http://www.google.com/apis/ (it&#39;s free)
$yourGoogleKey "RYffrqdQFHLkxmjMQv196fMU37pfKKde";

// insert your website url here  
$yourWebsite "http://www.search.Endless-4um.com/";              


Tienes que conseguir una Clave que google proporciona a los desarrolladores y para conseguirla debes acceder a la pagina que se indica en el primer comentario, y despues debes introducir la URL de tu web ;)
Por favor, leete las Normas