Welcome to Geeklog, Anonymous Tuesday, April 16 2024 @ 04:31 am EDT

Geeklog Forums

creating a new geeklog search function and more????


lovegeeklog

Anonymous
confused
i really like geeklog and ive gotten fairly good with figureing out how to customize it but im wondering how to go about adding a pluggin to it or if maybe one exists allready. Ive got a table of locations around the US and different specs about the locations as well as the zip code and gps location of the location. im wanting to add add a search function where users can type in a zip code and say search for location x with a xx mile radius and get all the locations that occur within that range.Similiar to something like if your looking for something on say mapquest.com or superpages.com. I know how to create the table in sql and how to add my data. Ive got a pretty good idea of how to do the radius range equation mathematically and possibly the select where statements in sql but im green as can be when it comes to php. Is there some sort of pluggin out there that exists for geeklog?I thought maybe i could look at the current search.class file and maybe mutate it but man , i tip my hat to the people who created it. Is there any documentation on the creation of this search function, looking at it and having no php knowledge i think i can see how variables are created and i recognize if then else staments in it but does any one know where i can get a little more info on setting something like this up or where i might find some sample php code for dummies?

or is there a commented version of search.php?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You don't need to understand search.class.php to learn how a search works. Look at one of the plugins, e.g. the staticpages plugin, instead.

A plugin has to implement two functions: One that provides the text for the dropdown on the advanced search page and one that does the actual search. In the staticpages plugin, those are plugin_searchtypes_staticpages and plugin_dopluginsearch_staticpages. The latter looks complex, but it isn't that complicated really - most of the code is to handle the different search types ($keyType).

So I'd say you should try and write a simple Geeklog plugin. There's a nice Beginner's Guide to Geeklog Programming in the wiki that should get you started.

HTH

bye, Dirk
 Quote

All times are EDT. The time is now 04:31 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content