Hi!
Versuche mal das, suche in der global.php:
$config['cat_order'] = empty($config['cat_order']) ? 'cat_order, cat_name' : $config['cat_order'];
$config['cat_sort'] = empty($config['cat_sort']) ? 'ASC' : $config['cat_sort'];
$sql = "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
FROM ".CATEGORIES_TABLE."
ORDER BY ".$config['cat_order']." " .$config['cat_sort'];
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
$cat_cache[$row['cat_id']] = $row;
$cat_parent_cache[$row['cat_parent_id']][] = $row['cat_id'];
}
$site_db->free_result();
// --------------------------------------
$new_cutoff = time() - (60 * 60 * 24 * $config['new_cutoff']);
$sql = "SELECT cat_id, COUNT(image_id) AS new_images
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND image_date >= $new_cutoff
GROUP BY cat_id";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
$new_image_cache[$row['cat_id']] = $row['new_images'];
}
$site_db->free_result();
// --------------------------------------
und ersetze es mit:
$new_cutoff = time() - (60 * 60 * 24 * $config['new_cutoff']);
$sql = "SELECT cat_id, COUNT(image_id) AS new_images
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND image_date >= $new_cutoff
GROUP BY cat_id
ORDER BY image_date ASC
";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
$new_image_cache[$row['cat_id']] = $row['new_images'];
}
$site_db->free_result();
if (!empty($new_image_cache)){
$test = implode(",",array_keys($new_image_cache));
$sql = "SELECT cat_id, cat_parent_id
FROM ".CATEGORIES_TABLE."
WHERE cat_id in ($test)
";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
if (($row['cat_parent_id'] || $row['cat_id'])!= 0){
$new_parent_id[$row['cat_id']] = $row['cat_parent_id'];
}
}
$site_db->free_result();
$test2 = implode(",",$new_parent_id);
$sortcat = ($test || $test2)?("field(cat_id,$test,$test2)DESC, ") :"";
}
else{
$sortcat="";
}
/* ORDER BY ".$config['cat_order']." " .$config['cat_sort']; */
$config['cat_order'] = empty($config['cat_order']) ? 'cat_order, cat_name' : $config['cat_order'];
$config['cat_sort'] = empty($config['cat_sort']) ? 'ASC' : $config['cat_sort'];
$sql = "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
FROM ".CATEGORIES_TABLE."
ORDER BY ".$sortcat." ".$config['cat_order']." " .$config['cat_sort'];
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
$cat_cache[$row['cat_id']] = $row;
$cat_parent_cache[$row['cat_parent_id']][] = $row['cat_id'];
}
$site_db->free_result();
// --------------------------------------
Einige Einschränkungen gibt es, wenn sich die neuesten Bilder in einer Subcategorie befinden werden diese als erster gereiht,
ob es funktioniert wenn sich neue Bilder in einer Sub -subcategorie befinden kann ich dir nicht sagen, das musst du ausprobieren.
mfg Andi