Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
Multiple DB tables with custom module
musiccreatures



Joined: 20 Jun 2009
Posts: 344
Location: Portland Oregon

Posted: 09/28/09 22:53 
I am writting a Classified Ads module. Currently I am using a Database table for Classified Ads as well as a database table for Classified Ad Categories. I am working on the custom ranking modes, and am running into an issue with the query. I need to be able to return a list of Classified Ad Categories(for navigation) as well as a list of Classified Ads within the Classified Ads Category.

Would it be best to modify the module to use 2 form controllers and 2 ranking scripts? IE: jrClassifiedAds.php form controller and jrClassifiedCategories.php form controller and then write 2 scripts within the ranking directory, jrClassifiedAds.php and jrClassifiedCategories.php?

or would it be best to use the _search_areas function for just the ads and then use a variable like $task to place a switch within the _query function, that tells jamroom whether to build a query for the ads or the categories?

Any advice would be greatly appreciated.

Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 09/29/09 11:01 
I would just use one form controller and one ranking script. Instead of doing it as a search_area, set up your script to accept a "category" parameter.

Kyle


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 09/29/09 11:13 
Check out order "6" to the song mode - it does basically what you are looking to do. The secret is that in a specific order (say 6 for song), there is additional "group by" clause int he SQL query that collapses the results down to one entry per group by column.

Hope this helps!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
musiccreatures



Joined: 20 Jun 2009
Posts: 344
Location: Portland Oregon

Posted: 09/29/09 19:24 
Thanks for the help guys. bigguy, that is exactly what I was looking for. Thanks again. Hope to have this finished and in testing by this weekend. So far, its pretty robust in features.

Back to top
dorou



Joined: 29 Aug 2006
Posts: 139

Posted: 09/30/09 18:49 
Are you planning on making this available for other Jamroom owners (for free or sale)? I would be interested....I was working on defining what I wanted but haven't started coding anything yet.

Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.