List most recent uploads

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

By studio-a - November 28, 2008 - edited: November 29, 2008

Hello All,

If I understand this correctly, this code will allow us to display the 5 most recent uploads among any (all) of the records in the section (table).

I have implemented the code and I am able to pull up the five most recent entries images, however, each link for the five seperate images points towards the FIRST Instance detail page and only displays the First Instance text within the hyper link. As Perch originally suggested, the idea is to include the record text field title (not the image Info01) and link both the thumbnail and text to the individual record detail page for each 5 recent entries.

IN ADDITION, I have a field which is a List that I am using as a category option per record. Is it possible to refine my filtering within the Listing Page Query to 'tableName = "MyGallery" && fieldName = "MyImage"' … then with ONE MORE STEP to select which dropdown listing option I want to only display?

I have been reading your thread, unfortunately I am not this advanced as a php programmer. Can one of you (or anyone else reading) *attach* a full php file (with comments written within the code to help me better understand the details, please [:)] ) to assist us non advanced php programmers to better understand how to implement this functionality into our CMSB pages? It may be too much to ask, but this thread is the only one I have located within the forum that deals with Recent Entries.

I look forward to your reply! Thanks.

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

By studio-a - December 1, 2008

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