<?php
/**
*
* @package ppkBB3cker
* @version $Id: viewtopic_add2_poster.php 1.000 2009-02-17 11:25: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;
}
				$poster_addon='';
				foreach ($torrents_attach['poster'] as $poster_data)
				{
					$poster_data['size_lang'] = get_size_lang($poster_data['filesize']);
					if($poster_data['thumbnail'] && $poster_data['filesize'] > $config['ppkbb_tmin_thumbsize'])
					{
						$poster_addon='&amp;t=1';
					}
					$poster_data['filesize'] = get_formatted_filesize($poster_data['filesize'], false);
					$poster_basename=basename($poster_data['real_filename']);
					$poster_wh=get_img_size_format($poster_data['i_width'], $poster_data['i_height']);
					$template->assign_block_vars('postrow.torrent_poster_fields', array(
						'POSTER_LINK'=>append_sid("{$phpbb_root_path}download/file.$phpEx", 'mode=view&amp;id=' . (int) $poster_data['attach_id'], true, ($poster_data['is_orphan']) ? $user->session_id : false),
						'POSTER_SRC' =>append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $poster_data['attach_id'] . $poster_addon),
						'POSTER_FILESIZE'	=>$poster_data['filesize'],
						'POSTER_SIZE_LANG'=>$poster_data['size_lang'],
						'POSTER_WH'=>$poster_data['i_width'] > $poster_wh[0] ? ' width="'.$poster_wh[0].'" height="'.$poster_wh[1].'"' : '',
						'POSTER_DOWNLOAD_NAME'		=> utf8_strlen($poster_basename)>$tracker_substr ? utf8_substr($poster_basename, 0, $tracker_substr).'...' : $poster_basename,
						'POSTER_ALTITLE'			=> $poster_basename,
						'POSTER_COMMENT'			=> @$poster_data['attach_comment'] ? '[<a href="#" title="'.$poster_data['attach_comment'].'" alt="'.$poster_data['attach_comment'].'">?</a>]' : '',
						'POSTER_CLCOMMENT'			=> @$poster_data['attach_comment'],
						'POSTER_DOWNLOADED'			=>$poster_data['download_count']
						)
					);
				}
?>