Module & Block GOOGLE

Begonnen von algebre, 22 April 2007, 14:44:48

⏪ vorheriges - nächstes ⏩

0 Mitglieder und 2 Gäste betrachten dieses Thema.

algebre

Hi
if you like show results of google search into your web-site(pragmamx) Ich ordnete one block and one module

I: block (block-google.php) put it in block folder

<?php
/**
 * pragmaMx  Content Management System
 * Copyright (c) 2005 pragmaMx Dev Team - http://pragmaMx.org
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * $Source: /home/www/dps3311/home/cvsroot/pragmamx/html/blocks/block-google.php,v $
 * $Revision: ?.?.?.? $
 * $Author: tora60 $
 * $Date: 2007/04/22 08:52:01 $
 * 
 */
if (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");

?>

<!-- SiteSearch Google -->
<center>
<form method="get" action="http://www.your.domane/google.html" target="_top">
<center>
<table border="0">
<tr><td nowrap="nowrap" valign="top" align="left" height="32">

<br/>
<input type="hidden" name="domains" value="your.domane"></input>
<label for="sbi" style="display: none">Entrez les termes que vous recherchez.</label>
<input type="text" name="q" size="17" maxlength="255" value="" id="sbi"></input>
</td></tr>
<tr>
<td nowrap="nowrap">
<table>
<tr>
<td>
<input type="radio" name="sitesearch" value="" checked id="ss0"></input>
<label for="ss0" title="Rechercher sur le Web"><font size="-1" color="#000000">Web</font></label>

<input type="radio" name="sitesearch" value="your-domane" id="ss1"></input>
<label for="ss1" title="Rechercher your.domaine"><font size="-1" color="#000000">saharama</font></label></td>
</tr>
</table>
<label for="sbb" style="display: none">Envoyer un formulaire de recherche</label>
<input type="submit" name="sa" value="Recherche Google" id="sbb"></input>
<input type="hidden" name="client" value="pub-1111111111111111"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:11"></input>
<input type="hidden" name="hl" value="fr"></input>
</td></tr></table>
</form></center>
<!-- SiteSearch Google -->



explanation :

http://www.your.domane/google.html (replace with yor domane)

Rechercher your.domaine (replace ex such your-domain)


pub-1111111111111111 ( your google adsense ID)

GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;L.....
this  line is for customise display ex BGC:FFFFFF = backcolor-white

<input type="hidden" name="hl" value="fr"></input> (you can replace fr by de)



II Module
(/modules/google/index.php)

<?php
/**
 * pragmaMx  Content Management System
 * Copyright (c) 2005 pragmaMx Dev Team - http://pragmaMx.org
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * $Source: /home/www/dps3311/home/cvsroot/pragmamx/html/modules/google/index.php,v $
 * $Revision: ?.? $
 * $Author: tora60 $
 * $Date: 2007/04/22 21:33:09 $
 */

if (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");
$module_name basename(dirname(__FILE__));
# mxGetLangfile($module_name);
$index 0;// right block is hedden
include_once("header.php");


OpenTable();
?>

<body>
<!-- SiteSearch Google -->
<center>
<form method="get" action="http://www.your-domaine.de/google.html" target="_top">
<center>
<table border="0">
<tr><td nowrap="nowrap" valign="top" align="left" height="32">

<br/>
<input type="hidden" name="domains" value="domaine.de"></input>
<label for="sbi" style="display: none">Entrez les termes que vous recherchez.</label>
<input type="text" name="q" size="32" maxlength="255" value="" id="sbi"></input>
</td></tr>
<tr>
<td nowrap="nowrap">
<table>
<tr>
<td>
<input type="radio" name="sitesearch" value="" checked id="ss0"></input>
<label for="ss0" title="Rechercher sur le Web"><font size="-1" color="#000000">Web</font></label>

<input type="radio" name="sitesearch" value="domaine.de" id="ss1"></input>
<label for="ss1" title="Rechercher your domaine"><font size="-1" color="#000000">your domaine</font></label></td>
</tr>
</table>
<label for="sbb" style="display: none">Envoyer un formulaire de recherche</label>
<input type="submit" name="sa" value="Recherche Google" id="sbb"></input>
<input type="hidden" name="client" value="pub-1111111111111111"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:11"></input>
<input type="hidden" name="hl" value="fr"></input>
</td></tr></table>
</form></center>
<!-- SiteSearch Google -->

<!-- Google Search Result Snippet Begins -->
<div id="googleSearchUnitIframe"></div>

<script type="text/javascript">
   var googleSearchIframeName = 'googleSearchUnitIframe';
   var googleSearchFrameWidth = 700;
   var googleSearchFrameHigh = 600;
   var googleSearchFrameborder = 0 ;
   var googleSearchDomain = 'www.google.fr';
</script>
<script type="text/javascript"
         src="http://www.google.com/afsonline/show_afs_search.js">
</script>
<!-- Google Search Result Snippet Ends -->

</body>
<?php
CloseTable
();

include_once(
"footer.php");


III search module (/modules/search/index.php)

find this line: (633)
<a href=\"http://www.google.com/search?q=" . urlencode($query) . "\" target=\"new\">Google</a>"

replace with:
. "<li> <a href=\"http://www.your-domaine.de/google.html?domains=saharama.net&q=" . urlencode($query) . "&sitesearch=&sa=Recherche+Google&client=pub-1111111111111111&forid=1&ie=ISO-8859-1&oe=ISO-8859-1&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23336699%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3A336699%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BFORID%3A11&hl=fr\" target=\"new\">Google TEST</a>"

you can test it here: http://saharama.net/fr/ (in french)

NB: mod-rewirite must be activeted.

If someone can translate in German that him face so that everybody benefits there




algebre

Sorry , I made an error :red:
The last line of the code (in modules/search/index.php)

. <li> <a href=\"http://www.your-domaine.de/google.html?domains=your-domaine.de&q=" . urlencode($query) . "&sitesearch=&sa=Recherche+Google&client=pub-1111111111111111&forid=1&ie=ISO-8859-1&oe=ISO-8859-1&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23336699%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3A336699%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BFORID%3A11&hl=fr\" target=\"new\">Google</a>

Baldyman

THX algebre ... nice feature  :thumbup:

algebre

@Baldyman
hi
can you translate it in german?

algebre

Hi
new version
NOW you have rewrite or not , you have adsense acount or not, that's work
if you don't have a google adsense yet, you can put $client_id="0" into file (modules/module_name/config.php)
it's work also in local mode (wamp or xampp...)
you can download this version from PragmaMx france forum
HERE