Reply
Site Search Script
Old 08-25-2002, 02:49 PM Site Search Script
punaboy

Posts: n/a
My "hobby" site is now getting a lot of attention. (alohavalley.com) To improve navigation I want to have a "Search" feature for visitors to find listings faster.

A total redesign is in the works, but for now I'm just looking for a search script.

Any suggestions where I can find a good (cgi based) site search script?

Thanks!
Reply With Quote
 
When You Register, These Ads Go Away!
Old 08-25-2002, 03:25 PM
ghettocars's Avatar
Defies a Status

Posts: 1,736
Name: Josh
Location: Miami, FL
i made this script for my site never used it though. Give it a try.

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
var item = new Array();


// "Page Name","path","Page Title","Many,Key,Words","Descriptive Comments"

c=0; item[c]=new Array("www/homer.html","http://ghettocars.tripod.com/","GhettoCars-Home","content,main,start,home,front,beginning,beg in","GhettoCars home page where you can find all the links to our entire site.");
c++; item[c]=new Array("www/about.html","http://ghettocars.tripod.com/","About Me","about,author,contact,email,who","Contact details and general information about the creator of the site and what the site is about.");
c++; item[c]=new Array("www/links.html","http://ghettocars.tripod.com/","All the Links","pictures,pic,picture,pics,content,website, links,search","Links to my entire site. Here you can either view all 6 galleries or view the import's galleries or you can click on a dedicated gallery which you will find pictures of that one brand.");
c++; item[c]=new Array("www/vote.htm","http://ghettocars.tripod.com/","Vote","vote,contact,email,who,about,poll,ca r of the month","Here you can vote for the next car of the month or you can write to us about our site.");
c++; item[c]=new Array("register.html","http://ghettocars.tripod.com/","Register","register,login,username,password,sec ret,reg,pass,user,admin","Register now to be able to login to get more advantages.");
c++; item[c]=new Array("www/carofdamonth.html","http://ghettocars.tripod.com/","Car of the Month","car of the month,month,car,ghettocars,monthly,pictures,pics,p ic,picture","This Month's Car of the Month.");
c++; item[c]=new Array("index.html","http://ghettocars.tripod.com/","GhettoCars","ghettocars,index,begin,home,conten t,main,start,principal,first","The first page of GhettoCars, here you can login or register.");
c++; item[c]=new Array("www/news.html","http://ghettocars.tripod.com/","-NEWS-","news,info,information,updates,update,new,recent ,details,happening,lately","Check out What is happening lately @ GhettoCars.");
c++; item[c]=new Array("down.html","http://ghettocars.tripod.com/","Downloads","downloads,download,down,upload,game s,game,free crap","Download games or crap for your desktop or these mouse skins which are a waste of time but look pretty when you move the mouse really really fast around the screen.");
c++; item[c]=new Array("www/galleryuno.html","http://ghettocars.tripod.com/","gallery,picture,first,one,start,pictures,pic,pi cs","Check out this amazing Gallery of nice pictures.");
c++; item[c]=new Array("www/gallerydos.html","http://ghettocars.tripod.com/","gallery,picture,second,two,pictures,pic,pics"," Check out this amazing Gallery of nice pictures.");
c++; item[c]=new Array("www/gallerytres.html","http://ghettocars.tripod.com/","gallery,picture,third,three,pictures,pic,pics", "Check out this amazing Gallery of nice pictures.");
c++; item[c]=new Array("www/galleryquatro.html","http://ghettocars.tripod.com/","gallery,picture,fourth,four,pictures,pic,pics", "Check out this amazing Gallery of nice pictures.");
c++; item[c]=new Array("www/gallerycinco.html","http://ghettocars.tripod.com/","gallery,picture,fifth,five,pictures,pic,pics"," Check out this amazing Gallery of nice pictures.");
c++; item[c]=new Array("www/galleryseis.html","http://ghettocars.tripod.com/","gallery,picture,sixth,six,pictures,pic,pics","C heck out this amazing Gallery of nice pictures.");
c++; item[c]=new Array("www/importsuno.html","http://ghettocars.tripod.com/","gallery,picture,import,imports,hooked up,high performance,nos,imported,ghettocars,ghettocar,pict ures,pic,pics","If you like hooked up cars then you must view this.");
c++; item[c]=new Array("www/importsdos.html","http://ghettocars.tripod.com/","gallery,picture,import,imports,hooked up,high performance,nos,imported,ghettocars,ghettocar,pict ures,pic,pics","If you like hooked up cars then you must view this.");
c++; item[c]=new Array("www/importstres.html","http://ghettocars.tripod.com/","gallery,picture,import,imports,hooked up,high performance,nos,imported,ghettocars,ghettocar,pict ures,pic,pics","If you like hooked up cars then you must view this.");
c++; item[c]=new Array("www/importsquatro.html","http://ghettocars.tripod.com/","gallery,picture,import,imports,hooked up,high performance,nos,imported,ghettocars,ghettocar,pict ures,pic,pics","If you like hooked up cars then you must view this.");
c++; item[c]=new Array("www/importscinco.html","http://ghettocars.tripod.com/","gallery,picture,import,imports,hooked up,high performance,nos,imported,ghettocars,ghettocar,pict ures,pic,pics","If you like hooked up cars then you must view this.");
page="<html><head><title>Search Results</title></head><body bgcolor='white'><center><table border=0 cellspacing=10 width=80%>";


