Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Feb 2010
    Location
    New Zealand
    Posts
    76
    Thanks
    7
    Thanked 10 Times in 9 Posts

    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!

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    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.

  • #3
    New Coder
    Join Date
    Feb 2010
    Location
    New Zealand
    Posts
    76
    Thanks
    7
    Thanked 10 Times in 9 Posts
    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?

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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!||||

  • #5
    New Coder
    Join Date
    Feb 2010
    Location
    New Zealand
    Posts
    76
    Thanks
    7
    Thanked 10 Times in 9 Posts
    doh, true! They are planning to add that support, but in the future.
    I guess I don't have much options for now?

  • #6
    New Coder
    Join Date
    Feb 2010
    Location
    New Zealand
    Posts
    76
    Thanks
    7
    Thanked 10 Times in 9 Posts
    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.

  • #7
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    4
    Thanks
    0
    Thanked 2 Times in 2 Posts
    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.

  • Users who have thanked WebspoonUK for this post:

    Azzaboi (03-17-2010)

  • #8
    New Coder
    Join Date
    Feb 2010
    Location
    New Zealand
    Posts
    76
    Thanks
    7
    Thanked 10 Times in 9 Posts
    Thanks, sounds like a good way of searching, just need Weebly to add SQL functionality first or move off free hosting/domain.

  • #9
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •