Attention: PROnetworks has upgraded our forum from phpbb2 to phpbb3!!

Please head over to our new converted forum at: http://www.pronetworks.org/forums/

This old forum will remain 'read-only' until approximately February 2009. We look forward to seeing you at the new forum!
Author Message
Dalsim
PostPosted: Wed May 12, 2004 2:52 am Reply with quote

PROfessional Member
 
 


Joined: 15 Jun 2003
Posts: 5399
Location: Queensland, Australia
Ok, I am creating a search form for my new site and I kind of know how to use google to do that. But when I use it I get the
Code:
 *Search Text* site:*My Site*
apperaing in the google search box.

I would like to make it so that the "site:*My Site*" does not appear in the search box. Like what John has done through the flash search function on the main PROneT page.
 
Back to top
kanaloa
John C. Derrick
PostPosted: Wed May 12, 2004 7:53 am Reply with quote

President
 
 


Joined: 09 Mar 2002
Posts: 43768
Location: Columbia, SC
Give me some time to think on this one... LOL
 
Back to top
Dalsim
PostPosted: Wed May 12, 2004 9:38 am Reply with quote

PROfessional Member
 
 


Joined: 15 Jun 2003
Posts: 5399
Location: Queensland, Australia
Thanks John.
 
Back to top
kanaloa
John C. Derrick
PostPosted: Wed May 12, 2004 9:59 am Reply with quote

President
 
 


Joined: 09 Mar 2002
Posts: 43768
Location: Columbia, SC
Here's the page I used Jeff...

http://www.google.com/searchcode.html
 
Back to top
Dalsim
PostPosted: Wed May 12, 2004 10:07 am Reply with quote

PROfessional Member
 
 


Joined: 15 Jun 2003
Posts: 5399
Location: Queensland, Australia
Ha ha, yes I have been there. I am trying to intergrate it in with this template www.jeffrey-robinson.com/template/temp.rar I have tried and made a royal screw up.

If you could have a look at it, I would be very gratefull.
 
Back to top
Weaver
PostPosted: Wed May 12, 2004 2:24 pm Reply with quote

PROfessional Member
 
 


Joined: 18 Jun 2002
Posts: 2587
Location: /home/weaver/
dalsim wrote:
Ha ha, yes I have been there. I am trying to intergrate it in with this template www.jeffrey-robinson.com/template/temp.rar I have tried and made a royal screw up.

If you could have a look at it, I would be very gratefull.


You need to make sure you are using the last example that google provides in that link. This one:

Code:

<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<TABLE bgcolor="#FFFFFF"><tr><td>
<A HREF="http://www.google.com/">
<IMG SRC="http://www.google.com/logos/Logo_40wht.gif"
border="0" ALT="Google"></A>
</td>
<td>
<INPUT TYPE=text name=q size=31 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="Google Search">
<font size=-1>
<input type=hidden name=domains value="YOUR DOMAIN NAME"><br><input type=radio name=sitesearch value=""> WWW <input type=radio name=sitesearch value="YOUR DOMAIN NAME" checked> YOUR DOMAIN NAME <br>
</font>
</td></tr></TABLE>
</FORM>
<!-- SiteSearch Google -->


You can tweak the form to your own liking. If you are not very familiar with forms then it may be more difficult for you. I downloaded your template. I'll set it up correctly and then get it back to you.

-Weaver
 
Back to top
Weaver
PostPosted: Wed May 12, 2004 2:58 pm Reply with quote

PROfessional Member
 
 


Joined: 18 Jun 2002
Posts: 2587
Location: /home/weaver/
Alright, I have setup your template so that it uses google to search the domain www.jeffrey-robinson.com . However, if you try to use it you will not get any results, this may be because google has not crawled your site yet. If you change the domain it searches, it works fine. As such, the code is fine even if results are not generated. You can try changing the necessary values (see below) to something like php.net and see it really work.

Here is the necessary code fragment:

Code:
               <form class="form" name="form2" method="get" action="http://www.google.com/search">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td colspan="3" valign="middle" class="bodystyle" height="4"></td>
                  </tr>
                  <tr>
                    <td valign="middle" class="bodystyle">
                      <div align="right">Search Our Site:&nbsp; </div>
                    </td>
                    <td valign="middle">
                      <input name="q" type="text" class="formbox" id="q" size="31" maxlength="255">
                      <!-- *************** CHANGE VALUE HERE *************** -->
                      <input name="domains" type="hidden" value="www.jeffrey-robinson.com">
                      <!-- *************** AND HERE AS WELL *************** -->
                      <input name="sitesearch" type="hidden" value="www.jeffrey-robinson.com">
                    </td>
                    <td valign="middle">
                      <input name="btnG" type="image" src="images/search_03.gif" width="69" height="14" border="0">
                    </td>
                  </tr>
                  <tr>
                    <td colspan="3" height="4"></td>
                  </tr>
                </table>
              </form>


You can change "value" attributes in two of the <input> elements to reflect the domain you want to be searching. Change both of them. For example, php.net . Just so you know, I have modified what google recommends so that users don't have to select a radio button to search the site. It will automatically search the domain listed since what would normally be a radio buttons are now hardcoded.

You can grab the updated temp.rar file here . I won't be keeping it there for more than a day, so grab it right away.

If you have problems, let me know.

-Weaver
 
Back to top
Dalsim
PostPosted: Wed May 12, 2004 10:17 pm Reply with quote

PROfessional Member
 
 


Joined: 15 Jun 2003
Posts: 5399
Location: Queensland, Australia
Thanks Weaver. You can remove it now I have downloaded it.
 
Back to top
shougan
Sid Upadhyay
PostPosted: Thu May 13, 2004 12:10 am Reply with quote

PRO GOLD
 
 


Joined: 26 Apr 2004
Posts: 5290
Location: Western Hemisphere
Cool..thats a smart idea... so u don't have to make ur own programm to search.... Wow..I need to try that.. great code thumbsup
 
Back to top
Weaver
PostPosted: Thu May 13, 2004 12:43 am Reply with quote

PROfessional Member
 
 


Joined: 18 Jun 2002
Posts: 2587
Location: /home/weaver/
shougan wrote:
great code thumbsup


Personally I prefer adhering to strict coding practices, especially when it comes to markup. The markup in Jeff's template is actually not up to my personal specification. I am a major proponent of using CSS, while the template makes use of CSS, it could use more. Getting rid of the formatting type attributes (height width border etc) are key to having very clean portable markup.

Separate content from presentation, that is the entire idea behind CSS. Adhere to "Strict" DTD's like XHTML 1.0 Strict or XHTML 1.1 Strict. Producing clean markup is something not most "web developers" understand.

Even though the template code was harmful to my sensitive eyes, I know Jeff wanted it to work. As such, "just get it to work" took over. I hope you enjoy it Jeff, if you have any additional questions, don't hesitate to ask.

-Weaver
 
Back to top
Back to top
Index >> Webmaster Domain & Code Room >> Oh google spooks. I need you.

Goto page 1, 2  Next

Page 1 of 2

 


Tired of the Ads? Registered users have 80% less adverts.