function search(frm) {
win = window.open("","","scrollbars");
win.document.write(page);
txt = frm.srchval.value.split(" ");
fnd = new Array(); total=0;
for (i = 0; i < item.length; i++) {
fnd[i] = 0; order = new Array(0, 4, 2, 3);
for (j = 0; j < order.length; j++)
for (k = 0; k < txt.length; k++)
if (item[i][order[j]].toLowerCase().indexOf(txt[k]) > -1 && txt[k] != "")
fnd[i] += (j+1);
}
for (i = 0; i < fnd.length; i++) {
n = 0; w = -1;
for (j = 0;j < fnd.length; j++)
if (fnd[j] > n) { n = fnd[j]; w = j; };
if (w > -1) total += show(w, win, n);
fnd[w] = 0;
}
win.document.write("</table><br>Total found: "+total+"<br></body></html>");
win.document.close();
}
function show(which,wind,num) {
link = item[which][1] + item[which][0];
line = "<tr><td><a href='"+link+"'>"+item[which][2]+"</a> Score: "+num+"<br>";
line += item[which][4] + "<br>"+link+"</td></tr>";
wind.document.write(line);
return 1;
}
// End -->
</script>
</HEAD>

<BODY>

<center>

<form method=get action="javascript:void(0)" onsubmit="search(this); return false;">
<tr><td><input type=text name=srchval value=""><input type=submit value="Search"></td></tr>
</form>

</center>
__________________
www.goatslacker.com
ghettocars is offline
Reply With Quote
View Public Profile
 
Old 08-25-2002, 03:27 PM
ghettocars's Avatar
Defies a Status

Posts: 1,736
Name: Josh
Location: Miami, FL
i think it would be better if this topic were posted in the coding scripts forum because it concerns it.
__________________
www.goatslacker.com
ghettocars is offline
Reply With Quote
View Public Profile
 
Old 08-25-2002, 03:47 PM
david's Avatar
King Spam Talker

Posts: 1,314
Location: Glasgow, UK
PHPSiteSearch seems to work quite well (http://php.warpedweb.net/). You could also try http://www.freefind.com and http://www.atomz.com (although I don't think they are free any more).
__________________
Free Webmaster Help - Everything a webmaster needs - for free
Free-Webhosting.info - Free web hosts reviewed and rated
Web Hosting Hunt - Impartial hosting directory - Add your host today for FREE
david is offline
Reply With Quote
View Public Profile Visit david's homepage!
 
Old 08-25-2002, 03:47 PM
punaboy

Posts: n/a
ghettocars,

Good point on moving it to the appropriate subject. I'll see If I can get it moved.

Thanks for the script, I try it and see if it's what I'm looking for.
Reply With Quote
 
Old 08-25-2002, 04:03 PM
punaboy

Posts: n/a
Mods, please close or delete this thread as I have reposted in the correct forum area. Sorry, Thanks!
Reply With Quote
 
Old 08-25-2002, 04:33 PM
punaboy

Posts: n/a
sorry ghettocars, I need a cgi script.
Reply With Quote
 
Old 08-25-2002, 05:42 PM
dk01's Avatar
Ultra Talker

Posts: 373
Location: Ames, IA
http://www.hotscripts.com/Detailed/13554.html

That's one i found on hotscripts. No idea how well it works.
-dk
__________________
Did I help you? If so, be nice and throw me some TP
dk01 is offline
Reply With Quote
View Public Profile Visit dk01's homepage!
 
Old 08-25-2002, 08:57 PM
DaveMo~'s Avatar
Administrator
Defies A Status

Posts: 10,209
Name: Dave
Location: Scott Depot, West Virginia, USA
Quote:
Originally posted by punaboy
Mods, please close or delete this thread as I have reposted in the correct forum area. Sorry, Thanks!
No problem punaboy.

How about moved and merged so everyone can benefit from it? Here it is!

Dave
DaveMo~ is offline
Reply With Quote
View Public Profile Visit DaveMo~'s homepage!
 
Old 09-01-2002, 02:54 AM
Novice Talker

Posts: 7
I have used search.cgi and like it. It runs on a flat file database. Takes a little time to create the database, but runs smoothly thereafter and updates easily. It has boolean search capability and support for meta tags.
You can get it free, here: http://apbsystems.com/
babbsela is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Site Search Script
 

Thread Tools

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

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




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.18942 seconds with 12 queries