PDA

View Full Version : Mini Mods - Search your forum Firefox 2/IE7


delaen1
12-01-2006, 10:00 PM
PART 1:

Create a file and name it ff_search.xml. Insert this code in to it:


<?xml version="1.0"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>devpals.com</ShortName>
<Description>devpals, ask a question</Description>
<Image height="16" width="16" type="image/x-icon">http://www.devpals.com/favicon.ico</Image>
<Url type="text/html" method="get" template="http://www.devpals.com/search.php?do=process&amp;query={searchTerms}" />
</OpenSearchDescription>


The following changes need to be made to customize it to your site

<ShortName>[your board name]</ShortName>



<Image height="16" width="16" type="image/x-icon">http://[your forum url]/favicon.ico</Image>



<Url type="text/html" method="get" template="http://[your forum url]/search.php?do=process&query={searchTerms}"/>



Any "special" characters that are in your forum name or description are going to have to be replaced.

Upload the file to your forum root.




PART 2:

Open up your headinclude and paste this in the last line (placing your URL where appropriate)


<link rel="search" type="application/opensearchdescription+xml" href="http://[your forum url]/ff_search.xml" title="[your forum title]" />





That's it. Now when you go to your forum with Firefox 2 (and I hear it works on IE7, though I haven't downloaded that yet) the little Google "G" in the search box should be glowing. If you click the down-arrow, there will be a new section that says "Add 'your forum'".

Select it and now you can search your forums directly from that box. This assumes you have no guest/captcha restrictions on searching. If not, it's only going to work for members.

You can see an example at http://www.devpals.com if you have Firefox 2 installed.

transitbus
12-02-2006, 01:07 AM
Got it to work... had to edit the xml properly

The code example you have is incorrect as well.

It should look more like this:

<?xml version="1.0" ?>
- <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>devpals.com</ShortName>
<Description>devpals, ask a question</Description>
<Image height="16" width="16" type="image/x-icon">http://www.devpals.com/favicon.ico</Image>
<Url type="text/html" method="get" template="http://www.devpals.com/search.php?do=process&query={searchTerms}" />
</OpenSearchDescription>


Make sure if you edit this that you do so in wordpad and not notepad. Attached is devpal's xml file. Make sure to edit it as shown in the example.

FireFish
12-02-2006, 02:02 AM
I don't know what I'm missing; every time I try; in FF or IE, it says cannot download http://mysite.com/ff_search.xml


any ideas?

delaen1
12-02-2006, 02:09 AM
Got it to work... had to edit the xml properly

The code example you have is incorrect as well.

It should look more like this:




Make sure if you edit this that you do so in wordpad and not notepad. Attached is devpal's xml file. Make sure to edit it as shown in the example.

Oh, you're right, good catch. I copied and pasted from Firefox's XML parser. I forgot it stripped some stuff. I edited the first post to reflect that.

Thanks. :)

delaen1
12-02-2006, 02:10 AM
I don't know what I'm missing; every time I try; in FF or IE, it says cannot download http://mysite.com/ff_search.xml


any ideas?

See the post above you. The original example I posted was a little screwy.

FireFish
12-02-2006, 02:46 AM
See the post above you. The original example I posted was a little screwy.

I know & I edited my xml; still no go.

delaen1
12-02-2006, 03:04 AM
I know & I edited my xml; still no go.

Hmm. Is is live somewhere? I can check it out if you like.

FireFish
12-02-2006, 03:37 AM
Hmm. Is is live somewhere? I can check it out if you like.
Sure. I appreciate your help.

I PM'd you.

transitbus
12-02-2006, 04:09 AM
Copy my xml attached file to your desktop, open it in wordpad, change the site to yours and save it (do not save as just save).

Make sure to add the second bit to styles and templates > Style Manager > Common templates > headinclude.

Stick it at the very bottom. Make sure to change the info to your site's information.

1) do not edit in notepad
2) do not save as in wordpad
3) make sure to put the xml file to your site's root directory
4) make sure to change all the site information to your site

FireFish
12-02-2006, 04:18 AM
Copy my xml attached file to your desktop, open it in wordpad, change the site to yours and save it (do not save as just save).

Make sure to add the second bit to styles and templates > Style Manager > Common templates > headinclude.

Stick it at the very bottom. Make sure to change the info to your site's information.

