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"
<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"
<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">
|