Members: 16,996
Threads: 38,845
Posts: 159,389
Online: 19

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse

Go Back   Mambers.com > Development > Development Announcements

Reply
 
LinkBack Thread Tools Display Modes
Old 25.10.2004, 16:52   #1 (permalink)
Expert Mamber
 
idigital's Avatar
 
Join Date: Apr 2004
Location: Blenheim, Queensland, Australia
Posts: 283
idigital is on a distinguished road
Send a message via ICQ to idigital Send a message via MSN to idigital
Talking How to create a Firefox search plugin for your Mambo site! :)

Had a wee bit of spare time today, and came across a great article on making your own search plugins for firefox. As this is something that would be great on the site I'm working on, and goes hand in hand with the Mambo Spread Firefox project, I thought I'd give it a go.

It's a breeze with the Web Developer extension for Firefox, as it shows you exactly what a search form needs to work, and converts POSTs to GETs. Read the article for more info on that, and I'd recommend it for any web dev.

Anyway, I thought I'd share what I found so other Mambers can make search plugins for their own Mambo sites. So here we go:

Firstly, 1.0.9 sites and 4.5.1 sites have different search engines, so I'll show you the basic code for both. Note that I am putting the code in the php code tags here, but it is not php code. Just easier on the eyes

Ok, so first put in your comment:

PHP Code:
# Your Search 
Then the main search code:

PHP Code:
<search 
name
="Your Search"
method="GET"
action="http://www.yoursite.com/index.php"

The essential line here is the action attribute. Change that to the full URL of your mambo site.

Then come the form fields:

PHP Code:
<input name="option" value="search"
<
input name="searchword" user>
<
input name="submit" value="search"
These will be the same for all 1.0.9 sites using the standard core search component.

That's it! It's too easy, but it works a charm.

For 4.5.1 sites, the search component is slightly different. So use this for the form fields:

PHP Code:
<input name="searchword" user
<
input name="submit" value="search">
<
input name="option" value="com_search"
Save that under the name you want your plugin to have, and make sure it is a .src file.

To go with the .src, create a 16x16 icon to go with it under the same name, save it as a jpg. This is optional, but it looks good

Now the best way to install this lil plugin you have created, is through a javascript on your Mambo site.

Here's the javascript code to put in the head section of your template:

PHP Code:
<script language="javascript"> 
function addEngine(name,ext,cat)
{
if ((typeof window.sidebar == "object") && (typeof
window.sidebar.addSearchEngine == "function"))
{
window.sidebar.addSearchEngine(
"<?php echo $mosConfig_live_site?>/"+name+".src",
"<?php echo $mosConfig_live_site?>/"+name+"."+ext,
name,
cat );
}
else
{
alert("Netscape 6 or Mozilla is needed to install a search plugin");
}
}
</script>
You don't need to touch that, I've added the $mosConfig_live_site variable to make things easier.

Now call it from your template with a link like this:

PHP Code:
<a href="javascript:addEngine('yourplugin','jpg','Your Search')">Your Search Plugin!</a
Make sure the plugin .src and .jpg files are in the root directory of your Mambo site, again the .jpg is not compulsory.

That's all! Phew!

Mambo Spread Firefox will be releasing some premade plugins for the major Mambo community sites in the next few days and we're happy to add any that the community come up with as well. Stay tuned. 8)

Cheers,

Damian
idigital is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 10.04.2005, 21:56   #2 (permalink)
Baby Mamber
 
Join Date: Apr 2005
Posts: 1
Kelric is on a distinguished road
Default Re: How to create a Firefox search plugin for your Mambo site! :)

I've am not using a mambo site, but i did create the .src file, what code do I use for my site?
Kelric is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mambo School Web Site Suggestions. Gumbi Mambo 4.5.1 General Talk 11 08.01.2006 09:05
Mambo in Firefox zloh Mambo 4.5.1 General Talk 12 13.10.2004 06:00
Get my mambo site on the search engines? xft Mambo 4.5 'How Do I' Questions 2 03.08.2004 20:06


All times are GMT +2. The time now is 09:09.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.