Autore: salvocortesiano
Basandomi sul tips di Roger
Per chi fosse interessato, procedere come segue:
APRI:
Codice: Seleziona tutto
root/includes/functions_posting.php
Codice: Seleziona tutto
if (sizeof($icons))
{
foreach ($icons as $id => $data)
{
if ($data['display'])
{
$template->assign_block_vars('topic_icon', array(
'ICON_ID' => $id,
'ICON_IMG' => $phpbb_root_path . $config['icons_path'] . '/' . $data['img'],
'ICON_WIDTH' => $data['width'],
'ICON_HEIGHT' => $data['height'],
'S_CHECKED' => ($id == $icon_id) ? true : false,
'S_ICON_CHECKED' => ($id == $icon_id) ? ' checked="checked"' : '')
);
}
}
return true;
}
return false;
}
Codice: Seleziona tutto
if (sizeof($icons))
{
$max_icons_width = 40; /* icons preview will be no wider than this 72 */
$max_icons_height = 22; /* icons preview will be no taller than this 36 */
foreach ($icons as $id => $data)
{
$width = $data['width'];
$height = $data['height'];
$factor_w = ($width > $max_icons_width) ? ($max_icons_width / $width) : 1.0;
$factor_h = ($height > $max_icons_height) ? ($max_icons_height / $height) : 1.0;
$factor = ($factor_w < $factor_h) ? $factor_w : $factor_h;
if ($data['display'])
{
$template->assign_block_vars('topic_icon', array(
'ICON_ID' => $id,
'ICON_IMG' => $phpbb_root_path . $config['icons_path'] . '/' . $data['img'],
//'ICON_WIDTH' => $data['width'],
//'ICON_HEIGHT' => $data['height'],
'ICON_WIDTH' => intval(($data['width'] * $factor) + 0.5),
'ICON_HEIGHT' => intval(($data['height'] * $factor) + 0.5),
'S_CHECKED' => ($id == $icon_id) ? true : false,
'S_ICON_CHECKED' => ($id == $icon_id) ? ' checked="checked"' : '')
);
}
}
return true;
}
return false;
}
NOTA: dopo la pubblicazione del topic, l'icona argomento manterrà le sue reali dimensioni. Non verrà ridimensionata...[/i][/b]