Cum pot sa pun google custom search pe forum

Pentru întrebări legate de facilităţile forumului phpBB 3.0.x, acest loc este cel mai potrivit.
Reguli forum
Aveti o problema si vreti sa primiti ajutor? Click aici ! Nu uitati si de regulamentul forumului !
Închis
AndroidZone
Utilizator înregistrat
Mesaje: 55
Membru din: 18-Noi-2011, 11:15:44
Versiune: 3.0.10
Ext: Da
Server: UNIX/Linux
Nivel phpBB: Puţin experimentat
Nivel php: Neexperimentat
Contact:

Cum pot sa pun google custom search pe forum

Mesaj de AndroidZone »

Cum pot sa pun google custom search exact cum este aici pe forum?

Forum 3.0.11: Android Zone
Moduri: Automod, gymsitemaps
Tema: prosilver special edition

Am obtinut codul pentru forum:

Cod: Selectaţi tot

<!-- Put the following javascript before the closing </head> tag. -->
<script>
  (function() {
    var cx = '005088283772121899634:vlqmnlcust8';
    var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true;
    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
        '//www.google.com/cse/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s);
  })();
</script>

<!-- Place this tag where you want both of the search box and the search results to render -->
<gcse:search></gcse:search>
Se poate proba aici
Avatar utilizator
bogdan
AdministratorAdministrator
Mesaje: 10888
Membru din: 18-Oct-2002, 13:14:27
Versiune: 3.0.11
Ext: Da
Server: UNIX/Linux
Nivel phpBB: Experimentat
Nivel php: Mediu
Localitate: Bucuresti
Contact:

Re: Cum pot sa pun google custom search pe forum

Mesaj de bogdan »

1. Creezi un fisier in root:

Cod: Selectaţi tot

<?php
    define('IN_PHPBB', true);
    $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);

    // Start session management
    $user->session_begin();
    $auth->acl($user->data);
    $user->setup();
    page_header('Căutare - Google Search');

        $template->set_filenames(array(
            'body' => 'googlesearch.html',
        ));

    make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
    page_footer();
    ?>
2. Adaugi linia in overall_header:

Cod: Selectaţi tot

 <a href="search_google.php" title="Cautare cu Google Search">Google Search</a>
3. Creezi un fisier nou googlesearch.html in directorul template folosind codul furnizat de Google.
AndroidZone
Utilizator înregistrat
Mesaje: 55
Membru din: 18-Noi-2011, 11:15:44
Versiune: 3.0.10
Ext: Da
Server: UNIX/Linux
Nivel phpBB: Puţin experimentat
Nivel php: Neexperimentat
Contact:

Re: Cum pot sa pun google custom search pe forum

Mesaj de AndroidZone »

Multumesc pentru ajutorul acordat!
Închis

Înapoi la “3.0.x Cum pot să...?”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Google [Bot] și 1 vizitator