1) do not edit in notepad
2) do not save as in wordpad
3) make sure to put the xml file to your site's root directory
4) make sure to change all the site information to your siteYeh, I edited in Dreamweaver; no luck :-(

Pady
12-02-2006, 06:18 AM
similar thing here - i edited using editplus and get a similar error

Ramsesx
12-02-2006, 09:15 AM
Same here, get the error file not found.

Darat
12-02-2006, 09:36 AM
Same problem here - everything looks as if it is working apart from in FF I get a can't download the .xml file and in IE 7 a can't get information error.

basilrath
12-02-2006, 12:56 PM
have to say sack ie7

its bollox

delaen1
12-02-2006, 01:11 PM
Sure. I appreciate your help.

I PM'd you.

Everything LOOKS right in the one that you PM'd to me.

Try changing the second line to:
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">

(with no dash at the beginning there)



Also, in the description, you're going to have to get rid of the "&" character.

soulface
12-02-2006, 01:41 PM
Everything LOOKS right in the one that you PM'd to me.

Try changing the second line to:
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">

(with no dash at the beginning there)



Also, in the description, you're going to have to get rid of the "&" character.

YES! this solution is working!

* soulface clicked Install!

desertfoxmb
12-02-2006, 10:02 PM
Hello,

I've got an issue getting this to work. Everything works except: In the url for the search engine in the xml file the & causes errors. If I change it to a semi-colon or some other character, it works fine except that the query string is then malformed for the search and nothing happens.

Here is my xml file contents:

<?xml version="1.0" ?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>WeServ.net</ShortName>
<Description>Search WeServ.Net - A Community of Agape</Description>
<Image height="16" width="16" type="image/x-icon">http://www.weserv.net/favicon.ico</Image>
<Url type="text/html" method="get" template="http://www.weserv.net/forums/search.php?do=process&query={searchTerms}" />
</OpenSearchDescription>

Like this I get an xml validation error. If I change do=process&query= to do=process;query= I get no xml validation error, but the search doesn't work.

Any thoughts?

Thanks!

delaen1
12-02-2006, 11:11 PM
Yes.

I should have copied and pasted from my file directly instead of trying to do it from FF or IE. :)


<?xml version="1.0"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>devpals.com</ShortName>
<Description>devpals, ask a question</Description>
<Image height="16" width="16" type="image/x-icon">http://www.devpals.com/favicon.ico</Image>
<Url type="text/html" method="get" template="http://www.devpals.com/search.php?do=process&amp;query={searchTerms}" />
</OpenSearchDescription>


Replace the & with &amp;

Phaedrus
12-02-2006, 11:20 PM
Finally got it to work! And yes it does work with IE 7... But when I click on "Mark as Installed" it does nothing..

desertfoxmb
12-03-2006, 12:06 AM
Yes.

I should have copied and pasted from my file directly instead of trying to do it from FF or IE. :)


<?xml version="1.0"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>devpals.com</ShortName>
<Description>devpals, ask a question</Description>
<Image height="16" width="16" type="image/x-icon">http://www.devpals.com/favicon.ico</Image>
<Url type="text/html" method="get" template="http://www.devpals.com/search.php?do=process&amp;query={searchTerms}" />
</OpenSearchDescription>


Replace the & with &amp;

Perfect! :) Installed.

FireFish
12-03-2006, 05:26 AM
Okay, I got it working after a few modifications; I edited the XML to:
1) Use a different icon (smaller)
2) removed '&' from description tag as I also thought it would be a problem.

Personally, I think #1 was the issue with it not working; I'm now using a 16x16 jpg icon vs. an ico file (I know ICO's work, but JPGs seemed to work for my case)

All said & done, it is a nice little hack.

I had a similar one written only for firefox & had my own installer for it to drop it into FireFox's searchplugin folder.

This works nicer, mainly b/c the biggest problem with the other FireFox addon mod out there is that it will NOT retain your login even if your browser has it remembered.

If you have hidden forums, this suck b/c the old hack wouldn't search them since you weren't considered logged in, even if it is set to remember your password.

However, I do not have that problem with this one which makes me happy.

With all of these code modifications, I wanted to show my version of the XML which is now working for me after modifying it many times. Here's the final working version:

<?xml version="1.0"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Microwize User Forum</ShortName>
<Description>Anything Medisoft Lytec and Medinotes</Description>
<Image height="16" width="16" type="image/x-icon">http://www.microwize.org/forum/icons/MicrowizeUserForum.jpg</Image>
<Url type="text/html" method="get" template="http://www.microwize.org/forum/search.php?do=process&amp;query={searchTerms}" />
</OpenSearchDescription>

Ramsesx
12-10-2006, 06:28 AM
I tried everything, even changed my ico to 16x16 but don't get it working. :(

FireFish
12-10-2006, 05:27 PM
I tried everything, even changed my ico to 16x16 but don't get it working. :(Here's what I did; I removed the icon code line:
<Image height="16" width="16" type="image/x-icon">http://www.microwize.org/forum/icons/MicrowizeUserForum.jpg</Image>
& saw if it worked fine, which it finally did. Then, I tried it with the developer's icon (who wrote this mod) & it worked fine.

Then I tried it with the JPG I have above & finally, it worked fine WITH the icon.


Try it in steps to determine the problem.