TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 19, 2024, 04:33:05 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 266
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 219
  • Total: 219

Firefox Search Extension

Started by Lord Anubis, March 24, 2007, 04:16:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lord Anubis

Tired of having to ask your members to use the search?  Using this they can always search your forum from Firefox, this will install a search for your forum within Firefox :up:

A live demo can be seen here on the left column under services.

1.  You need to create a source file, telling Firefox how to search your forum.

<search
     version="7.1"
     name="Yoursite Search"
     description="Search Forum"
     action="http://yoursite.com/index.php"
     target="_blank"
     method="GET"
     update="http://yoursite.com/forumsearch.src"
     updateCheckDays="5"
>

<input name="action=search2;search=" user>

<BROWSER
     update="http://yoursite.com/forumsearch.src"
     updateIcon="http://yoursite.com/forumsearch.png"
     updateCheckDays="5"
>


To create this file for your forum, copy the code above and save it to a text file named forumsearch.src. Replace http://yoursite.com with the url of your forum.

2. Find or Create a .png image that is 16X16 to appear on the search area on Firefox.
  Here's a basic image to use
Save this image as forumsearch.png and upload this image and the forumsearch.src to the root directory of your forum.

3. Now you need to create a javascript file

function addEngine(name,ext,cat){
     if ((typeof window.sidebar == "object")
          && (typeof  window.sidebar.addSearchEngine == "function"))
     {
          window.sidebar.addSearchEngine("http://yoursite.com/" + name + ".src",
          "http://yoursite.com/" + name + "." + ext, name, cat );
     } else {
          //you could put an error handler here;
     }
}


Of course change http://yoursite.com to the url of your forum
Save this file as forumsearch.js and upload this to the root of your forum

Finally, where Tinyportal comes into play  ;)

Create a scriptbox and add this
<center><script language=JavaScript src="/forumsearch.js"></script>
<a href="javascript:addEngine('forumsearch', 'png', 'Yoursite Search')">
Install Firefox Search Extension</a></center>


You can dress this up a bit and add an image with this code

<center><script language=JavaScript src="/forumsearch.js"></script>
<a href="javascript:addEngine('forumsearch', 'png', 'Yoursite Search')"><img src = http://yoursite.com/Firefox.gif></img><br>
Install Firefox Search Extension</a></center>