A Digital Age Deserves A Digital Leader

Oh google spooks. I need you.

Oh google spooks. I need you.

Postby Dalsim » Wed May 12, 2004 6:52 am

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: Select all
 *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.
"Life is merely a fraction of a second. An infinitely small amount of time to fulfill our desires, our dreams, our passions." Paul Gauguin (1848 - 1904)
AEST
PROfessional Member
Posts: 1119
Joined: Sun Jun 15, 2003 7:07 am
Location: Queensland, Australia

Postby kanaloa » Wed May 12, 2004 11:53 am

Give me some time to think on this one... LOL
"Greatness is not a function of circumstance. Greatness, it turns out, is largely a matter of conscious choice, and discipline." - Jim Collins
President
User avatar
Posts: 11795
Joined: Sun Mar 10, 2002 1:18 am
Location: HI & SC
Real Name: John Derrick

Postby Dalsim » Wed May 12, 2004 1:38 pm

Thanks John.
"Life is merely a fraction of a second. An infinitely small amount of time to fulfill our desires, our dreams, our passions." Paul Gauguin (1848 - 1904)
AEST
PROfessional Member
Posts: 1119
Joined: Sun Jun 15, 2003 7:07 am
Location: Queensland, Australia

Postby kanaloa » Wed May 12, 2004 1:59 pm

Here's the page I used Jeff...

http://www.google.com/searchcode.html
"Greatness is not a function of circumstance. Greatness, it turns out, is largely a matter of conscious choice, and discipline." - Jim Collins
President
User avatar
Posts: 11795
Joined: Sun Mar 10, 2002 1:18 am
Location: HI & SC
Real Name: John Derrick

Postby Dalsim » Wed May 12, 2004 2:07 pm

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.
"Life is merely a fraction of a second. An infinitely small amount of time to fulfill our desires, our dreams, our passions." Paul Gauguin (1848 - 1904)
AEST
PROfessional Member
Posts: 1119
Joined: Sun Jun 15, 2003 7:07 am
Location: Queensland, Australia

Postby Weaver » Wed May 12, 2004 6:24 pm

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: Select all
<!-- 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
Public Keys

The primary purpose of the DATA statement is to give names to constants; instead of referring to pi as 3.141592653589793 at every appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant. This also simplifies modifying the program, should the value of pi change.
-- FORTRAN manual for Xerox Computers
PROfessional Member
User avatar
Posts: 1967
Joined: Wed Jun 19, 2002 12:05 am
Location: /home/weaver/

Postby Weaver » Wed May 12, 2004 6:58 pm

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: Select all
               <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
Public Keys

The primary purpose of the DATA statement is to give names to constants; instead of referring to pi as 3.141592653589793 at every appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant. This also simplifies modifying the program, should the value of pi change.
-- FORTRAN manual for Xerox Computers
PROfessional Member
User avatar
Posts: 1967
Joined: Wed Jun 19, 2002 12:05 am
Location: /home/weaver/

Postby Dalsim » Thu May 13, 2004 2:17 am

Thanks Weaver. You can remove it now I have downloaded it.
"Life is merely a fraction of a second. An infinitely small amount of time to fulfill our desires, our dreams, our passions." Paul Gauguin (1848 - 1904)
AEST
PROfessional Member
Posts: 1119
Joined: Sun Jun 15, 2003 7:07 am
Location: Queensland, Australia

Postby shougan » Thu May 13, 2004 4:10 am

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 ^*^
Do you want the latest news on Betas & Software, Security, or even Vista? Check out our <a href="http://www.pro-networks.org/forum/home_index.php" target="_blank" class="postlink">news areas</a> and be sure to <a href="http://www.pro-networks.org/main/newsletters.htm" target="_blank" class="postlink">subscribe to our PROneT newsletters!</a>
PRO Level 15
Posts: 1174
Joined: Tue Apr 27, 2004 2:12 am
Location: Western Hemisphere

Postby Weaver » Thu May 13, 2004 4:43 am

shougan wrote:great code ^*^


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
Public Keys

The primary purpose of the DATA statement is to give names to constants; instead of referring to pi as 3.141592653589793 at every appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant. This also simplifies modifying the program, should the value of pi change.
-- FORTRAN manual for Xerox Computers
PROfessional Member
User avatar
Posts: 1967
Joined: Wed Jun 19, 2002 12:05 am
Location: /home/weaver/

Next

Return to HTML, CSS, and Scripts

Who is online

Users browsing this forum: No registered users and 6 guests

cron
cron