Publishing System Settings Logout Login Register
Learn to make a FireFox Search Plugin, and how to install it! Detailed Tutorial!
TutorialCommentsThe AuthorReport Tutorial
Tutorial Avatar
Rating
Add to Favorites
Posted on March 2nd, 2007
7310 views
Firefox
Creating The Search Plugin

This tutorial is going to be based around creating a search plugin for Pixel2Life Forum. Now I have already created this plugin before, Here, but am going to be showing you how to do it!

Step 1
First of all, you need to open up Notepad or another kind of editor that accepts .src file extensions. Now create a new document and name it p2lforum.src

Step 2

Now we have the file created, lets start adding some content that will make up our Firefox Search Plugin.

So now put this text into the file:

<search
version="1.0"
name="Pixel2Life Forum"
description="Search the Pixel2Life.com Forum"



Now the explanation...

means we are obviously starting a new search bar. So this must be placed at the beginning of every Search Plugin you make.

The next 3 lines are pretty self explanatory..

version is the version of the plugin not the version of FireFox. This can be anything number wise, it really doesn't matter what it is. As long as it is numerical.

name is the name of this plugin. For this case, we are searching Pixel2Life Forum so that's what we are going to call it. Again, you can call it anything you want it really doesn't matter.

description is a small description of the plugin. Again very self explanatory. Just type a small description about the plugin. In this case, I have just put Search the Pixel2Life.com Forum because that is basically what it does.

Now we are going to add a bit more content and information into the file.

<search
version="1.0"
name="Pixel2Life Forum"
description="Search the Pixel2Life.com Forum"
method="post"
action="http://www.pixel2life.com/forums/index.php?act=Search&CODE=01"



This time we have added method and action. Again, both are really easy to understand so I will explain quickly...

method is the method of the search engine. Does the search engine use post or get? That's all you enter here.. post or get. Invision Power Board uses post so that's what I have used here.

action is the location of the search form or file. In this case the search form / file is in the same location so we enter the URL. For this plugin I have used This URL because that is the location of the search form.

Now we are about half way through, and it's pretty simple huh. Now we will add 3 more lines.

<search
version="1.0"
name="Pixel2Life Forum"
description="Search the Pixel2Life.com Forum"
method="post"
action="http://www.pixel2life.com/forums/index.php?act=Search&CODE=01"
searchForm="http://pixel2life.com"
queryEncoding='UTF-8'
queryCharset='UTF-8'
>


As you can see, we have added.. searchForm, queryEncoding and queryCharset. These 3 things may sound complicated but there actually real simple.

searchForm I'm not 100% sure about but I always enter the site url in and it always works fine.

queryEncoding is the encoding of the query. The query is what is entered into the search box.

queryCharset is the character set of the query.

As you will see, we have ended the tag with a >. That's the first part done.

Next we make the input boxes, just like if we were doing it in HTML just a little different.
<search
�version="1.0"
�name="Pixel2Life Forum"
�description="Search the Pixel2Life.com Forum"
�method="post"
�action="http://www.pixel2life.com/forums/index.php?act=Search&CODE=01"
�searchForm="http://pixel2life.com"
�queryEncoding='UTF-8'
�queryCharset='UTF-8'
>

<input name="keywords" user >
<input name="forums" value="all">


Now for this plugin I only needed 2 inputs, 1 of which was hidden. The other is where we enter the term to search. The hidden field defines which forums we want to search, as you can see we set that to search them all. If we wanted it to search a certain forum, we would do something like:


In our case, that would search the General Discussion forum on Pixel2Life Forum. However, what if we wanted to search General Discussion and Newbie Introductions? Then we would need to make an array of forums... to do that we do something like:

<search
�version="1.0"
�name="Pixel2Life Forum"
�description="Search the Pixel2Life.com Forum"
�method="post"
�action="http://www.pixel2life.com/forums/index.php?act=Search&CODE=01"
�searchForm="http://pixel2life.com"
�queryEncoding='UTF-8'
�queryCharset='UTF-8'
>

<input name="keywords" user >
<input name="forums" value="1">



By adding [] onto forums in the input name we are creating an array. So every input named forums[] will be included. You need one input for each forum you want to search.

As you can see on the first input, we have the word user at the end. That means it's the input that will show. It will not always be named keywords, with different software or coding it will probably be different.

That's all the inputs you need to make a search plugin for Pixel2Life Forum.

That is basically the plugin created. That is now a working script, but we don't want to finish there... I will now show you something else.. very special...
On the next page...

Next Page
Pages: 1 2 3 4
Dig this tutorial?
Thank the author by sending him a few P2L credits!

Send
Adam

This author is too busy writing tutorials instead of writing a personal profile!
View Full Profile Add as Friend Send PM
Pixel2Life Home Advanced Search Search Tutorial Index Publish Tutorials Community Forums Web Hosting P2L On Facebook P2L On Twitter P2L Feeds Tutorial Index Publish Tutorials Community Forums Web Hosting P2L On Facebook P2L On Twitter P2L Feeds Pixel2life Homepage Submit a Tutorial Publish a Tutorial Join our Forums P2L Marketplace Advertise on P2L P2L Website Hosting Help and FAQ Topsites Link Exchange P2L RSS Feeds P2L Sitemap Contact Us Privacy Statement Legal P2L Facebook Fanpage Follow us on Twitter P2L Studios Portal P2L Website Hosting Back to Top