sql_query($sql_query[$i])) ) { $errored = true; $error = $db->sql_error(); if (!$hide) { echo " -> FAILED ---> " . $error['message'] . "

\n\n"; } } else { if (!$hide) { echo " -> COMPLETED

\n\n"; } } } if ($errored) { return (FALSE); } else { return $result; } } function fill_new_table_data($dbms) { $data = ''; if ( ($dbms == 'mysql') || ($dbms == 'mysql4') ) { $data = ' CREATE TABLE phpbb_stats_config ( config_name varchar(50) NOT NULL default \'\', config_value varchar(255) NOT NULL default \'\', PRIMARY KEY (config_name) ); CREATE TABLE phpbb_stats_modules ( module_id tinyint(8) NOT NULL default \'0\', name varchar(150) NOT NULL default \'\', active tinyint(1) NOT NULL default \'0\', installed tinyint(1) NOT NULL default \'0\', display_order mediumint(8) unsigned NOT NULL default \'0\', update_time mediumint(8) unsigned NOT NULL default \'0\', auth_value tinyint(2) NOT NULL default \'0\', module_info_cache blob, module_data_cache blob, module_info_time int(10) unsigned NOT NULL default \'0\', module_data_time int(10) unsigned NOT NULL default \'0\', PRIMARY KEY (module_id) ); INSERT INTO phpbb_stats_config (config_name, config_value) VALUES (\'install_date\', \'' . time() . '\'); INSERT INTO phpbb_stats_config (config_name, config_value) VALUES (\'return_limit\', \'10\'); INSERT INTO phpbb_stats_config (config_name, config_value) VALUES (\'version\', \'2.1.0\'); INSERT INTO phpbb_stats_config (config_name, config_value) VALUES (\'modules_dir\', \'stat_modules\'); INSERT INTO phpbb_stats_config (config_name, config_value) VALUES (\'page_views\', \'0\'); '; } else if ( ($dbms == 'mssql') || ($dbms == 'mssql-odbc') ) { $data = ' BEGIN TRANSACTION GO CREATE TABLE [phpbb_stats_config] ( [config_name] [varchar] (50) NOT NULL , [config_value] [varchar] (50) NOT NULL ) ON [PRIMARY] GO ALTER TABLE [phpbb_stats_config] WITH NOCHECK ADD CONSTRAINT [PK_phpbb_stats_config] PRIMARY KEY CLUSTERED ( [config_name] ) ON [PRIMARY] GO CREATE TABLE [phpbb_stats_modules] ( [module_id] [int] NOT NULL , [name] [char] (150) NOT NULL , [active] [int] NOT NULL, [installed] [int] NOT NULL, [display_order] [int] NOT NULL, [update_time] [int] NOT NULL, [auth_value] [int] NOT NULL, [module_info_cache] [text], [module_data_cache] [text], [module_info_time] [int] NOT NULL, [module_data_time] [int] NOT NULL ) ON [PRIMARY] GO ALTER TABLE [phpbb_stats_modules] WITH NOCHECK ADD CONSTRAINT [PK_phpbb_stats_modules] PRIMARY KEY CLUSTERED ( [module_id] ) ON [PRIMARY] GO ALTER TABLE [phpbb_stats_modules] WITH NOCHECK ADD CONSTRAINT [DF_phpbb_stats_modules_module_id] DEFAULT (0) FOR [module_id], CONSTRAINT [DF_phpbb_stats_modules_active] DEFAULT (0) FOR [active], CONSTRAINT [DF_phpbb_stats_modules_installed] DEFAULT (0) FOR [installed], CONSTRAINT [DF_phpbb_stats_modules_display_order] DEFAULT (0) FOR [display_order], CONSTRAINT [DF_phpbb_stats_modules_update_time] DEFAULT (0) FOR [update_time], CONSTRAINT [DF_phpbb_stats_modules_auth_value] DEFAULT (0) FOR [auth_value], CONSTRAINT [DF_phpbb_stats_modules_module_info_time] DEFAULT (0) FOR [module_info_time], CONSTRAINT [DF_phpbb_stats_modules_module_data_time] DEFAULT (0) FOR [module_data_time] GO INSERT INTO phpbb_stats_config (config_name, config_value) VALUES (\'install_date\', \'' . time() . '\'); INSERT INTO phpbb_stats_config (config_name, config_value) VALUES (\'return_limit\', \'10\'); INSERT INTO phpbb_stats_config (config_name, config_value) VALUES (\'version\', \'2.1.0\'); INSERT INTO phpbb_stats_config (config_name, config_value) VALUES (\'modules_dir\', \'stat_modules\'); INSERT INTO phpbb_stats_config (config_name, config_value) VALUES (\'page_views\', \'0\'); COMMIT GO '; } else if ($dbms == 'postgres') { $data = ' CREATE TABLE phpbb_stats_config ( config_name varchar(50) NOT NULL, config_value varchar(50) NOT NULL, CONSTRAINT phpbb_attachments_config_pkey PRIMARY KEY (config_name) ); CREATE TABLE phpbb_stats_modules ( module_id int4 NOT NULL DEFAULT 0, name varchar(150) NOT NULL default \'\', active int2 NOT NULL default 0, installed int2 NOT NULL default 0, display_order int4 NOT NULL default 0, update_time int4 NOT NULL default 0, auth_value int2 NOT NULL default 0, module_info_cache text, module_data_cache text, module_info_time int4 NOT NULL default 0, module_data_time int4 NOT NULL default 0, CONSTRAINT phpbb_stats_modules_pkey PRIMARY KEY (module_id) ); INSERT INTO phpbb_stats_config (config_name, config_value) VALUES (\'install_date\', \'' . time() . '\'); INSERT INTO phpbb_stats_config (config_name, config_value) VALUES (\'return_limit\', \'10\'); INSERT INTO phpbb_stats_config (config_name, config_value) VALUES (\'version\', \'2.1.0\'); INSERT INTO phpbb_stats_config (config_name, config_value) VALUES (\'modules_dir\', \'stat_modules\'); INSERT INTO phpbb_stats_config (config_name, config_value) VALUES (\'page_views\', \'0\'); '; } return $data; } ?>
Forum Home Installing Statistics Mod Version 2.1.0

array( "DELIM" => ";", "DELIM_BASIC" => ";", "COMMENTS" => "remove_remarks" ), "mysql4" => array( "DELIM" => ";", "DELIM_BASIC" => ";", "COMMENTS" => "remove_remarks" ), "mssql" => array( "DELIM" => "GO", "DELIM_BASIC" => ";", "COMMENTS" => "remove_comments" ), "mssql-odbc" => array( "DELIM" => "GO", "DELIM_BASIC" => ";", "COMMENTS" => "remove_comments" ), "postgres" => array( "LABEL" => "PostgreSQL 7.x", "DELIM" => ";", "DELIM_BASIC" => ";", "COMMENTS" => "remove_comments" ) ); $remove_remarks = $available_dbms[$dbms]['COMMENTS'];; $delimiter = $available_dbms[$dbms]['DELIM']; $delimiter_basic = $available_dbms[$dbms]['DELIM_BASIC']; $sql_query = fill_new_table_data($dbms); $result = evaluate_statement($sql_query, false, true); $message = ''; if ( !$result ) { $message .= "
Some queries failed. Please contact me via email, pm, at the board or whatever, so we can solve your problems...
"; } else { $message .= "
Statistics Mod Tables generated successfully."; } echo "\n
\nCOMPLETE!
\n"; echo $message . "
"; echo "
NOW DELETE THIS FILE
\n"; echo ""; echo ""; ?>