List most recent uploads

14 posts by 5 authors in: Forums > CMS Builder
Last Post: December 1, 2008   (RSS)

Re: [studio-a] List most recent uploads

By Dave - December 1, 2008

Hi studio-a,

Can you attach your viewer code your using now?

>'tableName = "MyGallery" && fieldName = "MyImage"'

This might look like this:
'where' => ' tableName = "MyGallery" AND fieldName = "MyImage" ',

>then with ONE MORE STEP to select which dropdown listing option I want to only display?

I'm not sure what you mean here? You can add another "AND fieldname = 'value' to the above where if needed.

There's some limitations to this method of loading uploads. Namely you don't have access to the record data that the upload came from. You can get the recordNum for your links like this: $upload['recordNum']. But to load the record you need to add the code for that and load each one separately.

There are a few neat things you can do with this method but some things are a lot harder. I hope some of the information I provided helps!
Dave Edis - Senior Developer
interactivetools.com
Hi Dave,

Attached is my sample PHP file for this Recent upload testing.

Regarding the ONE MORE STEP, I meant can we drill down one more level within our search. I understand I have the Table Name, then the Image Field Name, but can we also reduce the searching to one more Field Name (We have a field used as a List to categorize records - See attached Screen Shot.). From your last feedback it sound likes we can, but I am not sure how to include that third Field within our search.

Thanks for your help.

Re: [studio-a] List most recent uploads

By Dave - December 1, 2008

You can't drill down anymore when you are directly accessing the uploads table. But the way you have coded this you're limiting it to the 'dressgallery03' table.

You'd be better off just to load all the records from the 'dressgallery03' table. Then you could filter on other fields by adding something like this on the end of the viewer url:

yourViewer.php?dress_category=wedding

There's more details on built in search features here:
http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html

It might be simpler to just create a new viewer that displays all the records from the dressgallery03 table and just work with that code.

Is it important to show the 5 most most recent uploads? Or the first upload from the 5 latest records?
Dave Edis - Senior Developer
interactivetools.com