Index: trunk/phase3/includes/specials/SpecialListfiles.php |
— | — | @@ -49,6 +49,7 @@ |
50 | 50 | |
51 | 51 | function getFieldNames() { |
52 | 52 | if ( !$this->mFieldNames ) { |
| 53 | + global $wgMiserMode; |
53 | 54 | $this->mFieldNames = array( |
54 | 55 | 'img_timestamp' => wfMsg( 'listfiles_date' ), |
55 | 56 | 'img_name' => wfMsg( 'listfiles_name' ), |
— | — | @@ -56,6 +57,9 @@ |
57 | 58 | 'img_size' => wfMsg( 'listfiles_size' ), |
58 | 59 | 'img_description' => wfMsg( 'listfiles_description' ), |
59 | 60 | ); |
| 61 | + if( !$wgMiserMode ) { |
| 62 | + $this->mFieldNames['COUNT(oi_archive_name)'] = wfMsg( 'listfiles_count' ); |
| 63 | + } |
60 | 64 | } |
61 | 65 | return $this->mFieldNames; |
62 | 66 | } |
— | — | @@ -66,13 +70,22 @@ |
67 | 71 | } |
68 | 72 | |
69 | 73 | function getQueryInfo() { |
70 | | - $fields = $this->getFieldNames(); |
71 | | - $fields = array_keys( $fields ); |
| 74 | + $tables = array( 'image' ); |
| 75 | + $fields = array_keys( $this->getFieldNames() ); |
72 | 76 | $fields[] = 'img_user'; |
| 77 | + $options = $join_conds = array(); |
| 78 | + # Depends on $wgMiserMode |
| 79 | + if( isset($this->mFieldNames['COUNT(oi_archive_name)']) ) { |
| 80 | + $tables[] = 'oldimage'; |
| 81 | + $options = array('GROUP BY' => 'img_name'); |
| 82 | + $join_conds = array('oldimage' => array('LEFT JOIN','oi_name = img_name') ); |
| 83 | + } |
73 | 84 | return array( |
74 | | - 'tables' => 'image', |
75 | | - 'fields' => $fields, |
76 | | - 'conds' => $this->mQueryConds |
| 85 | + 'tables' => $tables, |
| 86 | + 'fields' => $fields, |
| 87 | + 'conds' => $this->mQueryConds, |
| 88 | + 'options' => $options, |
| 89 | + 'join_conds' => $join_conds |
77 | 90 | ); |
78 | 91 | } |
79 | 92 | |
— | — | @@ -123,6 +136,8 @@ |
124 | 137 | return $this->getSkin()->formatSize( $value ); |
125 | 138 | case 'img_description': |
126 | 139 | return $this->getSkin()->commentBlock( $value ); |
| 140 | + case 'COUNT(oi_archive_name)': |
| 141 | + return intval($value)+1; |
127 | 142 | } |
128 | 143 | } |
129 | 144 | |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1899,6 +1899,7 @@ |
1900 | 1900 | 'listfiles_user' => 'User', |
1901 | 1901 | 'listfiles_size' => 'Size', |
1902 | 1902 | 'listfiles_description' => 'Description', |
| 1903 | +'listfiles_count' => 'Versions', |
1903 | 1904 | |
1904 | 1905 | # File description page |
1905 | 1906 | 'filehist' => 'File history', |