Advanced search  

News:

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

Pages: 1 [2]   Go Down

Author Topic: Bilder sortieren - andere Möglichkeit?  (Read 13403 times)

0 Members and 1 Guest are viewing this topic.

Αndré

  • Administrator
  • Coppermine addict
  • ****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15429
Re: Bilder sortieren - andere Möglichkeit?
« Reply #20 on: April 27, 2009, 01:53:07 pm »

Problem: in der Funktion get_pic_data in include/functions.inc.php steht folgendes:
Code: [Select]
        $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
Code: [Select]
          'da' => 'pid ASC',
          'dd' => 'pid DESC',
in
Code: [Select]
          '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.
Logged

Starlight

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Female
  • Posts: 161
    • Starlight's Graphics
Re: Bilder sortieren - andere Möglichkeit?
« Reply #21 on: April 27, 2009, 01:56:49 pm »

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

UserTier

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Bilder sortieren - andere Möglichkeit?
« Reply #22 on: August 06, 2013, 05:35:57 pm »

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     
Logged
Pages: 1 [2]   Go Up
 

Page created in 0.014 seconds with 20 queries.