Changeset 336 for details.php
- Timestamp:
- 03/31/11 14:52:35 (1 year ago)
- Files:
-
- details.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
details.php
r335 r336 166 166 array( 'filelist_tpl' => 'details_filelist.html' 167 167 )); 168 169 $sql = 'SELECT f.filename, f.size 170 FROM ' . FILES_TABLE . ' f 171 WHERE f.torrent = ' . $id . ' 172 ORDER BY filename'; 173 $result = $db->sql_query( $sql ); 168 require($root_path . '/include/class.bencode.php'); 169 170 $torrent_dir = $root_path . ( !empty($config['torrent_dir']) ? $config['torrent_dir'] : 'torrents'); 171 $torrent = new Torrent($torrent_dir . '/' . $id . '.torrent'); 172 173 $content = $torrent->content(); 174 174 175 $i = 0; 175 while ( $row = $db->sql_fetchrow( $result )) {176 foreach ( $content AS $filename => $size ) { 176 177 ++$i; 177 $filename = explode( '/', trim( $row['filename'] ) );178 $filename = array_pop( $filename );179 178 $template->assign_block_vars( 'filelist_row', array( 180 'EXT_PIC' => getExtension( $filename),181 'FILENAME' => $ row['filename'],182 'SIZE' => mksize( $row['size']),179 'EXT_PIC' => getExtension($filename), 180 'FILENAME' => $filename, 181 'SIZE' => mksize($size), 183 182 'TD_CLASS' => ( $i % 2 ? $theme['td_class1'] : $theme['td_class2'] ) 184 183 ));
