[thelist] PHP help needed

Brent Eades beades at almonte.com
Fri Jul 27 18:00:55 CDT 2007


This likely falls into the "please do my homework for me" category, but
at this point my head is getting bruised from banging it on my desk.

Point one: I'm no PHP wizard. I can take existing scripts, (usually)
figure out the logic, then create a script that does what I need.

So, please view this script:

http://almonte.com/addon/addon.txt

This is an 'addon' (extension) for a real estate package (OpenRealty)
I'm setting up for my wife. I wrote this extension, with a little help
from some friends. It works fine, but I'm sure it can be made more
efficient.

Its purpose is to add the number of listings for a given class of
property ('home', farm', etc) to the main navigation. But as you'll see
if you look at the above code, I've had to write a separate function for
each property class.

I'm sure there's a way to write a single function to which I would pass
variables, which would in turn execute the appropriate SQL query
depending on which property class was being called.

I guess this all sounds kind of vague and cryptic. But if some PHP guru
would care to look at the above script and offer suggestions, I'd be
most grateful.

-- 
Brent Eades	
Almonte, Ontario
http://almonte.com




More information about the thelist mailing list