Latest photos, popular photos, list of users.

Hello and thanks for the great CMS, I would like to implement some features to my zenphoto community site and I would like to ask you how these can be easily implemented to my site.

First of all, I would like a dynamic album of all the photos uploaded from everyone sorted by their date. I tried searching for a global var or for a function to get them but I couldn't find anything. Should I write my own function to get this, or it is implemented somehow and I just couldn't find it? AFAIK the dynamic albums allow you to search for a word but in this case that I need them sorted by date what can I do?

Secondly, I would like to get the same list of all photos sorted by rating. Is this possible and how? Should I make my own function again?

The third that I want to ask is there is a way to get all users from a group in an array to iterate through them and echo some of their details (username, email etc). I will make a plugin so the users can upload their avatar on the system and I would like to make a list of all the users that is public through a link.

I would like to use zenphoto's classes if it is possible and not have to make my own connection to the database to retrieve all these things.

Comments

  • acrylian Administrator, Developer
    1) Create a dynamic album by searching something general like image suffixes and set the sorting accordingly.

    2) You should be able to do this with a dynamic album as well.

    3) That should be possible with the object model and the authority and administrators classes
  • Thank you for your fast response.

    How can I create a search with something general when everybody is uploading their images with their own tags/ descriptions/ image names?

    How can I sort by date/by popularity a dynamic album. Should I first implement the option onto the theme? Is there a special parameter to a function that allows that?

    edit: forget the second question. I found this inside the create dynamic album option. But the problem is HOW I search to see every uploaded picture into the gallery to sort them by popularity/date.
  • 1. Make the search on something that is common, like the folder where the uploads go. Exactly what will depend on how you have things organized. Remember that searches can look for "boolean expressions" so you could search on folders for a list of folders.

    If you want to sort the album by date then popularity you will have to create a custom search. You then will be basically writing "sql order by" code. The only caveat is that the sort order gets applied separately. If leave that default, then no text is added and you can put the orders within the order by strings.

    Put your order by string within parenthesis in the custom input box.
  • acrylian Administrator, Developer
    1) As said search for image suffixes like .jpg and set the search for filename only. It does not get more general than that.

    2) You don't need and you can't search for popular/date. You search for all and then set the sort order for the dynamic album.
  • Hi again, with your help I managed to create the dynamic album and properly view all the wanted images with the appropriate sorting but I encountered I weird bug when I'm clicking an image from the dynamic album.

    When I visit a dynamic album that has a photo and I click on the photo, I get a blank page and the source code is cut somewhere in the head section after loading some javascript from my template. The weird thing is that when I go to another normal album that has the SAME photo (and gives the SAME url for the photo), then when I click the photo, the photo loads correctly.

    If I copy paste the "problematic" url (that has no picture loaded) and I paste it on another window after I have clicked on the dynamic album it won't work but If i just visit another valid page of my gallery and then paste the same URL again there, the link works correctly.

    Any tips on that?
  • Blank pages (incomplete HTML source) are the result of fatal PHP errors, so the first thing we need to know is what was the error?

    Did you make a custom sort order? if so, try a standard one and see if the problem still exists.
  • I should have known that.. :(

    The sorting was the standard "most viewed" or the "most recent" photos from the sorting option at the dynamic album creation form. I will try to enable php error reporting to see if I get any warning/notices/fatal errors on my page.
  • The error I get is:
    Fatal error: Cannot access protected property SearchEngine::$dynalbumname in /pathremovedforsecurityreasons/themes/zpmasonry/functions.php on line 104

    should I check the theme's functions.php for something particular?
  • acrylian Administrator, Developer
    You should try if this happens with a standard theme. If not it is a theme issue the theme's author would have to solve.
  • This is a theme issue. You need an update to the theme to not use the protected property. Instead use `$searchengine->getDynamicAlbum()->name` (`$searchengine` needs to be changed to whatever variable the theme is using where the error occurs.)
Sign In or Register to comment.