http://www.icyphoenix.com/viewtopic.php?f=28&t=5049&p=33901#p33901
-----------------------------------
salcedaka
Wed 19 Nov, 2008 18:46

[Mod]Forum Logo Selector
-----------------------------------
Hey!
Navigating the Internet I found a mod for changing the logo of phpBB2, and I have adapted to Icy Phoenix.
Would you think.

First upload to the server folder images.

SQL:
[codeblock]
INSERT INTO `ip_config` VALUES ('logo_image_path', 'images/logo');
INSERT INTO `ip_config` VALUES ('logo_image', 'subSilver.gif');
INSERT INTO `ip_config` VALUES ('logo_image_w', '200');
INSERT INTO `ip_config` VALUES ('logo_image_h', '91');
[/codeblock]

OPEN:
language/lang_english/lang_admin.php

Search:
[code linenumbers=false]
?>
[/code]

Before Add:
[code linenumbers=false]
$lang['Logo_settings'] = 'Logo Setting';
$lang['Logo_explain'] = 'Here you can set the folder path to your forum logos, the logo to be used and it's display height and width.';
$lang['Logo_path'] = 'Logo Storage Path';
$lang['Logo_path_explain'] = 'Path under your phpBB root dir, e.g. images/logo';
$lang['Logo'] = 'Choose a Logo';
$lang['Logo_dimensions'] = 'Logo Dimensions';
$lang['Logo_dimensions_explain'] = '(Height x Width in pixels). Setting these values to 0 means to display the image in its original height and width.';
[/code]

Open:
adm/admin_board.php

Search:
[code linenumbers=false]
$style_select
[/code]

Before add:
[code linenumbers=false]
$dir = @opendir($phpbb_root_path . $new['logo_image_path']);
$count = 0;
while( $file = @readdir($dir) )
{
	if( !@is_dir(phpbb_realpath($phpbb_root_path . $new['logo_image_path'] . '/' . $file)) )
	{
		if( preg_match('/(.gif$|.png$|.jpg|.jpeg)$/is', $file) )
		{
			$logo[$count] = $file; 
			$count++;
		}
	}
}
@closedir($dir);
// Logo ListBox
$logo_list = "";
for( $i = 0; $i < count($logo); $i++ )
{
	if ($logo[$i] == $new['logo_image'])
		$logo_list .= '<option value="' . $logo[$i] . '" selected="selected">' . $logo[$i] . '</option>'; 
	else 
		$logo_list .= '<option value="' . $logo[$i] . '">' . $logo[$i] . '</option>';
}

$logo_image = $new['logo_image'];
$logo_width = $new['logo_image_w'];
$logo_height = $new['logo_image_h'];
[/code]

Search:
[code linenumbers=false]
'L_ADMIN' => $lang['Acc_Admin'],
[/code]

After add:
[code linenumbers=false]
	'L_LOGO_SETTINGS' => $lang['Logo_settings'],
	'L_LOGO_EXPLAIN' => $lang['Logo_explain'],
	'L_LOGO_PATH' => $lang['Logo_path'], 
	'L_LOGO_PATH_EXPLAIN' => $lang['Logo_path_explain'],
	'L_LOGO' => $lang['Logo'],
	'L_LOGO_DIMENSIONS' => $lang['Logo_dimensions'],
	'L_LOGO_DIMENSIONS_EXPLAIN' => $lang['Logo_dimensions_explain'],
[/code]

Search:
[code linenumbers=false]
	'TIMEZONE_SELECT' => $timezone_select,
[/code]

After add:
[code linenumbers=false]
	'LOGO_PATH' => $new['logo_image_path'],
	'LOGO_IMAGE_DIR' => $phpbb_root_path . $new['logo_image_path'], 
	'LOGO_LIST' => $logo_list,
	'LOGO_IMAGE' => ($logo_image) ? $phpbb_root_path . $board_config['logo_image_path'] .'/' . $logo_image : '',
	'LOGO_WIDTH' => $new['logo_image_w'],
	'LOGO_HEIGHT' => $new['logo_image_h'],
[/code]

Open:
includes/page_header.php

Search:
[code linenumbers=false]
	'SITE_DESCRIPTION' => $board_config['site_desc'],
[/code]

After add:
[code linenumbers=false]
	'LOGO' => ($board_config['logo_image']) ? $phpbb_root_path . $board_config['logo_image_path'] .'/' . $board_config['logo_image'] : '',
	'LOGO_WIDTH' => ($board_config['logo_image_w'] == 0) ? "" : 'width="' . $board_config['logo_image_w'] . '" ',
	'LOGO_HEIGHT' => ($board_config['logo_image_h'] == 0) ? "" : 'height="' . $board_config['logo_image_h'] . '" ',
[/code]

Open:
templates/common/acp/board_config_body.tpl

Search:
[code linenumbers=false]
<p>{L_CONFIGURATION_EXPLAIN}</p>
[/code]

After add:
[code linenumbers=false]
<script language="javascript" type="text/javascript">
<!--
function update_logo(newlogo)
{
	document.logo_image.src = "{LOGO_IMAGE_DIR}/" + newlogo;
}
//-->
</script>
[/code]

Search:
[code linenumbers=false]
	<tr>
		<td class="row1">{L_ENABLE_PRUNE}</td>
		<td class="row2"><input type="radio" name="prune_enable" value="1" {PRUNE_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="prune_enable" value="0" {PRUNE_NO} /> {L_NO}</td>
	</tr>
[/code]

After Add:
[code linenumbers=false]
	<tr>
		<th class="thHead" colspan="2">{L_LOGO_SETTINGS}</th>
	</tr>
	<tr>
		<td class="row2" colspan="2"><span class="gensmall">{L_LOGO_EXPLAIN}</span></td>
	</tr>
	<tr> 
	  <td class="row1">{L_LOGO_PATH}<br /><span class="gensmall">{L_LOGO_PATH_EXPLAIN}</span></td>
	  <td class="row2"><input class="post" type="text" size="20" maxlength="255" name="logo_image_path" value="{LOGO_PATH}" /></td>
	</tr>
	<tr>
		<td class="row1">{L_LOGO_DIMENSIONS}<br /><span class="gensmall">{L_LOGO_DIMENSIONS_EXPLAIN}</span></td>
		<td class="row2"><input class="post" type="text" size="3" maxlength="4" name="logo_image_h" value="{LOGO_HEIGHT}" /> x <input class="post" type="text" size="3" maxlength="4" name="logo_image_w" value="{LOGO_WIDTH}"></td>
	</tr>
	<tr> 
	  <td class="row1">{L_LOGO}</td>
	  <td class="row2"><select name="logo_image" onchange="update_logo(this.options[selectedIndex].value);">{LOGO_LIST}</select> &nbsp; <img name="logo_image" src="{LOGO_IMAGE}" border="0" width="{LOGO_WIDTH}" height="{LOGO_HEIGHT}"/> &nbsp;</td>
	</tr>
[/code]

Open:
templates/mg_themes/overall_header.tpl

Search:
[code linenumbers=false]
				<td><a href="{U_INDEX}"><img src="{FULL_SITE_PATH}{SITELOGO}" border="0" alt="{L_INDEX}" vspace="1" /></a></td>
[/code]

In-Line Search:
[code linenumbers=false]
{SITELOGO}"
[/code]

Replace With:
[code linenumbers=false]
{LOGO}" {LOGO_WIDTH}{LOGO_HEIGHT}
[/code]

	
And now, I attached the images folder.


