Add Your Search To Internet Explorer and FireFox
March 19th, 2007 at 10:01 PM by Matt FreedmanYou’ve probably seen them, and maybe even used them, that handy little Search Box in the top-right of your browser. But, have you ever wondered how you can add your own Search there, and offer adding it to your visitors? Well, I’m going to show you how.
First of all, this is important, both Internet Explorer 7 (this won’t work in previous versions of Internet Explorer, since they didn’t have inline search) and FireFox use the Search Engine Provider standard, OpenSearch1.1. Because they use the same standard, you can use the same code in both Browsers to add a search provider. So, onto the details.
Okay, lets start with some background. XML is used to specify everything to do with your Search, so it’s fairly easy to implement. No Programming Language and Complicated Scripts here, folks, just straight XML.
First of all, if you want all the juicy details on all the possible “elements” available to use, go here.
Okay, here’s what we need to start with:
<?xml version="1.0" encoding="UTF-8"?> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
The first line just tells the browser that you’ll be using XML encoded using UTF-8. The second line tells the browser what specification you’re using, and where to look for it.
Now, you need to start adding some details. First, you’ll need to specify the name:
<ShortName>Search Engine Name</ShortName>
That’ll be the name that shows up in the textbox in the corner of the browser when your Search is selected from the dropdown box. You can also add a <LongName>
tag, but it’s not necessary, and I haven’t seen it used in Browsers yet. Now, for a description:
<Description>Search Engine Description</Description>
Not much to say about that, it’s simply the description of your Search.
Now, for Icons. Icons aren’t used in IE7, but they are, sometimes, used in FF. So, the code:
<Image type="image/x-icon" width="16" height="16">http://www.example.com/favicon.ico</Image> <Image type="image/png" width="64" height="64">http://www.example.com/favicon64.png</Image>
It’s best to include Icons of 2 sizes and formats, 16×16, 64×64 and .ico and .png. Note the full URL. You will need to include your full domain, you can’t just do /imagename.ext (since the browser won’t know where to look for the image).
Now, for the most important part, the URL.
<Url template="http://www.example.com/?s={searchTerms}" type="text/html" />
First, you’ll need to make a search (of any string) and then copy the URL and replace the string you searched for with {searchTerms}
. Most likely, you’ll use text/html
in type
.
Now, to end the file, add this to the bottom of it:
</OpenSearchDescription>
All that code together would look like this:
<?xml version="1.0" encoding="UTF-8"?> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> <ShortName>Search Engine Name</ShortName> <Description>Search Engine Description</Description> <Image type="image/x-icon" width="16" height="16">http://www.example.com/favicon.ico</Image> <Image type="image/png" width="64" height="64">http://www.example.com/favicon64.png</Image> <Url template="http://www.example.com/?s={searchTerms}" type="text/html" /> </OpenSearchDescription>
Now, the only left to do is to save the file and link to it.
You’ll want to save it as something.xml. I’m going to recommend addsearch.xml. Then, of course, you’ll want to upload that to your website.
Now, you’ll probably want to allow people to install this into their browsers ( π ). So, all you need to basically do is add an onclick=""
to a link:
<a href="#" onclick="window.external.AddSearchProvider('http://www.example.com/addsearch.xml');" title="Add Search Engine Name to Your Browser">Add Search Engine Name To Your Browser</a>
Now, you may want Visitors browsers to discover your Search Engine automatically. You can add this to the <head>
of your page:
<link rel="search" type="application/opensearchdescription+xml" href="http://www.example.com/path/to/addsearch.xml" title="Search Engine Name" />
And that will have your visitors browser show either this:
Or this:
I’ve added a Search Engine for this blog. Check it out.
Get it? Got it? Good.
Blog Layout Issues Fixed
March 11th, 2007 at 2:32 PM by Matt FreedmanI’ve finally fixed most of the layout issues on this Blog’s Theme. Most of them were me forgetting to change some div’s when I made this layout into a WP Theme and Navigation/Footer problems with Firefox. But, I’ve gone through and fixed most of them. A couple of minor issues still exist (such as if the Content is smaller, in height, then the Navigation Bar, and a small line of the Navigational Bar background colour at the bottom of the Content showing up), but the major issues have been fixed.
Daylight Savings Time, Change Your Clocks
March 10th, 2007 at 11:55 PM by Matt FreedmanIf you live in Canada or the US, don’t forget to change your clocks an hour ahead. The change officially takes place March 11 at 2:00 AM, but, that’s a tad early to be changing you clocks around, so change them now, or something. π
Also, if you’re wondering about your computer time, make sure to update your OS. If you’re running Vista, you should already have the update, if you’re running XP, an Automatic Update was sent out, but just to make sure, you can check to see if you need to update here (and download the update if you need to):
http://www.microsoft.com/dst2007
As for your Cell Phones, just hope your provider updated their servers, then restart your phone, and it should grab the new time. You should check with your host to make sure their servers are updated (well, you’ll find out tomorrow, anyways π ).
Urgent: WordPress 2.1.2 Released. Upgrade Now!
March 2nd, 2007 at 9:03 PM by Matt Freedmanhttp://wordpress.org/development/2007/03/upgrade-212/
WordPress 2.1.2 has been released due to a security exploit found in the download for 2.1.1. Someone hacked into a WordPress.org server, and modified a few files in the WP 2.1.1 download and added some malicious PHP code to them. So, if you’re running 2.1.1, upgrade immediately, your Site/Blog might be at risk!
I’ve upgraded, now you should! π
Statistics
March 1st, 2007 at 5:32 PM by Matt FreedmanI’ve decided to add a new page to this Blog. It’s called Statistics, and, you guessed it,Β it displays some different Statistics for this Blog. I’ll update it soon after a month has ended, with the Final Stats for that month. Right now, it only shows Unique Hits, Hits and Average Hits Per Day (and totals for those). But, I’m thinking about adding more.