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