Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1

Thread: Google CSE Help

  1. #1
    New Coder
    Join Date
    Jul 2011
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Google CSE Help

    So I have this search method, it simply uses google to search my website.
    But i'd like to use my Google Custom Search Engine instead.

    Here's my search engine unique id:
    Search engine unique ID: 008729583548452524559:cxs7ncn4fyg

    Here's my search engine code google gave me:
    Code:
    Paste this code in the page where you'd like the search box to appear
    
    Code:
    <!-- Put the following javascript before the closing </head> tag. -->
    <script>
      (function() {
        var cx = '008729583548452524559:cxs7ncn4fyg';
        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 the search box to render -->
    <gcse:searchbox-only></gcse:searchbox-only>
    Paste this code on http://, where you'd like the search results to appear.
    Code:
    <!-- Put the following javascript before the closing </head> tag. -->
    <script>
      (function() {
        var cx = '008729583548452524559:cxs7ncn4fyg';
        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 the search results to render -->
    <gcse:searchresults-only></gcse:searchresults-only>
    Can you guys help me implement it into the code below
    VVVVV

    Code:
    <div class='menusearch'>
    <div style='float:right;padding:12px 8px 0 0;'>
    <form action='http://www.google.com/search' method='get' target='_blank'>
    <input name='sitesearch' style='display:none;' value='http://www.pleasuresmine.net/'/>
    <input id='search-box' name='q' onblur='if(this.value==&apos;&apos;)this.value=this.defaultValue;' onfocus='if(this.value==this.defaultValue)this.value=&apos;&apos;;' style='width:170px;border:none;padding:10px 10px; margin-right:5px; font:italic 12px Georgia;color:#b5b5b5; background:url(http://3.bp.blogspot.com/-q3Q6hWjYZU...earch_form.png) no-repeat;' type='text' value='Find your video...'/><input align='top' id='search-btn' src='http://2.bp.blogspot.com/-BmpnVNvHgs0/T94HNdsyt8I/AAAAAAAAG50/Jn2uw4OJOUk/s1600/search_btn.png' type='image' value='Search'/>
    </form>
    </div>
    </div>
    </div>

    Here's my website if that helps:
    pleasuresmine.net

    If you try searching it searches a google CSE. I want it to search from my engine.
    Thank you! Any help is apreciated.
    Last edited by unify; 08-10-2012 at 12:33 AM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •