Complex Searches for Dynamic Albums

Greetings,

I would like to create a dynamic album that does something like the following:

tag='tag1' and album='album1' and datecreated > 'start date' and datecreated < 'end date'

Is there any way to accomplish this? From what I have seen so far I can't see a means by which I can search specific fields for specific terms.

Thanks.

Comments

  • Searches currently can only match targets to data, they cannot make comparisons. So your tag1 and album1 targets will work but your datecreated will not.
  • If you are looking to make these dynamic albums available without user intervention you could write a mysql query to accomplish the action and embed it. Likely to be a bit of a pain to format though.
  • Greetings,

    Thanks for the responses. The long term goal is indeed to create these without user intervention so as to allow a "rolling" dynamic album for each week of a project (Week 1, Week 2, etc.).

    If I wanted to match tags, but only in a specific album (ala my tag=tag1 and album=album1 example, thus excluding any items with matching tags but in a different album) how would I do that? When entering search criteria I only have a single text box, so I am not clear on what syntax I can use to accomplish this.

    For the date part, once I get more familiar with the search and zp in general, I may attempt to do it in sql.

    Thanks again.
  • Greetings,

    I think I worked out the search syntax:

    tags(Tag1) AND filename(Album1)

    This returns the expected images from Album1 that have Tag1. However as filename appears to search both the folder and the file name, it is not quite as restrictive as I would like (meaning I would have to be extra vigilant in my file naming conventions to ensure there is no cross over with album names).

    Is this the best way to accomplish my goal or am I missing something?

    Thanks.

    P.S.

    I didn't see an edit function, but let me know if I missed it.

    Edit:
    Well I found the edit for this post, not sure why I missed it the first time.
  • You can actually restrict searches to a set of albums. This happens, for instance when you do a search when you are on an album page.

    Most likely you will have to edit your dynamic album search, though, since the search from an album would restrict to just that album. Add the query parameter `inablums=album,album,album.....` to the search query.

    I don't want to discourage your efforts on the date part, but it will take some considerable research to get it right. You will have to create an object that mimics album objects to supply the list of images that your search finds.

    We have one such object instantiated in the "favorites" plugin. It keeps a list of "favorites" and supplies them masquerading as an album object. But you will see from examining that plugin that its operation is not simple.
  • acrylian Administrator, Developer
    @sinenitore: If I am not mistaken the post edit function is only available to "normal forum users" shortly after writing a post. I think general edit rights are reservered to us admins.
Sign In or Register to comment.