1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

- removed db cache (might re-appear, but for now we do not see the need for it)

- all changes to styles/subsilver/template are purely cosmetic (no functional changes)
- cosmetics
- bugfixes
- add index to modules table
- use modules ordering code for forums too


git-svn-id: file:///svn/phpbb/trunk@6073 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2006-06-16 16:54:51 +00:00
parent a3c9182e0f
commit b0c3e39582
144 changed files with 4275 additions and 4156 deletions

View File

@@ -97,13 +97,13 @@ else
@set_time_limit(120);
// Include essential scripts
require($phpbb_root_path . 'includes/functions.'.$phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx);
include($phpbb_root_path . 'includes/auth.' . $phpEx);
include($phpbb_root_path . 'includes/session.'.$phpEx);
include($phpbb_root_path . 'includes/template.'.$phpEx);
include($phpbb_root_path . 'includes/acm/acm_file.'.$phpEx);
include($phpbb_root_path . 'includes/cache.'.$phpEx);
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
include($phpbb_root_path . 'includes/session.' . $phpEx);
include($phpbb_root_path . 'includes/template.' . $phpEx);
include($phpbb_root_path . 'includes/acm/acm_file.' . $phpEx);
include($phpbb_root_path . 'includes/cache.' . $phpEx);
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
// Try and load an appropriate language if required
$language = request_var('language', '');
@@ -152,11 +152,11 @@ if (!$language)
}
// And finally, load the relevant language files
include($phpbb_root_path . 'language/' . $language . '/common.'.$phpEx);
include($phpbb_root_path . 'language/' . $language . '/acp/common.'.$phpEx);
include($phpbb_root_path . 'language/' . $language . '/acp/board.'.$phpEx);
include($phpbb_root_path . 'language/' . $language . '/install.'.$phpEx);
include($phpbb_root_path . 'language/' . $language . '/posting.'.$phpEx);
include($phpbb_root_path . 'language/' . $language . '/common.' . $phpEx);
include($phpbb_root_path . 'language/' . $language . '/acp/common.' . $phpEx);
include($phpbb_root_path . 'language/' . $language . '/acp/board.' . $phpEx);
include($phpbb_root_path . 'language/' . $language . '/install.' . $phpEx);
include($phpbb_root_path . 'language/' . $language . '/posting.' . $phpEx);
$mode = request_var('mode', 'overview');
$sub = request_var('sub', '');
@@ -201,7 +201,9 @@ class module
var $mode;
var $sub;
// Private methods, should not be overwritten
/**
* Private methods, should not be overwritten
*/
function create($module_type, $module_url, $selected_mod = false, $selected_submod = false)
{
global $db, $config, $phpEx;
@@ -263,7 +265,9 @@ class module
} // END foreach
} // END create
// Load and run the relevant module if applicable
/**
* Load and run the relevant module if applicable
*/
function load($mode = false, $run = true)
{
global $phpbb_root_path, $phpEx;
@@ -275,13 +279,16 @@ class module
$this->mode = $mode;
}
/**
* @todo this could be written as $this->module = new $this->filename($this); ... no? (eval statement in install/index.php)
*/
eval("\$this->module = new $this->filename(\$this);");
if (method_exists($this->module, 'main'))
{
$this->module->main($this->mode, $this->sub);
}
}
} // END load
}
/**
* Output the standard page header
@@ -598,4 +605,5 @@ class module
return $tpl;
}
}
?>

View File

@@ -14,13 +14,13 @@
if (!empty($setmodules))
{
$module[] = array(
'module_type' => 'install',
'module_title' => 'INSTALL',
'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1),
'module_order' => 10,
'module_subs' => '',
'module_stages' => array('INTRO', 'REQUIREMENTS', 'DATABASE', 'ADMINISTRATOR', 'CONFIG_FILE', 'ADVANCED', 'FINAL'),
'module_reqs' => ''
'module_type' => 'install',
'module_title' => 'INSTALL',
'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1),
'module_order' => 10,
'module_subs' => '',
'module_stages' => array('INTRO', 'REQUIREMENTS', 'DATABASE', 'ADMINISTRATOR', 'CONFIG_FILE', 'ADVANCED', 'FINAL'),
'module_reqs' => ''
);
}
@@ -124,6 +124,7 @@ class install_install extends module
else
{
$passed['php'] = true;
// We also give feedback on whether we're running in safe mode
$result = '<b style="color:green">' . $lang['YES'];
if (@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on')
@@ -132,6 +133,7 @@ class install_install extends module
}
$result .= '</b>';
}
$template->assign_block_vars('checks', array(
'TITLE' => $lang['PHP_VERSION_REQD'],
'RESULT' => $result,
@@ -173,7 +175,7 @@ class install_install extends module
{
$dll = $db_ary['MODULE'];
if (!extension_loaded($dll))
if (!@extension_loaded($dll))
{
if (!$this->can_load_dll($dll))
{
@@ -208,7 +210,7 @@ class install_install extends module
foreach ($this->php_dlls_other as $dll)
{
if (!extension_loaded($dll))
if (!@extension_loaded($dll))
{
if (!$this->can_load_dll($dll))
{
@@ -222,6 +224,7 @@ class install_install extends module
continue;
}
}
$template->assign_block_vars('checks', array(
'TITLE' => $lang['DLL_' . strtoupper($dll)],
'RESULT' => '<b style="color:green">' . $lang['AVAILABLE'] . '</b>',
@@ -429,7 +432,7 @@ class install_install extends module
$available_dbms_temp = array();
foreach ($this->available_dbms as $type => $dbms_ary)
{
if (!extension_loaded($dbms_ary['MODULE']))
if (!@extension_loaded($dbms_ary['MODULE']))
{
if (!$this->can_load_dll($dbms_ary['MODULE']))
{
@@ -693,7 +696,7 @@ class install_install extends module
foreach ($check_exts as $dll)
{
if (!extension_loaded($dll))
if (!@extension_loaded($dll))
{
if (!$this->can_load_dll($dll))
{
@@ -907,7 +910,7 @@ class install_install extends module
$cookie_domain = ($server_name != '') ? $server_name : (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
// If we get here and the extension isn't loaded it should be safe to just go ahead and load it
if (!extension_loaded($this->available_dbms[$dbms]['MODULE']))
if (!@extension_loaded($this->available_dbms[$dbms]['MODULE']))
{
@dl($this->available_dbms[$dbms]['MODULE'] . ".$prefix");
}
@@ -1264,34 +1267,28 @@ class install_install extends module
if ($module_class == 'acp')
{
// Move main module 4 up...
for ($i = 1; $i <= 4; $i++)
{
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
WHERE module_name = 'main'
AND module_class = 'acp'
AND module_mode = 'main'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
WHERE module_name = 'main'
AND module_class = 'acp'
AND module_mode = 'main'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$_module->move_module_by($row, 'move_up', 1);
}
$_module->move_module_by($row, 'move_up', 4);
// Move permissions intro screen module 4 up...
for ($i = 1; $i <= 4; $i++)
{
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
WHERE module_name = 'permissions'
AND module_class = 'acp'
AND module_mode = 'intro'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
WHERE module_name = 'permissions'
AND module_class = 'acp'
AND module_mode = 'intro'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$_module->move_module_by($row, 'move_up', 1);
}
$_module->move_module_by($row, 'move_up', 4);
}
// And now for the special ones
@@ -1374,7 +1371,7 @@ class install_install extends module
foreach ($this->bot_list as $bot_name => $bot_ary)
{
$user_row = array(
'user_type' => GROUP_HIDDEN,
'user_type' => USER_IGNORE,
'group_id' => $group_id,
'username' => $bot_name,
'user_regdate' => time(),
@@ -1446,7 +1443,7 @@ class install_install extends module
if ($config['email_enable'])
{
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
$messenger = new messenger(false);
@@ -1523,23 +1520,23 @@ class install_install extends module
case 'sqlite':
$sql = "SHOW TABLES";
$field = "Tables_in_{$dbname}";
break;
break;
case 'mssql':
case 'mssql_odbc':
$sql = "SELECT name
FROM sysobjects
WHERE type='U'";
$field = "name";
break;
$field = 'name';
break;
case 'postgres':
$sql = "SELECT relname
FROM pg_class
WHERE relkind = 'r'
AND relname NOT LIKE 'pg\_%'";
$field = "relname";
break;
$field = 'relname';
break;
case 'firebird':
$sql = 'SELECT rdb$relation_name
@@ -1547,12 +1544,12 @@ class install_install extends module
WHERE rdb$view_source is null
AND rdb$system_flag = 0';
$field = 'rdb$relation_name';
break;
break;
case 'oracle':
$sql = 'SELECT table_name FROM USER_TABLES';
$field = 'table_name';
break;
break;
}
$result = $db->sql_query($sql);
@@ -1563,8 +1560,7 @@ class install_install extends module
do
{
// All phpBB installations will at least have config else it won't
// work
// All phpBB installations will at least have config else it won't work
if (in_array(strtolower($row[$field]), $table_ary))
{
$error[] = $lang['INST_ERR_PREFIX'];
@@ -1612,7 +1608,7 @@ class install_install extends module
{
$path = $phpbb_root_path . 'language/' . $file;
if (is_file($path) || is_link($path) || $file == '.' || $file == '..')
if (is_file($path) || is_link($path) || $file == '.' || $file == '..' || $file == 'CVS')
{
continue;
}

View File

@@ -14,13 +14,13 @@
if (!empty($setmodules))
{
$module[] = array(
'module_type' => 'install',
'module_title' => 'OVERVIEW',
'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1),
'module_order' => 0,
'module_subs' => array('INTRO', 'LICENSE', 'SUPPORT'),
'module_stages' => '',
'module_reqs' => ''
'module_type' => 'install',
'module_title' => 'OVERVIEW',
'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1),
'module_order' => 0,
'module_subs' => array('INTRO', 'LICENSE', 'SUPPORT'),
'module_stages' => '',
'module_reqs' => ''
);
}
@@ -45,10 +45,12 @@ class install_main extends module
$title = $lang['SUB_INTRO'];
$body = $lang['OVERVIEW_BODY'];
break;
case 'license' :
$title = $lang['GPL'];
$body = implode("<br/>\n", file('../docs/COPYING'));
break;
case 'support' :
$title = $lang['SUB_SUPPORT'];
$body = $lang['SUPPORT_BODY'];
@@ -64,4 +66,5 @@ class install_main extends module
));
}
}
?>

View File

@@ -204,16 +204,6 @@ BEGIN
END;;
# phpbb_cache
CREATE TABLE phpbb_cache (
var_name VARCHAR(252) NOT NULL,
var_expires INTEGER DEFAULT 0 NOT NULL,
var_data BLOB SUB_TYPE TEXT
);;
ALTER TABLE phpbb_cache ADD PRIMARY KEY (var_name);;
# phpbb_config
CREATE TABLE phpbb_config (
config_name VARCHAR(252) NOT NULL,
@@ -565,6 +555,7 @@ ALTER TABLE phpbb_modules ADD PRIMARY KEY (module_id);;
CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules(module_enabled);;
CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules(left_id, right_id);;
CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules(module_class, left_id);;
CREATE GENERATOR phpbb_modules_gen;;
SET GENERATOR phpbb_modules_gen TO 0;;

View File

@@ -329,29 +329,6 @@ CREATE INDEX [bot_active] ON [phpbb_bots]([bot_active]) ON [PRIMARY]
GO
/*
Table: phpbb_cache
*/
CREATE TABLE [phpbb_cache] (
[var_name] [varchar] (255) NOT NULL ,
[var_expires] [int] NOT NULL ,
[var_data] [text]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [phpbb_cache] WITH NOCHECK ADD
CONSTRAINT [PK_phpbb_cache] PRIMARY KEY CLUSTERED
(
[var_name]
) ON [PRIMARY]
GO
ALTER TABLE [phpbb_cache] WITH NOCHECK ADD
CONSTRAINT [DF_phpbb_cache__var_expires] DEFAULT (0) FOR [var_expires],
CONSTRAINT [DF_phpbb_cache__var_name] DEFAULT ('') FOR [var_name]
GO
/*
Table: phpbb_config
*/
@@ -895,6 +872,9 @@ GO
CREATE INDEX [module_left_right_id] ON [phpbb_modules]([left_id], [right_id]) ON [PRIMARY]
GO
CREATE INDEX [module_class_left_id] ON [phpbb_modules]([module_class], [left_id]) ON [PRIMARY]
GO
/*
Table: phpbb_poll_options

View File

@@ -132,14 +132,6 @@ CREATE TABLE phpbb_bots (
KEY bot_active (bot_active)
);
# Table: 'phpbb_cache'
CREATE TABLE phpbb_cache (
var_name varchar(255) DEFAULT '' NOT NULL,
var_expires int(10) UNSIGNED DEFAULT '0' NOT NULL,
var_data mediumtext,
PRIMARY KEY (var_name)
);
# Table: 'phpbb_config'
CREATE TABLE phpbb_config (
config_name varchar(255) NOT NULL,
@@ -362,7 +354,8 @@ CREATE TABLE phpbb_modules (
module_auth varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (module_id),
KEY left_right_id (left_id, right_id),
KEY module_enabled (module_enabled)
KEY module_enabled (module_enabled),
KEY class_left_id (module_class, left_id)
);
# Table: 'phpbb_poll_options'

View File

@@ -307,18 +307,6 @@ CREATE INDEX phpbb_bots_bot_active on phpbb_bots (bot_active)
/
/*
Table: phpbb_cache
*/
CREATE TABLE phpbb_cache (
var_name varchar2(255) DEFAULT '',
var_expires number(10) DEFAULT '0' NOT NULL,
var_data clob,
CONSTRAINT pk_phpbb_cache PRIMARY KEY (var_name)
)
/
/*
Table: phpbb_config
*/
@@ -781,6 +769,8 @@ CREATE INDEX phpbb_modules_module_enabled on phpbb_modules (module_enabled)
/
CREATE INDEX phpbb_modules_left_right_id on phpbb_modules (left_id, right_id)
/
CREATE INDEX phpbb_modules_class_left_id on phpbb_modules (module_class, left_id)
/
/*

View File

@@ -254,18 +254,6 @@ CREATE TABLE phpbb_bots (
CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active);
/* Table: phpbb_cache */
CREATE TABLE phpbb_cache (
var_name varchar(255) DEFAULT '' NOT NULL,
var_expires INT4 DEFAULT '0' NOT NULL,
var_data TEXT,
PRIMARY KEY (var_name),
CHECK (var_expires>=0)
);
/* Table: phpbb_config */
CREATE TABLE phpbb_config (
config_name varchar(255) NOT NULL,
@@ -590,7 +578,7 @@ CREATE TABLE phpbb_modules (
CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules (module_enabled);
CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules (left_id, right_id);
CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id);

View File

@@ -146,15 +146,6 @@ CREATE TABLE phpbb_bots (
CREATE INDEX phpbb_bots_bot_active on phpbb_bots (bot_active);
# Table: phpbb_cache
CREATE TABLE phpbb_cache (
var_name varchar(255) NOT NULL DEFAULT '',
var_expires int(10) NOT NULL DEFAULT '0',
var_data mediumtext(16777215),
PRIMARY KEY (var_name)
);
# Table: phpbb_config
CREATE TABLE phpbb_config (
config_name varchar(255) NOT NULL,
@@ -392,6 +383,7 @@ CREATE TABLE phpbb_modules (
CREATE INDEX phpbb_modules_module_enabled on phpbb_modules (module_enabled);
CREATE INDEX phpbb_modules_left_right_id on phpbb_modules (left_id, right_id);
CREATE INDEX phpbb_modules_class_left_id on phpbb_modules (module_class, left_id);
# Table: phpbb_poll_options