Код: Выделить всё
#
#-----[ SQL ]------------------------------
#
CREATE TABLE `phpbb_top` (
`name` VARCHAR( 255 ) NOT NULL ,
`value` TEXT NOT NULL );
#
#-----[ SQL ]------------------------------
#
INSERT INTO `phpbb_top` ( `name` , `value` ) VALUES ( 'links', '');
INSERT INTO `phpbb_top` ( `name` , `value` ) VALUES ( 'top', '');
#
#-----[ OPEN ]------------------------------
#
includes/page_header.php
#
#-----[ FIND ]-----------------------------------
#
$l_timezone = (count($l_timezone) > 1 && $l_timezone[count($l_timezone)-1] != 0) ? $lang[sprintf('%.1f', $board_config['board_timezone'])] : $lang[number_format($board_config['board_timezone'])];
#
#-----[ AFTER, ADD ]-----------------------------------
#
//Custom Top And links
//Add header and links from database
$sql = "SELECT value FROM phpbb_top WHERE name = 'top'
LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain header information.", '', __LINE__, __FILE__, $sql);
}
$postrow = $db->sql_fetchrow($result);
$topp = $postrow['value'];
$topp = str_replace("'", "\'", $topp);
$sql = "SELECT config_value FROM phpbb_config WHERE config_name = 'links'
LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain header information.", '', __LINE__, __FILE__, $sql);
}
$postrow = $db->sql_fetchrow($result);
$links = $postrow['value'];
$links = str_replace("'", "\'", $links);
//End
#
#-----[ FIND ]-----------------------------------
#
'T_SPAN_CLASS3' => $theme['span_class3'],
#
#-----[ AFTER, ADD ]-----------------------------------
#
'TOPP' => $topp,
'LINKS' => $links,
#
#-----[ OPEN ]------------------------------
#
templates/SubSilver/overall_header.tpl
#
#-----[ FIND ]-----------------------------------
#
<td class="bodyline"><table width="100%" cellspacing="0" cellpadding="0" border="0">
#
#-----[ AFTER, ADD ]-----------------------------------
#
{TOPP}
#
#-----[ FIND ]-----------------------------------
#
<td height="25" align="center" valign="top" nowrap="nowrap"><span class="mainmenu"> <a href="{U_PROFILE}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_profile.gif" width="12" height="13" border="0" alt="{L_PROFILE}" hspace="3" />{L_PROFILE}</a> <a href="{U_PRIVATEMSGS}" class="mainmenu"><img src="{PRIVMSG_IMG}" width="12" height="13" border="0" alt="{PRIVATE_MESSAGE_INFO}" hspace="3" />{PRIVATE_MESSAGE_INFO}</a> <a href="{U_LOGIN_LOGOUT}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" hspace="3" />{L_LOGIN_LOGOUT}</a> </span></td>
#
#-----[ AFTER, ADD ]-----------------------------------
#
<br />{LINKS}
#
#-----[ OPEN ]------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]-----------------------------------
#
if( isset($HTTP_POST_VARS['submit']) )
{
#
#-----[ AFTER, ADD ]-----------------------------------
#
if ($config_name == 'links')
{
$sql = "UPDATE phpbb_top SET value = '$new[links]' WHERE name = 'links'";
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Failed to update general configuration for phpbb_top", "", __LINE__, __FILE__, $sql);
}
}
if ($config_name == 'topp')
{
$sql = "UPDATE phpbb_top SET value = '$new[topp]' WHERE name = 'top'";
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Failed to update general configuration for phpbb_top", "", __LINE__, __FILE__, $sql);
}
}
#
#-----[ FIND ]-----------------------------------
#
if( isset($HTTP_POST_VARS['submit']) )
{
$message = $lang['Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_config'], "<a href=\"" . append_sid("admin_board.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
message_die(GENERAL_MESSAGE, $message);
}
}
#
#-----[ AFTER, ADD ]-----------------------------------
#
$sql = "SELECT * FROM phpbb_top WHERE name = 'links'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain top or links information.", '', __LINE__, __FILE__, $sql);
}
$postrow = $db->sql_fetchrow($result);
$new[links] = $postrow['value'];
$sql = "SELECT * FROM phpbb_top WHERE name = 'top'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain top or links information.", '', __LINE__, __FILE__, $sql);
}
$postrow = $db->sql_fetchrow($result);
$new[topp] = $postrow['value'];
#
#-----[ FIND ]-----------------------------------
#
$template->pparse("body");
include('./page_footer_admin.'.$phpEx);
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$template->assign_vars(array(
"LINKS" => $new['links'],
"TOPP" => $new['topp']));
));
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1">{L_DISABLE_BOARD}<br /><span class="gensmall">{L_DISABLE_BOARD_EXPLAIN}</span></td>
<td class="row2"><input type="radio" name="board_disable" value="1" {S_DISABLE_BOARD_YES} /> {L_YES} <input type="radio" name="board_disable" value="0" {S_DISABLE_BOARD_NO} /> {L_NO}</td>
</tr>
#
#-----[ AFTER, ADD ]-----------------------------------
#
<tr>
<td class="row1">Ссылки<br /><span class="gensmall">Добавление ссылок вверху страницы</span></td>
<td class="row2"><textarea name="links" rows="5" cols="60">{LINKS}</textarea></td>
</tr>
<tr>
<td class="row1">top<br /><span class="gensmall">Добавление кода в самый верх страницы</span></td>
<td class="row2"><textarea name="topp" rows="5" cols="60">{TOPP}</textarea></td>
</tr>
#
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Интересно что скажут более опытные.