Hi guys,
I’ll try to explain my self on what I’m trying to accomplish in my Gallery Widget model, and hope that some of you can drop tips and comments about it.
Ok, here it goes… I’m creating a photo gallery widget for a photographers community, right now the gallery widget works as any other gallery: it renders a grid with thumbs and when the user rolls on each thumb a sub-menu slides-in offering some options to display extra information (image attached) –The idea with this gallery is for me to learn more about Content-Box and in the process offer the community a good widget to share.–
First icon: Offers data about the picture taken (aperture,shutter-speed,camera,lens,etc)
Second icon: Pin-point location (Google map) where that picture was taken
Third icon: Share that picture (Facebook, Pinterest, etc)
Fourth icon: View a large version of that picture
Fifth icon: Rate photo counter for that picture
First scenario:
I’m planning to create a custom module to upload these pictures and also populate a custom database table with values for each field. (I don’t see how to do this any other way)
If I do this, I’m not sure the right way how to “bridge” the new database table into my ContentBox widget.
Is this a regular query, or is there some function in ContentBox to inject data from another table (same datasource) into my widget?
Second scenario:
The fifth icon is a counter, every time a user clicks on it will increase its value by 1 (one) this function needs to update the counter field in the database table, and
more important it needs to know the user session to not allow the same user click more than once (never again)
Questions:
I guess the only way to identify each user and not let them click more than once in a particular photo is by asking them to register and log-in if they want to rate pictures, correct?
What is the best approach to update my counter field without saturating the server with multiple update calls generated by many users at the same time? I was thinking to save “counters” in cache and in some point (interceptor) update my table just once per each session, is this a good kind of approach?
How can one evaluate a situation and decide to build either Widget or a Module? (what are the more relevant differences between them)
Thank you all for your patience and help
Felipe Serrano