Kevin Trethewey

Software Developer, Technologist, Connoisseur of things that go 'bing'.

  • Home
  • Contact
  • Links
  • About

How to add search functionality to your dotnet.org.za blog

Published Friday, January 21, 2005 9:56 AM

Go to the admin section of your blog and paste the following code into the Static News/Announcments section...


<h3>Search</h3>
<input class="BlogSearch" type="text" name="searchBox" id="blogSearchText" value="" onkeypress="return blogSearch(event, this);">
<input type="button" value="Search" onclick="return blogSearch2('blogSearchText');" class="BlogSearchButton">
<script type="text/javascript">
 
function blogSearch(event, oInput) {
 var keyCode = (event) ? event.keyCode : keyStroke.which;
 if (keyCode == 13) {
    top.location = 'http://www.google.co.za/search?q=' + escape(oInput.value) + '+inurl%3Akevint+site%3Adotnet.org.za';
    return false;
 } return true;
}
 
function blogSearch2(oInputId) {
 var oInput = document.getElementById(oInputId);
 top.location = 'http://www.google.co.za/search?q=' + escape(oInput.value) + '+inurl%3Akevint+site%3Adotnet.org.za';
 return false;
}
</script>

<br>
<a href="http://www.google.com">
<IMG SRC="http://www.google.com/logos/Logo_25wht.gif" border="0" ALT="Powered by Google">
</a>


Just replace kevint with your own blog name...

[Tips hat to David Cumps]

[UPDATE: Apparently using this functionality got some bloggers removed from the google index, so use with caution. Personally I don't blog so that google can index me, so i don't mind being the guinea pig - will comment again on this post if i see any issues]


[UPDATE 2: From what i can make out, putting in a google logo as i have done above should placate Google and stop them from messing with you.]

Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it!
by Kevin Trethewey

Comments

# Piers (Farstrider's Place) said on Sunday, January 23, 2005 8:04 AM

Thanks a ton! I battled to get it to work until I realised when I took your blog name out, to put mine in, I was removing the "A" in front as well, like a real klutz. Anyway, thanks again, nice thing to have on the blog.

Stay well
Piers

# Derek said on Tuesday, January 25, 2005 12:30 PM

Thanks! Works like a charm!

# 软件下载 said on Wednesday, October 05, 2005 5:56 PM

Very good
Thank author this article is quite good

Go

Tags

  • .NET
  • Admin
  • ALT.NET
  • Community
  • Dotnet.org.za
  • eBooks
  • Fonts
  • Free Stuff
  • Fun Stuff
  • Google
  • Links
  • Microsoft
  • Personal OffTopic
  • Quotes
  • Red Five Labs
  • Robotics
  • Software Development
  • South Africa
  • SQL
  • Useful Advice
  • Utilities
  • Video
  • Virtual Post-It
  • Vista
  • VSTS Tips
  • WebDev
  • Wiki

Navigation

  • Home
  • Careers
  • Downloads
  • Support

Archives

  • May 2008 (1)
  • October 2007 (1)
  • July 2007 (1)
  • June 2007 (2)
  • May 2007 (1)
  • February 2007 (2)
  • January 2007 (2)
  • December 2006 (3)
  • November 2006 (9)
  • October 2006 (10)
  • September 2006 (3)
  • August 2006 (2)
  • July 2006 (6)
  • June 2006 (7)
  • May 2006 (9)
  • April 2006 (4)
  • March 2006 (14)
  • February 2006 (2)
  • January 2006 (5)
  • December 2005 (5)
  • November 2005 (7)
  • October 2005 (4)
  • September 2005 (10)
  • August 2005 (3)
  • July 2005 (5)
  • June 2005 (8)
  • May 2005 (11)
  • April 2005 (10)
  • March 2005 (7)
  • February 2005 (11)
  • January 2005 (12)
  • December 2004 (5)
  • November 2004 (2)
  • October 2004 (3)
  • September 2004 (10)
  • August 2004 (13)
  • July 2004 (6)
  • June 2004 (7)
  • May 2004 (24)
  • April 2004 (20)
  • March 2004 (21)
  • February 2004 (19)

Syndication

  • RSS
  • Atom
  • Comments RSS
Powered by Community Server (Commercial Edition), by Telligent Systems