From: Meik S. <acy...@ph...> - 2009-10-26 13:59:48
|
Author: acydburn Date: Mon Oct 26 13:59:02 2009 New Revision: 10234 Log: Fix Bug #53185 (icon width/height adjustement for icons > 127px also applied on smilies) - related to r10088 Modified: branches/phpBB-3_0_0/phpBB/includes/acp/acp_icons.php Modified: branches/phpBB-3_0_0/phpBB/includes/acp/acp_icons.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/acp/acp_icons.php (original) --- branches/phpBB-3_0_0/phpBB/includes/acp/acp_icons.php Mon Oct 26 13:59:02 2009 *************** *** 89,104 **** continue; } ! // adjust the width and height to be lower than 128px while perserving the aspect ratio ! if ($img_size[0] > 127 && $img_size[0] > $img_size[1]) ! { ! $img_size[1] = (int) ($img_size[1] * (127 / $img_size[0])); ! $img_size[0] = 127; ! } ! else if ($img_size[1] > 127) { ! $img_size[0] = (int) ($img_size[0] * (127 / $img_size[1])); ! $img_size[1] = 127; } $_images[$path . $img]['file'] = $path . $img; --- 89,107 ---- continue; } ! // adjust the width and height to be lower than 128px while perserving the aspect ratio (for icons) ! if ($mode == 'icons') { ! if ($img_size[0] > 127 && $img_size[0] > $img_size[1]) ! { ! $img_size[1] = (int) ($img_size[1] * (127 / $img_size[0])); ! $img_size[0] = 127; ! } ! else if ($img_size[1] > 127) ! { ! $img_size[0] = (int) ($img_size[0] * (127 / $img_size[1])); ! $img_size[1] = 127; ! } } $_images[$path . $img]['file'] = $path . $img; *************** *** 363,369 **** if ($mode == 'smilies' && $action == 'create') { $smiley_count = $this->item_count($table); ! $addable_smileys_count = sizeof($images); foreach ($images as $image) { --- 366,372 ---- if ($mode == 'smilies' && $action == 'create') { $smiley_count = $this->item_count($table); ! $addable_smileys_count = sizeof($images); foreach ($images as $image) { *************** *** 372,378 **** --$addable_smileys_count; } } ! if ($smiley_count + $addable_smileys_count > SMILEY_LIMIT) { trigger_error(sprintf($user->lang['TOO_MANY_SMILIES'], SMILEY_LIMIT) . adm_back_link($this->u_action), E_USER_WARNING); --- 375,381 ---- --$addable_smileys_count; } } ! if ($smiley_count + $addable_smileys_count > SMILEY_LIMIT) { trigger_error(sprintf($user->lang['TOO_MANY_SMILIES'], SMILEY_LIMIT) . adm_back_link($this->u_action), E_USER_WARNING); *************** *** 400,414 **** $image_height[$image] = $img_size[1]; } ! if ($image_width[$image] > 127 && $image_width[$image] > $image_height[$image]) ! { ! $image_height[$image] = (int) ($image_height[$image] * (127 / $image_width[$image])); ! $image_width[$image] = 127; ! } ! else if ($image_height[$image] > 127) { ! $image_width[$image] = (int) ($image_width[$image] * (127 / $image_height[$image])); ! $image_height[$image] = 127; } $img_sql = array( --- 403,421 ---- $image_height[$image] = $img_size[1]; } ! // Adjust image width/height for icons ! if ($mode == 'icons') { ! if ($image_width[$image] > 127 && $image_width[$image] > $image_height[$image]) ! { ! $image_height[$image] = (int) ($image_height[$image] * (127 / $image_width[$image])); ! $image_width[$image] = 127; ! } ! else if ($image_height[$image] > 127) ! { ! $image_width[$image] = (int) ($image_width[$image] * (127 / $image_height[$image])); ! $image_height[$image] = 127; ! } } $img_sql = array( *************** *** 923,929 **** generate_pagination($this->u_action, $item_count, $config['smilies_per_page'], $pagination_start, true) ); } ! /** * Returns the count of smilies or icons in the database * --- 930,936 ---- generate_pagination($this->u_action, $item_count, $config['smilies_per_page'], $pagination_start, true) ); } ! /** * Returns the count of smilies or icons in the database * |