userid); break; case LOGPICS_FOR_CACHE_STAT: // all pictures for a cache // need not to exclude invisible caches, as this is only displayed in listing view $result = sql_value( "SELECT COUNT(*) FROM `pictures` AS `pics` $join_logs WHERE `object_type`=1 AND `logs`.`cache_id`='&1'", 0, $cacheid); break; case LOGPICS_FOR_CACHE_GALLERY: // all picture for a cache // for all users except owner: also excluding invisble caches $rs = sql("SELECT $fields, `user`.`username`, `logs`.`date` AS `picdate` FROM `pictures` AS `pics` $join_logs " . ($userid == $login->userid ? "" : "$join_caches $join_cachestatus") . " $join_user WHERE `object_type`=1 AND `logs`.`cache_id`='&1' ORDER BY `logs`.`date` DESC LIMIT &2", $cacheid, MAX_PICTURES_IN_CACHE_GALLERY+1); break; default: global $tpl; $tpl->error(ERROR_INVALID_OPERATION); return null; } if ($rs !== false) { $result = sql_fetch_assoc_table($rs); while (count($result) % 6) // fill up table to full line length, so that < 6 pics do not spread over the table width $result[] = array('pic_uuid' => ''); } return $result; } ?>