[php]<?php
if($setmodules == 1)
{
$file = basename(__FILE__);
$module['Działy']['pierwszy'] = "$file?mode=config";
return;
}
define('IN_PHPBB', 1);
//
// Let's set the root dir for phpBB
//
$phpbb_root_path = "./../";
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);
include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
include($phpbb_root_path.'language/lang_polish/lang_admin_news.'.$phpEx);
//
// Pull all config data
//
$sql = "SELECT *
FROM " . A_TABLE;
if(!$result = $db->sql_query($sql))
{
message_die(CRITICAL_ERROR, "Could not query config information in admin_board", "", __LINE__, __FILE__, $sql);
}
else
{
while( $row = $db->sql_fetchrow($result) )
{
$config_name = $row['config_name'];
$config_value = $row['config_value'];
$default_config[$config_name] = $config_value;
$new[$config_name] = ( isset($HTTP_POST_VARS[$config_name]) ) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name];
$new[$config_name]= stripslashes($new[$config_name]);
if( isset($HTTP_POST_VARS['submit']) )
{
$sql = "UPDATE " . A_TABLE . " SET
config_value = '" . addslashes($new[$config_name]) . "'
WHERE config_name = '$config_name'";
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Failed to update general configuration for $config_name", "", __LINE__, __FILE__, $sql);
}
}
}
if( isset($HTTP_POST_VARS['submit']) )
{
$message = $lang['Config_news_updated'] . "<br /><br />" . sprintf($lang['Click_return_newsadmin'], "<a href=\"" . append_sid("admin_news.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
message_die(GENERAL_MESSAGE, $message);
}
}
$template->set_filenames(array(
"body" => "admin/board_news_body.tpl")
);
$template->assign_vars(array(
"S_NEWS_CONFIG_ACTION" => append_sid("admin_news.$phpEx"),
"L_SUBMIT" => $lang['Submit'],
"L_RESET" => $lang['Reset'],
"NEWS_TITLE" => $new['a_title'],
"NEWS_BLOCK" => $new['a_block'])
);
$template->pparse("body");
include('./page_footer_admin.'.$phpEx);
?>[/php]
Mam tabele a_title i a_block i niewiem co ejst nie tak ze odczytuje dobze z bazyale niezapisuje w niej zmian to jest modyfikacja newsmod