How to select all images to display image feed

For some reason my account was deleted without any sort of reason why and therefore my first post was deleted as well....

Anyways,
I'm working on doing a complete rewrite to the Flickrish theme and one feature I'm trying to figure out how to implement is how to replicate the photo feed like on Flickr, where all uploads (regardless of what gallery they're in) will show up on the index page in the order they're added.

The should also be paginated so only "x" number of photos are displayed at a time. The Flickrish theme has a Recent Uploads feature on the index page, but it's limited to only the last 16 pictures and it's not paginated.
I was looking through the code and I don't see a built-in function that will get all of the photos that way.
printLatestImages() doesn't accept 'all' for the parameter and I do not want to have to modify core code to test for this value and exclude the LIMIT syntax from the SQL statement.

So anyone have any suggestions?

Comments

  • Your account and post was deleted because they appeared to be SPAM. As explained in our forum rules, we are very intollerant of SPAM as it just detracts from our time.

    In your case, the site you placed in your profile is not Zenphoto related and can easily be presumed to be promotional. In addition, the question(s) you ask are easily answered by some research, so appear to be ginned up to appear legitmate, but do have no thought applied.

    If I am mistaken, I appologize.

    If you really are a serious developer you will have already read our themeing tutorial and discussion of the object model Zenphoto uses. You should then realize that you do not need to hack original code, just clone it into your own plugin that does just what you want.
  • Sorry for the mis-understanding. If a robot generates content as well-structured as what I wrote, then that's some advanced spam.

    The website I posted was my personal website, which is usually what anyone posts in their profile, so I'm sorry for that.

    I have read some of the documentation, although much of it is very extensive and I'd rather not spend a few hours reading a bunch of irrelevant information. I will however look at what you suggest to look at and see if that helps.

    I was hoping for someone to point me in the right direction so I would know where to begin, not do it for me, but just suggest the function(s) I should look at or something to that nature.

    Thanks for your time and help,

    David
  • It is not robots who post that SPAM it is ill-intentioned individuals hoping to promote their sites. As for the structure, it is simple to cut and paste from other posts or to make some benign question up. Sorry if yours fit the pattern.

    Further on this, you seem to know the "right direction" since you have already determined you might hack the `printLatestImages()` function. (Another reason for the suspicion of the text.) The pointer was to copy the code to your own plugin and change it to your heart's content.

    BTW, links included in a users profile are totally hidden from all but logged in moderators, so are useless in promoting SEO of the site.
  • I have a suggestion but really only works if you're uploading or monitoring the photos uploaded. Why not create a dynamic album based on a certain tag?

    Also which parameter of printLatestImages() are you trying to set to all? If you're trying to set album to All to select all albums just set it to NULL instead. If no album is specified it should select from all of the albums. That's what I get from looking at the documentation, I'll give it a test and let you know.
  • I was correct, if you set it to NULL it'll display them from all albums. Here it is in action (in the codeblock of the page).

    Code used in codeblock:
    `<? printLatestImages(16,NULL,TRUE,TRUE,TRUE,25) ?>`

    http://inthemdl.net/pages/testing-page

    Obiously you'll have to use some CSS styling. What is it you're trying to accomplish? If you just want one album/photo page that displays all photos you upload, you might want to just create a theme. I'd start by just dupilcating the default theme and going forward from there. That way you can use the printLatestImages() (or printLatestImagesByDate()) and set the styling and everything how you want to match.
  • `printLatestImages()` calls the function `printImageStatistic()`, which gets it's content from the `getImageStatistic()` and there lies the problem. It't the LIMIT statement in the SQL of that function that poses the problem since it MUST be provided a value and I do not wish to use an excessively large value just to make it work.

    The approach I'm looking at taking is based on sbillard's suggestion to look at the object model, which is to copy the `getImageStatistic()` function and re-name it in the theme_functions.php file and just simply remove the LIMIT statement and remove all of the parameters since I need it to just retrieve ALL of the images the viewing user is permitted to see.

    Then it looks like I need to just iterate over the returned array and utilize the _Image classes' methods on each array item to format the display data of each image object and form my image feed like how Flickr does it.

    Does this sound good?
    Also, is there a simple way to create the pagination so the admin can set say 20 images per page? I'm not sure if there's a built-in function for doing this or if this is something I will need to code myself since what I'm doing is a pretty customized derivative from the core functions.
  • acrylian Administrator, Developer
    The image/album stats function are simply not designed to show all albums.

    As micheall I would suggest to create a dynamic album. You could create it based on image suffixes to cover all of them. Then you have all the benefits of a "real" album like pagination and single images view (if the vistior has cookies enabled as that is required for dynamic albums).

    As of the pagination value, nearly all option can be set via `setOption` either permanenlty (db update) or temporarily (no db update, does not work with all).
  • Zenphoto's pagination is built into the images per page option assumtions and the `next_image()` loop. If you deviate from these you really will have to make your own pagination as well.
Sign In or Register to comment.