Выбираем логотип из админки, например из папки
images/logo[th]http://s002.youpic.su/pictures/1293300000/3733ed7598b4edf5485069ef6d619d85.png[/th] [th]http://s002.youpic.su/pictures/1293300000/7a28e5c6c595af06dff2eb971596ce96.png[/th]
Установка#
#-----[ SQL ]------------------------------------------
#
#
Код:
INSERT INTO `bb_config` VALUES ('logo_image_path', 'images/logo');
INSERT INTO `bb_config` VALUES ('logo_image', 'subSilver.gif');
INSERT INTO `bb_config` VALUES ('logo_image_w', '200');
INSERT INTO `bb_config` VALUES ('logo_image_h', '91');
#
#-----[ OPEN ]------------------------------------------
#
language/lang_russian/lang_admin.php
в самый конец добавить
Код:
// Logo Selector MOD
$lang['Logo_settings'] = 'Настройки логотипа';
$lang['Logo_explain'] = 'Здесь вы можете задать путь к папке на вашем форуме к логотипу, логотип, который будет использоваться на форуме';
$lang['Logo_path'] = 'Папка где находятся логотипы';
$lang['Logo_path_explain'] = 'Путь к корневой папке, например. images/logo';
$lang['Logo'] = 'Выберите логотип';
$lang['Logo_dimensions'] = 'Размеры логотипа';
$lang['Logo_dimensions_explain'] = '(высота х ширина в пикселях) ';
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
Код:
$prune_no = ( !$new['prune_enable'] ) ? "checked=\"checked\"" : "";
#
#-----[ AFTER, ADD ]------------------------------------------
#
Код:
// Logo Selector MOD
// Get all images in the logo directory
$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'];
#
#-----[ FIND ]------------------------------------------
#
Код:
"L_ADMIN_EMAIL" => $lang['Admin_email'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
Код:
// Logo Selector MOD
"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'],
// Logo Selector MOD
#
#-----[ FIND ]------------------------------------------
#
Код:
"TIMEZONE_SELECT" => $timezone_select,
#
#-----[ AFTER, ADD ]------------------------------------------
#
Код:
// Logo Selector MOD
"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 . $bb_cfg['logo_image_path'] .'/' . $logo_image : '',
"LOGO_WIDTH" => $new['logo_image_w'],
"LOGO_HEIGHT" => $new['logo_image_h'],
// Logo Selector MOD
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
Код:
'U_GROUP_CP' => "groupcp.$phpEx",
#
#-----[ AFTER, ADD ]------------------------------------------
#
Код:
// Logo Selector MOD
'LOGO' => ($bb_cfg['logo_image']) ? $bb_cfg['logo_image_path'] .'/' . $bb_cfg['logo_image'] : '',
'LOGO_WIDTH' => $bb_cfg['logo_image_w'],
'LOGO_HEIGHT' => $bb_cfg['logo_image_h'],
// Logo Selector MOD
#
#-----[ OPEN ]------------------------------------------
#
templates/ваш стиль/admin/admin_board.tpl
#
#-----[ FIND ]------------------------------------------
#
Код:
<p>{L_CONFIGURATION_EXPLAIN}</p>
#
#-----[ AFTER, ADD ]------------------------------------------
#
Код:
<script language="javascript" type="text/javascript">
<!--
function update_logo(newlogo)
{
document.logo_image.src = "{LOGO_IMAGE_DIR}/" + newlogo;
}
//-->
</script>
#
#-----[ FIND ]------------------------------------------
#
Код:
<tr>
<td class="row1">{L_ENABLE_PRUNE}</td>
<td class="row2"><input type="radio" name="prune_enable" value="1" {PRUNE_YES} /> {L_YES} <input type="radio" name="prune_enable" value="0" {PRUNE_NO} /> {L_NO}</td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
Код:
<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> <img name="logo_image" src="{LOGO_IMAGE}" border="0" width="{LOGO_WIDTH}" height="{LOGO_HEIGHT}"/> </td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
templates/ваш стиль/page_header.tpl
#
#-----[ FIND ]------------------------------------------
#
Код:
<a href="{U_INDEX}"><img src="images/logo/logo.gif" alt="{SITENAME}" /></a>
#
#-----[ REPLACE WITH ]------------------------------------------
#
Код:
<a href="{U_INDEX}"><img src="{LOGO}" width="{LOGO_WIDTH}" height="{LOGO_HEIGHT}" border="0" alt="{L_HOME}" vspace="1" /></a>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
#
Все готово!