<?php
/**
*
* @package ppkBB3cker
* @version $Id: viewtopic_add1_filelist.php 1.000 2009-02-21 14:13:00 PPK $
* @copyright (c) 2008, 2009 PPK
* http://ppkbb3cker.rx22.ru, http://protoneutron.narod.ru
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}
					$sort_opt[$torrent_opt]=array('filename', 'size');
					if(!in_array($opt_param, $sort_opt[$torrent_opt]))
					{
						$opt_param=$sort_opt[$torrent_opt][0];
					}
						foreach($sort_opt[$torrent_opt] as $v)
						{
							$postrow=array_merge($postrow, array(
								'TORRENT_SORT_HEADER_'.strtoupper($v) => "$viewtopic_url&amp;opt={$torrent_opt}&amp;opts=".($opt_sort=='DESC' ? 'ASC' : 'DESC')."&amp;optp={$v}#opt",
										)
									);
						}
						$sql_addon="$opt_param $opt_sort";

					$sql='SELECT * FROM '. TRACKER_FILES_TABLE ." WHERE id='$torrent_id' ORDER BY $sql_addon";
					$result=$db->sql_query($sql);
					while($filelist=$db->sql_fetchrow($result))
					{
						$i3+=1;
						$assign_vars[$i3]['TORRENT_FILE'] = $filelist['filename'];
						$assign_vars[$i3]['TORRENT_SIZE'] = get_formatted_filesize($filelist['size'], 0).' '.get_size_lang($filelist['size']);

					}
					$torrent_info_curr=$torrent_opt;
					$torrent_info[$torrent_opt]='<b>'.$torrent_info[$torrent_info_curr].'</b> ('.$i3.')';
					$torrent_info_curr_explain[$torrent_opt]=$user->lang['TORRENT_FILELIST'];
?>