Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ticket/10250] Replacing the phpBB logo with a version that includes (R) #258

Merged
merged 4 commits into from
Jul 7, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions phpBB/includes/acp/acp_styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ function main($id, $mode)
$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));
Expand Down
37 changes: 36 additions & 1 deletion phpBB/includes/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -2272,9 +2272,44 @@ function img($img, $alt = '', $width = false, $suffix = '', $type = 'full_tag')
// 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;

$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_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_hashes[$key])
{
$img_data['width'] = '149';
$img_data['height'] = '52';
}
}
}

$alt = (!empty($this->lang[$alt])) ? $this->lang[$alt] : $alt;
Expand Down
Binary file modified phpBB/styles/prosilver/imageset/site_logo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.