From 77c942263062fbb417630a037abbc34b57d1f690 Mon Sep 17 00:00:00 2001 From: Sam Thompson Date: Mon, 4 Jul 2011 17:10:34 -0700 Subject: [ticket/10250] Added the new phpBB Logo with the Registered Trademark Symbol PHPBB3-10250 --- phpBB/styles/prosilver/imageset/site_logo.gif | Bin 3430 -> 5070 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'phpBB') diff --git a/phpBB/styles/prosilver/imageset/site_logo.gif b/phpBB/styles/prosilver/imageset/site_logo.gif index 909114c377..2517fbedd6 100644 Binary files a/phpBB/styles/prosilver/imageset/site_logo.gif and b/phpBB/styles/prosilver/imageset/site_logo.gif differ -- cgit v1.2.1 From f610f44a4e23eef8ed7698a32b10bc28789bdf00 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 5 Jul 2011 19:09:09 -0400 Subject: [ticket/10250] Overwrite the site_logo width&height when the phpbb logo is used The new logo is slightly wider than the old logo. If we changed the size in the imageset.cfg we would cause a conflict for everyone who replaced the logo with their own and modified the size. Instead we overwrite the width and height in the img() function in session.php only if its contents are that of the stock phpbb logo. PHPBB3-10250 --- phpBB/includes/session.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'phpBB') diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 7ef6e02a8d..f509957f96 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -2272,9 +2272,36 @@ class user extends session // Use URL if told so $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path; - $img_data['src'] = $root_path . 'styles/' . rawurlencode($this->theme['imageset_path']) . '/imageset/' . ($this->img_array[$img]['image_lang'] ? $this->img_array[$img]['image_lang'] .'/' : '') . $this->img_array[$img]['image_filename']; + $path = 'styles/' . rawurlencode($this->theme['imageset_path']) . '/imageset/' . ($this->img_array[$img]['image_lang'] ? $this->img_array[$img]['image_lang'] .'/' : '') . $this->img_array[$img]['image_filename']; + + $img_data['src'] = $root_path . $path; $img_data['width'] = $this->img_array[$img]['image_width']; $img_data['height'] = $this->img_array[$img]['image_height']; + + // We overwrite the width and height to the phpbb logo's width + // and height here if the contents of the site_logo file are + // really equal to the phpbb_logo + // This allows us to change the dimensions of the phpbb_logo without + // modifying the imageset.cfg and causing a conflict for everyone + // who modified it for their custom logo on updating + if ($img == 'site_logo' && file_exists($phpbb_root_path . $path)) + { + global $cache; + + if (($img_file_hash = $cache->get('imageset_site_logo_md5')) === false) + { + $img_file_hash = md5(file_get_contents($phpbb_root_path . $path)); + $cache->put('imageset_site_logo_md5', $img_file_hash); + } + + $phpbb_logo_hash = '0c461a32cd3621643105f0d02a772c10'; + + if ($phpbb_logo_hash == $img_file_hash) + { + $img_data['width'] = '149'; + $img_data['height'] = '52'; + } + } } $alt = (!empty($this->lang[$alt])) ? $this->lang[$alt] : $alt; -- cgit v1.2.1 From 8ec737e9c4d36711b09250df72492a8f89e7bfb1 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 5 Jul 2011 19:38:15 -0400 Subject: [ticket/10250] Destroy cached md5 hash of site_logo on refreshing an imageset PHPBB3-10250 --- phpBB/includes/acp/acp_styles.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB') diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 37cf8d1f72..3bc8c86500 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -510,6 +510,7 @@ parse_css_file = {PARSE_CSS_FILE} $db->sql_transaction('commit'); $cache->destroy('sql', STYLES_IMAGESET_DATA_TABLE); + $cache->destroy('imageset_site_logo_md5'); add_log('admin', 'LOG_IMAGESET_REFRESHED', $imageset_row['imageset_name']); trigger_error($user->lang['IMAGESET_REFRESHED'] . adm_back_link($this->u_action)); -- cgit v1.2.1 From b261a1a31ae8500cc090d412ed569123ae3cb9ca Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Wed, 6 Jul 2011 17:53:57 -0400 Subject: [ticket/10250] The site_logo hash is different depending on imageset & language PHPBB3-10250 --- phpBB/includes/session.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'phpBB') diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index f509957f96..e9e706e2b8 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -2288,15 +2288,23 @@ class user extends session { global $cache; - if (($img_file_hash = $cache->get('imageset_site_logo_md5')) === false) + $img_file_hashes = $cache->get('imageset_site_logo_md5'); + + if ($img_file_hashes === false) + { + $img_file_hashes = array(); + } + + $key = $this->theme['imageset_path'] . '::' . $this->img_array[$img]['image_lang']; + if (!isset($img_file_hashes[$key])) { - $img_file_hash = md5(file_get_contents($phpbb_root_path . $path)); - $cache->put('imageset_site_logo_md5', $img_file_hash); + $img_file_hashes[$key] = md5(file_get_contents($phpbb_root_path . $path)); + $cache->put('imageset_site_logo_md5', $img_file_hashes); } $phpbb_logo_hash = '0c461a32cd3621643105f0d02a772c10'; - if ($phpbb_logo_hash == $img_file_hash) + if ($phpbb_logo_hash == $img_file_hashes[$key]) { $img_data['width'] = '149'; $img_data['height'] = '52'; -- cgit v1.2.1