Bilder sortieren - andere Möglichkeit? - Page 2 Bilder sortieren - andere Möglichkeit? - Page 2
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Bilder sortieren - andere Möglichkeit?

Started by Starlight, April 27, 2009, 09:57:17 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Αndré

Problem: in der Funktion get_pic_data in include/functions.inc.php steht folgendes:
        $sort_array = array(
          'na' => 'filename ASC',
          'nd' => 'filename DESC',
          'ta'=>'title ASC',
          'td'=>'title DESC',
          'da' => 'pid ASC',
          'dd' => 'pid DESC',
          'pa' => 'position ASC',
          'pd' => 'position DESC',
        );

Ändere
          'da' => 'pid ASC',
          'dd' => 'pid DESC',

in
          'da' => 'ctime ASC',
          'dd' => 'ctime DESC',

dann sollte es gehen.

Ich bin leichtsinnigerweise davon ausgegangen, dass nach Datum sortiert wird. Standardmäßig wird aber auch hier nach der Picture-ID sortiert.

Starlight

Vielen lieben Dank für deine Mühe! :) So klappt es.

UserTier

Für 1.5:

{  // thumb = 0
                // last uploaded file from album
                $keyword = ($row['keyword'] ? "OR (keywords like '%".addslashes($row['keyword'])."%' $forbidden_set_string )" : '');
                $query = "SELECT pid FROM {$CONFIG['TABLE_PICTURES']} WHERE ((aid = '{$row['aid']}' $forbidden_set_string) $keyword) $approved ORDER BY ctime DESC LIMIT 0,1";
                $result = cpg_db_query($query);
                list($ctime_lastup) = mysql_fetch_row($result);
                mysql_free_result($result);
                $album_thumbs[] = $ctime_lastup;
                $rowset_aid[$index]['thumb'] = $ctime_lastup;
            }

in include/functions.inc.php

sortiert die lastups nach ctime