Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
Adding image support to my module.
musiccreatures



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

Posted: 11/11/09 23:17 
I would like to allow users to upload an image to their classified Ads. I am having trouble understanding the developers docs with regards to images. From what I gather, the modules image script should contain functions for retrieving the images information. I have a few questions:

Which mode makes the most sense for allowing a user to uploading an image for a classified ad?

When adding a jmInput box(type file) to the post classified ads form, for image upload, where does the image get upload to?

Once uploaded, should I store the image information in the classified ad table? And if so, how would I use the core image script to resize the uploaded image? And how would I retrieve the image size, height, width, extension?

Any help or advice would be great,

Back to top
Brian
Jamroom Team


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

Posted: 11/15/09 09:19 
Make sure and check out this page in the Module Developer Guide:

http://www.jamroom.net/Jamroom_Modules_Module_Images

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: 11/15/09 10:48 
The module developer documents dont answer any of my questions.

Back to top
Brian
Jamroom Team


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

Posted: 11/15/09 11:18 
The docs do cover each of your questions:


musiccreatures:
I would like to allow users to upload an image to their classified Ads. I am having trouble understanding the developers docs with regards to images. From what I gather, the modules image script should contain functions for retrieving the images information. I have a few questions:

Which mode makes the most sense for allowing a user to uploading an image for a classified ad?


This is up to you - the docs can't answer "why" you would want to do something - only "how".


Quote:

When adding a jmInput box(type file) to the post classified ads form, for image upload, where does the image get upload to?


It does not matter - you just want to use the proper functions (FYI it is stored in the profile's media directory - you cannot access it directly).


Quote:

Once uploaded, should I store the image information in the classified ad table? And if so, how would I use the core image script to resize the uploaded image? And how would I retrieve the image size, height, width, extension?


Both of these are covered:

- store the image info in your table
- the image.php will handle resizing - it works just the same as all Jamroom images.

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: 11/18/09 00:03 
Thanks for the help bigguy. Its making more sense to me now. One thing I am confused about.
When naming the functions in a custom modules image.php script, would the "mode" be an actual mode in the core jamroom image.php script like:

Code
function mcClassifiedAds_photo_image($_args)


or would it be something like:

Code
function mcClassifiedAds_getAdImage($_args)


Thanks again for all your help.

-Tim

Back to top
Brian
Jamroom Team


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

Posted: 11/18/09 11:39 
It would be:


Code

function mcClassifiedAds_getAdImage($_args)


and then when calling it via the image.php script it would be:

Code

image.php?mode=mcClassifiedAds_getAdImage


Hope this helps!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
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.