Go Back   CodingForums.com > :: Client side development > General web building

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-12-2010, 07:26 PM   PM User | #1
Azzaboi
New Coder

 
Join Date: Feb 2010
Location: New Zealand
Posts: 76
Thanks: 7
Thanked 10 Times in 9 Posts
Azzaboi is an unknown quantity at this point
Question Adding a search feature

Adding a search feature

Hi, I'm developing an arcade games site: Aaron's Game Zone

This site has a number of online flash games already and lots more to come. Will be added daily.

I would like to create some type of search feature for the site to make finding the game you want easiler.

I was thinking of a search box, users could type keywords and pick from a list, but might go with a basic dropdown list for now with just the title and url links of each game?

I was wondering what would be involved and the best (or easy) way to go around this.

Say if someone wants to find:

'Straw Hat Samurai' it would take them here:
http://azzaboi.weebly.com/strawhatsamurai.html

'Werebox' would take them here:
http://azzaboi.weebly.com/werebox.html

'Paper Warfare' would take them here:
http://azzaboi.weebly.com/paperwarfare.html

As you can see the link structures aren't the best and I might not be able to change them easily because I am using weebly.

But each game has a category:

Action / Platform
Adventure / Role Playing
Puzzle / Board & Card
Shooting Games
Beat Em Up Games
Strategy / Skill Games
Sports & Racing
Arcade & Classics
LifeStyle Games
Kids Games

If this would be useful for the search or do I need to add tags for each game?

Any help, tips, or code would be appreciated!
Azzaboi is offline   Reply With Quote
Old 03-12-2010, 11:02 PM   PM User | #2
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,045
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
So I'm guessing you hard-coded every HTML page, and you don't use a MySQL database?
If so, that's too bad. I don't even know if you are allowed to use server-side scripting,
like PHP with Weebly.
mlseim is offline   Reply With Quote
Old 03-14-2010, 04:09 AM   PM User | #3
Azzaboi
New Coder

 
Join Date: Feb 2010
Location: New Zealand
Posts: 76
Thanks: 7
Thanked 10 Times in 9 Posts
Azzaboi is an unknown quantity at this point
Unfortunately PHP and SQL are not features of Weebly yet
Else I would of probably gone with a custom action script?

Everything is hand coded, yes. So I guess I should just go with a basic dropdown list that gets read from a txt file or something with title and url?
Azzaboi is offline   Reply With Quote
Old 03-14-2010, 06:50 PM   PM User | #4
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
But if you can't use php how do you expect to read from the text file? No client side language can do this on a website unless its an intranet. I guess you could have a flash drop down but then that can get messy.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 03-14-2010, 08:42 PM   PM User | #5
Azzaboi
New Coder

 
Join Date: Feb 2010
Location: New Zealand
Posts: 76
Thanks: 7
Thanked 10 Times in 9 Posts
Azzaboi is an unknown quantity at this point
doh, true! They are planning to add that support, but in the future.
I guess I don't have much options for now?
Azzaboi is offline   Reply With Quote
Old 03-15-2010, 09:16 AM   PM User | #6
Azzaboi
New Coder

 
Join Date: Feb 2010
Location: New Zealand
Posts: 76
Thanks: 7
Thanked 10 Times in 9 Posts
Azzaboi is an unknown quantity at this point
My site is already happily indexed by google, not a problem.
Developing the search using a custom google search maybe an option, but a rough one?
I think I need to have access to PHP or SQL to do anything decent, which I don't have at the moment.
Azzaboi is offline   Reply With Quote
Old 03-17-2010, 07:03 PM   PM User | #7
WebspoonUK
New to the CF scene

 
Join Date: Mar 2010
Posts: 4
Thanks: 0
Thanked 2 Times in 2 Posts
WebspoonUK is an unknown quantity at this point
I would suggest using a database - it's the best way to categorise and tag each game you want to search on.

The best way to do this would be to add Title, Description, Summary and Category fields to your DB table and then create SQL to search though the text in every field for each word that was search upon.

You could even add a relevancy score to your SQL and order by this result descending so that the more instances of a particualr word that were found in the DB fields, the higher the relevancy (allowing the most likely game they were looking for to be returned first).

E.g.

You have two games: -
1). TITLE: Straw Hats Samurai, DESCRIPTION: A fighting game involving Samurais
2). TITLE: Last Samurai, DESCRIPTION: Last Sumarai game

The user searches for "Samurai fighting"

The keyword appears in BOTH the Title and the Description field for game 1, but only twice in Title and Description for game 2, therefore, your SQL would return game 1 first and then game 2. Coupled with the fact that both search words appear in Title and Description for game 1 whereas only 1 of the search keywords appears in the DB fields for game 2.

I hope that explanation was clear? This is the best way to implement search functionality to any site as it returns the most relevant result first which is more likely to be what they were searching for in the first place.
WebspoonUK is offline   Reply With Quote
Users who have thanked WebspoonUK for this post:
Azzaboi (03-17-2010)
Old 03-17-2010, 07:38 PM   PM User | #8
Azzaboi
New Coder

 
Join Date: Feb 2010
Location: New Zealand
Posts: 76
Thanks: 7
Thanked 10 Times in 9 Posts
Azzaboi is an unknown quantity at this point
Thanks, sounds like a good way of searching, just need Weebly to add SQL functionality first or move off free hosting/domain.
Azzaboi is offline   Reply With Quote
Old 03-18-2010, 12:35 AM   PM User | #9
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
You could try using google search for your "search". It won't search everything but as you said its already indexed then google should return some decent results.

http://www.google.com/cse/
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 12:04 AM.


Advertisement
Log in to turn off these ads.