Returning albums when searching by date

Hi there,

Just a quick one. I'm not sure if this just isn't meant to happen or I'm doing something wrong but when I search by date (like a link from the archive list) only images are returned. I'd like both albums and images to be returned. This happens on the default theme too so it appears not to be a theme thing?

Thanks!

Comments

  • acrylian Administrator, Developer
    Check the fields to search on on the options.
  • Yeah, Date is ticked. Images return fine but albums don't. Albums return fine for other types of search like keywords or tags.

    Thanks!
  • acrylian Administrator, Developer
    Is it the latest Zenphoto release? If so please consider to try the nightly build (don't try on a live site as we are in the middle of some restructuring and have some "pause" currently). If the error persists please create a ticket with the exact description what you do. Thanks.
  • OK I didn't test things thoroughly enough really as I came back to this today and have sorted it out. So, searching by date does work and return albums just not in "archive" mode, which I guess is a feature really!

    In order for my archive list to work with albums as well, on my theme's album page where I have the list, I have the following:

    `
    <?php
    function printAllDatesMod($class='archive', $yearid='year', $monthid='month', $order='asc') {
    global $_zp_current_search;
    if (!empty($class)){ $class = "class=\"$class\""; }
    if (!empty($yearid)){ $yearid = "class=\"$yearid\""; }
    if (!empty($monthid)){ $monthid = "class=\"$monthid\""; }
    $datecount = getAllDates($order);
    $lastyear = "";
    echo "\n<ul $class>\n";
    $nr = 0;
    while (list($key, $val) = each($datecount)) {
    $nr++;
    if ($key == '0000-00-01') {
    $year = "no date";
    $month = "";
    } else {
    $dt = strftime('%Y-%B', strtotime($key));
    $year = substr($dt, 0, 4);
    $month = substr($dt, 5);
    }

    if ($lastyear != $year) {
    $lastyear = $year;
    if($nr != 1) { echo "\n\n";}
    echo "$year\n
      \n";
      }
      if (is_object($_zp_current_search)) {
      $albumlist = $_zp_current_search->album_list;
      } else {
      $albumlist = NULL;
      }
      echo "
    • $month
    • \n";
      }
      echo "
    \n\n\n";
    }
    ?>
    `
    ...and I use this in place of the `printAllDates()`. It's just sticking the date in the words part rather than the date part (and I removed the item count from the list too).
Sign In or Register to comment.