<?php
/**
*
* @package ppkBB3cker
* @version $Id: viewtopic_add2_screenshot.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;
}
				$screenshot_addon='';
				foreach ($torrents_attach['screenshot'] as $screenshot_data)
				{
					$screenshot_data['size_lang'] = get_size_lang($screenshot_data['filesize']);
					if($screenshot_data['thumbnail'] && $screenshot_data['filesize'] > $config['ppkbb_tmin_thumbsize'])
					{
						$screenshot_addon='&amp;t=1';
					}
					$screenshot_data['filesize'] = get_formatted_filesize($screenshot_data['filesize'], false);
					$screenshot_basename=basename($screenshot_data['real_filename']);
					$screenshot_wh=get_img_size_format($screenshot_data['i_width'], $screenshot_data['i_height']);
					$template->assign_block_vars('postrow.torrent_screenshot_fields', array(
						'SCREENSHOT_LINK' => append_sid("{$phpbb_root_path}download/file.$phpEx", 'mode=view&amp;id=' . (int) $screenshot_data['attach_id'], true, ($screenshot_data['is_orphan']) ? $user->session_id : false),
						'SCREENSHOT_SRC' => append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $screenshot_data['attach_id'] . $screenshot_addon),
						'SCREENSHOT_FILESIZE'			=> $screenshot_data['filesize'],
						'SCREENSHOT_SIZE_LANG'			=> $screenshot_data['size_lang'],
						'SCREENSHOT_WH'=>$screenshot_data['i_width'] > $screenshot_wh[0] ? ' width="'.$screenshot_wh[0].'" height="'.$screenshot_wh[1].'"' : '',
						'SCREENSHOT_DOWNLOAD_NAME'		=> utf8_strlen($screenshot_basename)>$tracker_substr ? utf8_substr($screenshot_basename, 0, $tracker_substr).'...' : $screenshot_basename,
						'SCREENSHOT_ALTITLE'			=> $screenshot_basename,
						'SCREENSHOT_COMMENT'			=> @$screenshot_data['attach_comment'] ? '[<a href="#" title="'.$screenshot_data['attach_comment'].'" alt="'.$screenshot_data['attach_comment'].'">?</a>]' : '',
						'SCREENSHOT_CLCOMMENT'			=> @$screenshot_data['attach_comment'],
						'SCREENSHOT_DOWNLOADED'			=>$screenshot_data['download_count']
						)
					);
				}
?>