PDA

View Full Version : more sql help


Dillon
09-22-2008, 10:21 PM
I am not sure how to excactly convert the sql... I tried putting it in the admin panel... And now I have alot of sql for this mod, I am not sure how to convert it, nor what to put, to convert it... Please help! I uploaded the file...

<?php
/************************************************** *************************
* install_statistics.php
* -------------------
* begin : Wed, Jan 01, 2003 Meik Sievertsen
* copyright : (C) 2006 Wicher
* email : ---
*
* $Id: install_statistics.php,v 4.2.9 2007/07/09 17:02:00
*
*
************************************************** *************************/

/************************************************** *************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
************************************************** *************************/

error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
set_magic_quotes_runtime(0); // Disable magic_quotes_runtime

define('IN_PHPBB', true);

$phpbb_root_path = '../';
include($phpbb_root_path.'extension.inc');
include($phpbb_root_path.'common.'.$phpEx);
include($phpbb_root_path.'config.'.$phpEx);
include($phpbb_root_path.'includes/sql_parse.'.$phpEx);

//
// Check DB Type
//
if ( (!isset($dbms)) || (($dbms != 'mysql') && ($dbms != 'mysql4')) )
{
message_die(GENERAL_MESSAGE, 'This Beta Version only supports mysql.');
}
//include($phpbb_root_path.'includes/db.'.$phpEx);
//removed by danb00, stop debug db connection issues. Due to this being called in common.php, so removing the calling here fixes it

$available_dbms = array(
"mysql" => 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'];

$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);

//
// BEGIN Functions

//
// Check if a given row is present in table $table
//
function row_in_schema($table, $key)
{
global $db, $table_prefix;

$sql = "SELECT " . $key . " FROM " . $table;
$sql = preg_replace('/phpbb_/', $table_prefix, $sql);

$result = $db->sql_query($sql);

if ($result)
{
return (TRUE);
}
else
{
return (FALSE);
}
}

//
// Run a complete SQL-Statement, this can be a array
//
function evaluate_statement($sql_query, $hide = FALSE, $replace = FALSE)
{
global $table_prefix, $remove_remarks, $delimiter, $db;

$errored = FALSE;
if ($replace)
{
$sql_query = preg_replace('/phpbb_/', $table_prefix, $sql_query);
}

$sql_query = $remove_remarks($sql_query);
$sql_query = split_sql_file($sql_query, $delimiter);

$sql_count = count($sql_query);

for($i = 0; $i < $sql_count; $i++)
{
if (!$hide)
{
echo "Running :: " . $sql_query[$i];
}
flush();

if ( !($result = $db->sql_query($sql_query[$i])) )
{
$errored = true;
$error = $db->sql_error();
if (!$hide)
{
echo " -> <b>FAILED</b> ---> <u>" . $error['message'] . "</u><br /><br />\n\n";
}
}
else
{
if (!$hide)
{
echo " -> <b><span class=\"ok\">COMPLETED</span></b><br /><br />\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_module_cache (
module_id mediumint(8) NOT NULL default \'0\',
module_cache_time int(12) NOT NULL default \'0\',
db_cache text NOT NULL,
priority mediumint(8) unsigned NOT NULL default \'0\',
PRIMARY KEY (module_id)
);

CREATE TABLE phpbb_modules (
module_id mediumint(8) unsigned NOT NULL auto_increment,
short_name varchar(100) default NULL,
update_time mediumint(8) NOT NULL default \'0\',
module_order mediumint(8) NOT NULL default \'0\',
active tinyint(2) NOT NULL default \'0\',
perm_all tinyint(2) unsigned NOT NULL default \'1\',
perm_reg tinyint(2) unsigned NOT NULL default \'1\',
perm_mod tinyint(2) unsigned NOT NULL default \'1\',
perm_admin tinyint(2) unsigned NOT NULL default \'1\',
PRIMARY KEY (module_id)
);

CREATE TABLE phpbb_module_info (
module_id mediumint(8) NOT NULL default \'0\',
long_name varchar(100) NOT NULL default \'\',
author varchar(50) default NULL,
email varchar(50) default NULL,
url varchar(100) default NULL,
version varchar(100) NOT NULL default \'\',
update_site varchar(100) default NULL,
extra_info longtext NOT NULL default \'\',
PRIMARY KEY (module_id)
);

CREATE TABLE phpbb_module_group_auth (
module_id mediumint(8) unsigned NOT NULL default \'0\',
group_id mediumint(8) unsigned NOT NULL default \'0\'
);

CREATE TABLE phpbb_stats_config (
config_name varchar(100) NOT NULL default \'\',
config_value varchar(100) NOT NULL default \'\',
PRIMARY KEY (config_name)
);

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\', \'4.2.9\');
INSERT INTO phpbb_stats_config (config_name, config_value) VALUES (\'page_views\', \'0\');
INSERT INTO phpbb_stats_config (config_name, config_value) VALUES (\'stat_index\', \'0\');
INSERT INTO phpbb_stats_config (config_name, config_value) VALUES (\'stat_all_or_one\', \'0\');

CREATE TABLE phpbb_module_admin_panel (
module_id mediumint(8) unsigned NOT NULL default \'0\',
config_name varchar(255) NOT NULL default \'\',
config_value varchar(255) NOT NULL default \'\',
config_type varchar(20) NOT NULL default \'\',
config_title varchar(100) NOT NULL default \'\',
config_explain varchar(100) default NULL,
config_trigger varchar(20) NOT NULL default \'\'
);

CREATE TABLE stats_smilies_index (
code varchar(50) default NULL,
smile_url varchar(100) default NULL,
smile_count mediumint(8) default \'0\'
);

CREATE TABLE stats_smilies_info (
last_post_id mediumint(8) NOT NULL default \'0\',
last_update_time int(12) NOT NULL default \'0\',
update_time mediumint(8) NOT NULL default \'10080\'
);

INSERT INTO stats_smilies_info (last_post_id, last_update_time, update_time) VALUES (0, 0, 10080);

';
}
else if ( ($dbms == "mssql") || ($dbms == "mssql-odbc") )
{
$data = '
';
}
else if ($dbms == 'postgres')
{
$data = '
';
}

return $data;
}

// Read pak file Header
function read_pak_header($fp)
{
$header = fread($fp, 5);
$mpak_header = fread($fp, 4);
if ($mpak_header != 'MPAK')
{
message_die(GENERAL_ERROR, 'Invalid Module Pak File');
}

if (intval($header[0]) < 3)
{
message_die(GENERAL_ERROR, 'Invalid Module Pak File');
}
}

// Read next file from pak file stream
function read_pak_file($stream, $file_ident)
{

$ident = 'ÿüÌ' . $file_ident . 'Ìüÿ';
$end_ident = 'ÌÌÿ' . $file_ident . 'ÿÌÌ';

$begin = strpos($stream, $ident);
$begin += strlen($ident);
$length = strpos($stream, $end_ident);
$length = $length - $begin;

$content = substr($stream, $begin, $length);
return ($content);
}

// parse info file
function parse_info_file($content)
{
$ret_array = array();

$in_block = FALSE;
$block_name = '';
$content = explode("\n", $content);

while (list($key, $data) = @each($content))
{
if (!$in_block)
{
if (preg_match("/\[name\]/", $data))
{
$in_block = TRUE;
$block_name = 'name';
$ret_array[$block_name] = '';
}
else if (preg_match("/\[short_name\]/", $data))
{
$in_block = TRUE;
$block_name = 'short_name';
$ret_array[$block_name] = '';
}
else if (preg_match("/\[author\]/", $data))
{
$in_block = TRUE;
$block_name = 'author';
$ret_array[$block_name] = '';
}
else if (preg_match("/\[email\]/", $data))
{
$in_block = TRUE;
$block_name = 'email';
$ret_array[$block_name] = '';
}
else if (preg_match("/\[url\]/", $data))
{
$in_block = TRUE;
$block_name = 'url';
$ret_array[$block_name] = '';
}
else if (preg_match("/\[version\]/", $data))
{
$in_block = TRUE;
$block_name = 'version';
$ret_array[$block_name] = '';
}
else if (preg_match("/\[stats_mod_version\]/", $data))
{
$in_block = TRUE;
$block_name = 'stats_mod_version';
$ret_array[$block_name] = '';
}
else if (preg_match("/\[update_time\]/", $data))
{
$in_block = TRUE;
$block_name = 'update_time';
$ret_array[$block_name] = '';
}
else if (preg_match("/\[check_update_site\]/", $data))
{
$in_block = TRUE;
$block_name = 'check_update_site';
$ret_array[$block_name] = '';
}
else if (preg_match("/\[extra_info\]/", $data))
{
$in_block = TRUE;
$block_name = 'extra_info';
$ret_array[$block_name] = '';
}
else if (preg_match("/\[admin_panel\]/", $data))
{
$in_block = TRUE;
$block_name = 'admin_panel';
$ret_array[$block_name] = '';
}
}
else
{
if (preg_match("/\[\/" . $block_name . "\]/", $data))
{
$in_block = FALSE;
}
else
{
if ($ret_array[$block_name] != '')
{
$ret_array[$block_name] .= "\n";
}
$ret_array[$block_name] .= trim($data);
}
}
}

return $ret_array;
}

// parse lang file
function parse_lang_file($content, $only_languages = array())
{
$ret_array = array();

$in_block = FALSE;
$block_name = '';
$content = explode("\n", $content);

$choose_lang = (count($only_languages) == 0) ? FALSE : TRUE;

while (list($key, $data) = @each($content))
{
if (!$in_block)
{
if (preg_match("/(.*?)\[lang_(.*?)\]/", $data))
{
$in_block = TRUE;
$block_name = preg_replace("/(.*?)\[(.*?)\]/", "\\2", $data);
$block_name = trim($block_name);
if ($choose_lang)
{
if (in_array($block_name, $only_languages))
{
$ret_array[$block_name] = '';
}
}
else
{
$ret_array[$block_name] = '';
}
}
}
else
{
if (preg_match("/\[\/" . preg_quote($block_name) . "\]/", $data))
{
$in_block = FALSE;
}
else
{
if ($choose_lang)
{
if (in_array($block_name, $only_languages))
{
if ($ret_array[$block_name] != '')
{
$ret_array[$block_name] .= "\n";
}
$ret_array[$block_name] .= trim($data);
}
}
else
{
if ($ret_array[$block_name] != '')
{
$ret_array[$block_name] .= "\n";
}
$ret_array[$block_name] .= trim($data);
}
}
}
}

return $ret_array;
}

function sql_quote($data)
{
$data = str_replace("'", "\'", $data);
return ($data);
}

function install_module($filename, $active)
{
global $phpbb_root_path, $db;
if (!($fp = fopen($filename, 'r')) )
{
die('<br /><b>Unable to open ' . $filename . '</b><br />');
}

read_pak_header($fp);
fclose($fp);

$stream = implode('', @file($filename));
$info_file = read_pak_file($stream, 'INFO');
$lang_file = read_pak_file($stream, 'LANG');
$php_file = read_pak_file($stream, 'MOD');

$info_array = parse_info_file($info_file);
$lang_array = parse_lang_file($lang_file);

$directory = $phpbb_root_path . 'modules/' . trim($info_array['short_name']);

if (!file_exists($directory))
{
@umask(0);
mkdir($directory, 0777);
}
else
{
chmod($directory, 0777);
}

// Write module.php
$module = $directory . '/module.php';

if (file_exists($module))
{
chmod($module, 0777);
}

if (!($fp = fopen($module, 'wt')))
{
die('Unable to write ' . $module);
}

$php_file = trim($php_file);
fwrite($fp, $php_file, strlen($php_file));

fclose($fp);

$short_name = trim($info_array['short_name']);

// Write Language File
@reset($lang_array);
while (list($key, $data) = @each($lang_array))
{
$language = trim($key);
$language_dir = $phpbb_root_path . 'modules/language';
$language_file = $phpbb_root_path . 'modules/language/' . $language . '/lang_modules.php';

if (!file_exists($language_dir))
{
@umask(0);
mkdir($language_dir, 0777);
}
else
{
chmod($language_dir, 0777);
}

if (!file_exists($language_dir . '/' . $language))
{
@umask(0);
mkdir($language_dir . '/' . $language, 0777);
}
else
{
chmod($language_dir . '/' . $language, 0777);
}

if (!file_exists($language_file))
{
$contents = "<?php\n\n\n?>";
}
else
{
chmod($language_file, 0777);
$contents = implode('', @file($language_file));
}

$contents = str_replace('?>', '', $contents);
$contents = trim($contents) . "\n";

// add the BEGIN
$contents .= "\n// [" . $short_name . "]\n";
$contents .= "\$" . $short_name . " = array();\n\n";
// add the language file
$contents = $contents . str_replace('$lang', '$' . $short_name, $data) . "\n";
// add the END and closing tag
$contents .= "// [/" . $short_name . "]\n\n";
$contents .= "?>";

if (!($fp = fopen($language_file, 'wt')))
{
die('Unable to write to: ' . $language_file);
}

fwrite($fp, $contents, strlen($contents));
fclose($fp);

}

// If we have not quit yet, let us add the info to the database too. ;)
$add_info_array = array(
'long_name' => 'name',
'author' => 'author',
'email' => 'email',
'url' => 'url',
'version' => 'version',
'update_site' => 'check_update_site',
'extra_info' => 'extra_info'
);

// determine default update time
$update_time = 0;
if (!isset($info_array['update_time']))
{
$update_time = 0;
}
else if (strstr($info_array['update_time'], 'update_time_from'))
{
$update_time_module = explode("\n", $info_array['update_time']);
$update_time_module = preg_replace("/(.*?)update_time_from(.*?)/", "\\2", $update_time_module[0]);
$update_time_module = trim($update_time_module);

if ($update_time_module != '')
{
$update_time_module = explode("\n", $info_array['update_time']);
$update_time = intval($update_time_module[1]);
}
}
else
{
$update_time = intval($info_array['update_time']);
}

$sql = "SELECT max(module_order) as max_order FROM phpbb_modules;";

if (!($result = evaluate_statement($sql, FALSE, TRUE)))
{
die('Unable to get maximum module order');
}

if ($db->sql_numrows($result) > 0)
{
$row = $db->sql_fetchrow($result);
$next_order = intval($row['max_order']) + 10;
}
else
{
$next_order = 10;
}

// Fill Module Table
$sql = "INSERT INTO phpbb_modules (short_name, update_time, module_order, active)
VALUES ('" . trim($info_array['short_name']) . "', " . $update_time . ", " . $next_order . ", " . $active . ");";

if (!($result = evaluate_statement($sql, FALSE, TRUE)))
{
die('Unable to insert module');
}

$next_module_id = $db->sql_nextid($result);

// Fill Info-Table
$keys = '';
$values = '';
@reset($add_info_array);
while (list($key, $value) = @each($add_info_array))
{
if (!isset($info_array[$value]))
{
$info_bit = '';
}
else
{
if ($value == 'extra_info')
{
$info_bit = trim($info_array[$value]);
}
else
{
$info_bit = explode("\n", $info_array[$value]);
$info_bit = trim($info_bit[0]);
}
}

$keys .= ', ' . $key;
$values .= ', \'' . sql_quote(htmlspecialchars($info_bit)) . '\'';
}

if (($keys == '') || ($values == ''))
{
die('Unable to install Module, too less informations');
}

$keys = 'module_id' . $keys;
$values = $next_module_id . $values;

$sql = "INSERT INTO phpbb_module_info (" . $keys . ") VALUES (" . $values . ");";

if (!($result = evaluate_statement($sql, FALSE, TRUE)))
{
die('Unable to insert module');
}

$sql = "INSERT INTO phpbb_module_cache (module_id, module_cache_time, db_cache, priority)
VALUES (" . $next_module_id . ", 0, '', 0);";

if (!($result = evaluate_statement($sql, FALSE, TRUE)))
{
die('Unable to insert module');
}

if ( (isset($info_array['admin_panel'])) && (trim($info_array['admin_panel']) != '') )
{

$entries = explode("\n", trim($info_array['admin_panel']));

for ($i = 0; $i < count($entries); $i++)
{
$config_array = array();

$vars = explode(' ', $entries[$i]);
for ($j = 0; $j < count($vars); $j++)
{
$values = explode(':', $vars[$j]);
$config_array[trim($values[0])] = trim($values[1]);
}

$sql = "INSERT INTO phpbb_module_admin_panel (module_id, config_name, config_value, config_type, config_title, config_explain, config_trigger)
VALUES (" . $next_module_id . ", '" . $config_array['option'] . "', '" . $config_array['default'] . "', '" . $config_array['type'] . "', '" . $config_array['title'] . "', '" . $config_array['explain'] . "', '" . $config_array['trigger'] . "');";

if (!($result = evaluate_statement($sql, FALSE, TRUE)))
{
die('Unable to insert module config entry');
}
}
}
}

$sql = "SELECT * FROM phpbb_modules";
$sql = preg_replace('/phpbb_/', $table_prefix, $sql);

$result = $db->sql_query($sql);

if ($result)
{
message_die(GENERAL_ERROR, 'Statistics Mod already installed.');
}

// check if the server allows chmodding, if not break the install.
$module_directory = $phpbb_root_path . 'modules';
if (!file_exists($module_directory))
{
@umask(0);
if (!mkdir($module_directory, 0777))
{
die('Your server configuration does not allow creating and / or chmodding folders, you will have to do a part of the install manually.<br />Please look in the Contrib folder for further instructions.<br />');
}
}
else
{
if (!chmod($module_directory, 0777))
{
die('Your server configuration does not allow chmodding folders, you will have to do a part of the install manually.<br />Please look in the Contrib folder for further instructions.<br />');
}
}

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
<!--

font,th,td,p,body { font-family: "Courier New", courier; font-size: 11pt }

a:link,a:active,a:visited { color : #006699; }
a:hover { text-decoration: underline; color : #DD6900;}

hr { height: 0px; border: solid #D1D7DC 0px; border-top-width: 1px;}

.maintitle,h1,h2 {font-weight: bold; font-size: 22px; font-family: "Trebuchet MS",Verdana, Arial, Helvetica, sans-serif; text-decoration: none; line-height : 120%; color : #000000;}

.ok {color:green}

.somenotinstalled {color:red}

/* Fancy form styles for IE */

input, textarea, select {
border-top-width : 1px;
border-right-width : 1px;
border-bottom-width : 1px;
border-left-width : 1px;
}

input { text-indent : 2px; }

input.button {
border-top-width : 1px;
border-right-width : 1px;
border-bottom-width : 1px;
border-left-width : 1px;
}
-->
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#006699" vlink="#5584AA">

<table width="100%" border="0" cellspacing="0" cellpadding="10" align="center">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="../templates/subSilver/images/logo_phpBB.gif" border="0" alt="Forum Home" vspace="1" /></td>
<td align="center" width="100%" valign="middle"><span class="maintitle">Installing Statistics Mod Version 4.2.9</span></td>
</tr>
</table></td>
</tr>
</table>

<br clear="all" />

<?php

// Lets check if the modules directory is there and chmodded correctly
$module_directory = $phpbb_root_path . 'modules';
if ( !@file_exists($module_directory) )
{
die('Directory \'modules\' does not exist, please create it.<br />');
}

if (!is_dir($module_directory))
{
die('The Directory \'modules\' seems to be a file.<br />');
}

if ( !($fp = @fopen($module_directory . '/0_000000.000', 'w')) )
{
die('The Directory \'modules\' is not writeable. Please chmod the directory to 777.');
}
else
{
@fclose($fp);
unlink($module_directory . '/0_000000.000');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/stats_overview.pak'))
{
die('1 modules/pakfiles directory is not installed correctly, stats_overview.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/admin_statistics.pak'))
{
die('2 modules/pakfiles directory is not installed correctly, admin_statistics.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/most_active_topics.pak'))
{
die('3 modules/pakfiles directory is not installed correctly, most_active_topics.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/most_viewed_topics.pak'))
{
die('4 modules/pakfiles directory is not installed correctly, most_viewed_topics.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/most_active_topicstarter.pak'))
{
die('5 modules/pakfiles directory is not installed correctly, most_active_topicstarter.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/most_interesting_topics.pak'))
{
die('6 modules/pakfiles directory is not installed correctly, most_interesting_topics.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/least_interesting_topics.pak'))
{
die('7 modules/pakfiles directory is not installed correctly, least_interesting_topics.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/top_posters.pak'))
{
die('8 modules/pakfiles directory is not installed correctly, top_posters.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/fastest_users.pak'))
{
die('9 modules/pakfiles directory is not installed correctly, fastest_users.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/lastonline.pak'))
{
die('10 modules/pakfiles directory is not installed correctly, lastonline.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/top_posters_month.pak'))
{
die('11 modules/pakfiles directory is not installed correctly, top_posters_month.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/users_by_month.pak'))
{
die('12 modules/pakfiles directory is not installed correctly, users_by_month.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/top_posters_week.pak'))
{
die('13 modules/pakfiles directory is not installed correctly, top_posters_week.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/most_active_polls.pak'))
{
die('14 modules/pakfiles directory is not installed correctly, most_active_polls.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/most_active_pollstarter.pak'))
{
die('15 modules/pakfiles directory is not installed correctly, most_active_pollstarter.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/last_created_posts.pak'))
{
die('16 modules/pakfiles directory is not installed correctly, last_created_posts.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/last_created_topics.pak'))
{
die('17 modules/pakfiles directory is not installed correctly, last_created_topics.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/posts_by_month.pak'))
{
die('18 modules/pakfiles directory is not installed correctly, posts_by_month.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/topics_by_month.pak'))
{
die('19 modules/pakfiles directory is not installed correctly, topics_by_month.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/top_attachments.pak'))
{
die('20 modules/pakfiles directory is not installed correctly, top_attachments.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/top_avatars.pak'))
{
die('21 modules/pakfiles directory is not installed correctly, top_avatars.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/top_shoutbox_poster.pak'))
{
die('22 modules/pakfiles directory is not installed correctly, top_shoutbox_poster.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/top_smilies.pak'))
{
die('23 modules/pakfiles directory is not installed correctly, top_smilies.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/top_words.pak'))
{
die('24 modules/pakfiles directory is not installed correctly, top_words.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/most_ignored_users.pak'))
{
die('25 modules/pakfiles directory is not installed correctly, most_ignored_users.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/private_messages.pak'))
{
die('26 modules/pakfiles directory is not installed correctly, private_messages.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/top_languages.pak'))
{
die('27 modules/pakfiles directory is not installed correctly, top_languages.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/top_styles.pak'))
{
die('28 modules/pakfiles directory is not installed correctly, top_styles.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/most_logged_on_users.pak'))
{
die('29 modules/pakfiles directory is not installed correctly, most_logged_on_users.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/advancedkarma.pak'))
{
die('30 modules/pakfiles directory is not installed correctly, advancedkarma.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/cashmod.pak'))
{
die('31 modules/pakfiles directory is not installed correctly, cashmod.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/genders.pak'))
{
die('32 modules/pakfiles directory is not installed correctly, genders.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/age_statistics.pak'))
{
die('33 modules/pakfiles directory is not installed correctly, age_statistics.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/Activity_Arcade_stats.pak'))
{
die('34 modules/pakfiles directory is not installed correctly, Activity_Arcade_stats.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/Activity_Arcade_All_Time_High_Score_Players.pak'))
{
die('35 modules/pakfiles directory is not installed correctly, Activity_Arcade_All_Time_High_Score_Players.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/Activity_Arcade_Top_xx_Users_Game_Plays.pak'))
{
die('36 modules/pakfiles directory is not installed correctly, Activity_Arcade_Top_xx_Users_Game_Plays.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/Activity_Arcade_Mod_Top_xx_Players.pak'))
{
die('37 modules/pakfiles directory is not installed correctly, Activity_Arcade_Mod_Top_Ten_Players.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/Activity_Arcade_Mod_Top_xx_Games.pak'))
{
die('38 modules/pakfiles directory is not installed correctly, Activity_Arcade_Mod_Top_xx_Games.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/Activity_Arcade_Mod_xx_Newest_Games.pak'))
{
die('39 modules/pakfiles directory is not installed correctly, Activity_Arcade_Mod_xx_Newest_Games.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/genders_evil.pak'))
{
die('40 modules/pakfiles directory is not installed correctly, genders_evil.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/last_created_album_posts.pak'))
{
die('41 modules/pakfiles directory is not installed correctly, last_created_album_posts.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/top_album_posters_ever.pak'))
{
die('42 modules/pakfiles directory is not installed correctly, top_album_posters_ever.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/top_album_posters_this_month.pak'))
{
die('43 modules/pakfiles directory is not installed correctly, top_album_posters_this_month.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/top_album_posters_this_week.pak'))
{
die('44 modules/pakfiles directory is not installed correctly, top_album_posters_this_week.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/most_viewed_photos_ever.pak'))
{
die('45 modules/pakfiles directory is not installed correctly, most_viewed_photos_ever.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/most_viewed_photos_this_month.pak'))
{
die('46 modules/pakfiles directory is not installed correctly, most_viewed_photos_this_month.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/most_viewed_photos_this_week.pak'))
{
die('47 modules/pakfiles directory is not installed correctly, most_viewed_photos_this_week.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/most_active_forums.pak'))
{
die('48 modules/pakfiles directory is not installed correctly, most_active_forums.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/most_least_interesting_topics.pak'))
{
die('49 modules/pakfiles directory is not installed correctly, most_least_interesting_topics.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/posts_by_gender_evil.pak'))
{
die('50 modules/pakfiles directory is not installed correctly, posts_by_gender_evil.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/posts_by_gender_niels.pak'))
{
die('51 modules/pakfiles directory is not installed correctly, posts_by_gender_niels.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/top_countries_ipcountryflags.pak'))
{
die('52 modules/pakfiles directory is not installed correctly, top_countries_ipcountryflags.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/Activity_plus_stats.pak'))
{
die('53 modules/pakfiles directory is not installed correctly, Activity_plus_stats.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/Activity_Plus_Mod_xx_Newest_Games.pak'))
{
die('54 modules/pakfiles directory is not installed correctly, Activity_Plus_Mod_xx_Newest_Games.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/Activity_Plus_Mod_Top_xx_Trophies.pak'))
{
die('55 modules/pakfiles directory is not installed correctly, Activity_Plus_Mod_Top_xx_Trophies.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/Activity_Plus_Mod_Top_xx_Players.pak'))
{
die('56 modules/pakfiles directory is not installed correctly, Activity_Plus_Mod_Top_xx_Players.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/Activity_plus_Mod_Top_xx_Games.pak'))
{
die('57 modules/pakfiles directory is not installed correctly, Activity_plus_Mod_Top_xx_Games.pak is missing.');
}

if (!file_exists($phpbb_root_path.'modules/pakfiles/age_statistics_terrafrost.pak'))
{
die('58 modules/pakfiles directory is not installed correctly, age_statistics_terrafrost.pak is missing.');
}


$mss = '';
echo "<br /><h2>Add Tables and Basic Data...</h2><br /><br />";
$sql_query = fill_new_table_data($dbms);
evaluate_statement($sql_query, FALSE, TRUE);

$active = 1;
echo "<br /><h2>Installing Default Modules...</h2><br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/stats_overview.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/admin_statistics.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/most_active_forums.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/most_active_topics.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/most_viewed_topics.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/most_active_topicstarter.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/most_interesting_topics.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/least_interesting_topics.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/most_least_interesting_topics.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/top_posters.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/fastest_users.pak', $active);

$sql = "SELECT user_totaltime FROM " . USERS_TABLE . " ORDER BY user_totaltime DESC LIMIT 1";
if (!$result = $db->sql_query($sql))
{
$there=0;
}
else
{
$there=1;
}
if ($there == 0)
{
$active = 0;
$mss .= "<li><br />Module 'Last Online' is installed but is set inactive because it requires 'Last Visit Mod' (<a href=\"http://www.phpbbhacks.com/download/237\" target=\"_blank\">http://www.phpbbhacks.com/download/237</a>) to be installed.</li>";
}
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/lastonline.pak', $active);
$active = 1;

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/top_posters_month.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/users_by_month.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/top_posters_week.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/most_active_polls.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/most_active_pollstarter.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/last_created_posts.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/last_created_topics.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/posts_by_month.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/topics_by_month.pak', $active);

if (!file_exists($phpbb_root_path.'attach_rules.php') )
{
$active = 0;
$mss .= "<li><br />Module 'top_attachments' is installed but is set inactive because it requires 'Attachment Mod' (<a href=\"http://www.phpbb.com/phpBB/viewtopic.php?t=74505\" target=\"_blank\">http://www.phpbb.com/phpBB/viewtopic.php?t=74505</a>) to be installed.</li>";
}
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/top_attachments.pak', $active);
$active = 1;

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/top_avatars.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/top_smilies.pak', $active);

if (!file_exists($phpbb_root_path.'shoutbox_max.php') )
{
$active = 0;
$mss .= "<li><br />Module 'top_shoutbox_poster' is installed but is set inactive because it requires 'Fully Integrated Shoutbox' (<a href=\"http://www.phpbbhacks.com/download/1255\" target=\"_blank\">http://www.phpbbhacks.com/download/1255</a>) to be installed.</li>";
}
install_module($phpbb_root_path.'modules/pakfiles/top_shoutbox_poster.pak', $active);
$active = 1;

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/top_words.pak', $active);

$sql = "SELECT user_id FROM " . IGNORE_TABLE ." ORDER BY user_id DESC LIMIT 1";
if (!$result = $db->sql_query($sql))
{
$there=0;
}
else
{
$there=1;
}
if ($there == 0)
{
$active = 0;
$mss .= "<li><br />Module 'most_ignored_users' is installed but is set inactive because it requires 'Ignore Users Mod' (<a href=\"http://www.phpbbhacks.com/download/789\" target=\"_blank\">http://www.phpbbhacks.com/download/789</a>) to be installed.</li>";
}
install_module($phpbb_root_path.'modules/pakfiles/most_ignored_users.pak', $active);
$active = 1;

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/private_messages.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/top_styles.pak', $active);

echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/top_languages.pak', $active);

$sql = "SELECT user_totaltime FROM " . USERS_TABLE . " ORDER BY user_totaltime DESC LIMIT 1";
if (!$result = $db->sql_query($sql))
{
$there=0;
}
else
{
$there=1;
}
if ($there == 1)
{
$sql="UPDATE ". USERS_TABLE ." SET user_totaltime=0";
if (!$result = $db->sql_query($sql))
{$there=0;}
else {$there=1;}
}
if ($there == 0)
{
$active = 0;
$mss .= "<li><br />Module 'most_logged_on_users' is installed but is set inactive because it requires 'Last Visit Mod' (<a href=\"http://www.phpbbhacks.com/download/237\" target=\"_blank\">http://www.phpbbhacks.com/download/237</a>) to be installed.</li>";
}
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/most_logged_on_users.pak', $active);
$active = 1;

$sql = "SELECT karma_plus FROM " . USERS_TABLE . " ORDER BY karma_plus DESC LIMIT 1";
if (!$result = $db->sql_query($sql))
{
$there=0;
}
else
{
$there=1;
}
if ($there == 0)
{
$active = 0;
$mss .= "<li><br />Module 'advancedkarma' is installed but is set inactive because it requires 'Advanced Karma Mod' (<a href=\"http://siava.ru/forum/topic168.html\" target=\"_blank\">http://siava.ru/forum/topic168.html</a>) to be installed.</li>";
}
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/advancedkarma.pak', $active);
$active = 1;

$sql = "SELECT cash_dbfield FROM " . $table_prefix . "cash ORDER BY cash_id DESC LIMIT 1";
if (!$result = $db->sql_query($sql))
{
$there=0;
}
else
{
$there=1;
}
if ($there == 0)
{
$active = 0;
$mss .= "<li><br />Module 'cash' is installed but is set inactive because it requires 'Cash Mod' (<a href=\"http://xore.ca/blog/projects/cashmod/\" target=\"_blank\">http://xore.ca/blog/projects/cashmod/</a>) to be installed.</li>";
}
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/cashmod.pak', $active);
$active = 1;

if (!file_exists($phpbb_root_path.'templates/subSilver/images/icon_minigender_female.gif'))
{
$there=0;
}
else
{
$there=1;
}
if ($there == 0)
{
$active = 0;
$mss .= "<li><br />Module 'Genders' and module 'Posts by Gender' are installed but are set inactive because they requires 'Gender Mod' made by Niels Chr. Denmark (<a href=\"http://phpbbhacks.com/download/182\" target=\"_blank\">http://phpbbhacks.com/download/182</a>) to be installed.</li>";
}
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/genders.pak', $active);
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/posts_by_gender_niels.pak', $active);
$active = 1;

if (!file_exists($phpbb_root_path.'templates/subSilver/images/gender_f.gif'))
{
$there=0;
}
else
{
$there=1;
}
if ($there == 0)
{
$active = 0;
$mss .= "<li><br />Module 'Genders (eviL3)' and module 'Posts by Gender_(eviL3)' are installed but are set inactive because it requires 'Gender MOD' made by eviL3 (<a href=\"http://www.phpbb.com/phpBB/viewtopic.php?t=467168\" target=\"_blank\">http://www.phpbb.com/phpBB/viewtopic.php?t=467168</a>) to be installed.</li>";
}
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/genders_evil.pak', $active);
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/posts_by_gender_evil.pak', $active);
$active = 1;

$sql = "SELECT user_next_birthday_greeting FROM " . USERS_TABLE . " ORDER BY user_id DESC LIMIT 1";
if (!$result = $db->sql_query($sql))
{
$there=0;
}
else
{
$there=1;
}
if ($there == 0)
{
$active = 0;
$mss .= "<li><br />Module 'Age Statistics' is installed but is set inactive because it requires 'Birthday Hack' (<a href=\"http://www.phpbbhacks.com/viewhack.php?id=187\" target=\"_blank\">http://www.phpbbhacks.com/viewhack.php?id=187</a>) to be installed.</li>";
}
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/age_statistics.pak', $active);
$active = 1;

if (!$board_config['bday_max'])
{
$there=0;
}
else
{
$there=1;
}
if ($there == 0)
{
$active = 0;
$mss .= "<li><br />Module 'Age Statistics TerraFrost' is installed but is set inactive because it requires 'Birthday Hack from TerraFrost' (<a href=\"http://www.phpbbhacks.com/download/6698\" target=\"_blank\">http://www.phpbbhacks.com/download/6698</a>) to be installed.</li>";
}
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/age_statistics_terrafrost.pak', $active);
$active = 1;

// Activity / Arcade Stats
$sql = "SELECT at_first_places FROM " . iNA_USER_DATA;
if (!$result = $db->sql_query($sql))
{
$there=0;
}
else
{
$there=1;
}
if ($there == 0)
{
$active = 0;
$mss .= "<li><br />Module 'Activity / Arcade Mod Stats' is installed but is set inactive because it requires 'Arcade_MOD_v2.1.2' (<a href=\"http://www.phpbb-arcade.com/download.php?id=421\" target=\"_blank\">http://www.phpbb-arcade.com/download.php?id=421</a>) to be installed.</li>";
$mss .= "<li><br />Module 'Activity / Arcade All Time High Score Players ' is installed but is set inactive because it requires 'Arcade_MOD_v2.1.2' (<a href=\"http://www.phpbb-arcade.com/download.php?id=421\" target=\"_blank\">http://www.phpbb-arcade.com/download.php?id=421</a>) to be installed.</li>";
$mss .= "<li><br />Module 'Activity / Arcade Mod Top xx Players' is installed but is set inactive because it requires 'Arcade_MOD_v2.1.2' (<a href=\"http://www.phpbb-arcade.com/download.php?id=421\" target=\"_blank\">http://www.phpbb-arcade.com/download.php?id=421</a>) to be installed.</li>";
$mss .= "<li><br />Module 'Activity / Arcade Mod Top xx Games' is installed but is set inactive because it requires 'Arcade_MOD_v2.1.2' (<a href=\"http://www.phpbb-arcade.com/download.php?id=421\" target=\"_blank\">http://www.phpbb-arcade.com/download.php?id=421</a>) to be installed.</li>";
$mss .= "<li><br />Module 'Activity / Arcade Mod Newest xx Games' is installed but is set inactive because it requires 'Arcade_MOD_v2.1.2' (<a href=\"http://www.phpbb-arcade.com/download.php?id=421\" target=\"_blank\">http://www.phpbb-arcade.com/download.php?id=421</a>) to be installed.</li>";
$mss .= "<li><br />Module 'Activity / Arcade Mod Top xx Users (Game Plays)' is installed but is set inactive because it requires 'Arcade_MOD_v2.1.2' (<a href=\"http://www.phpbb-arcade.com/download.php?id=421\" target=\"_blank\">http://www.phpbb-arcade.com/download.php?id=421</a>) to be installed.";
}
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/Activity_Arcade_stats.pak', $active);
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/Activity_Arcade_All_Time_High_Score_Players.pak', $active);
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/Activity_Arcade_Mod_Top_xx_Players.pak', $active);
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/Activity_Arcade_Mod_Top_xx_Games.pak', $active);
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/Activity_Arcade_Mod_xx_Newest_Games.pak', $active);
echo "<br /><br />";
// Arcade paks that need database installation and file editting
$active = 0;
install_module($phpbb_root_path.'modules/pakfiles/Activity_Arcade_Top_xx_Users_Game_Plays.pak', $active);
$mss .= "<br /><img src='../images/smiles/icon_exclaim.gif' border='0' /> Module pak Activity_Arcade_Top_xx_Users_Game_Plays.pak has more install instruktions, take a look in /modules/pakfiles/Install_Activity_Mod_Top_10_Users_Game_Plays</li>";
$active = 1;

$sql = "SELECT pic_user_id, pic_username, pic_time, pic_user_id, pic_cat_id FROM " . ALBUM_TABLE;
if (!$result = $db->sql_query($sql))
{
$there=0;
}
else
{
$there=1;
}
if ($there == 0)
{
$active = 0;
$mss .= "<li><br />Modules:
<br />'Last Created Album Posts'
<br />'Top album posters ever'
<br />'Top album posters this month'
<br />'Top album posters this week'
<br />'Most Viewed Photos Ever'
<br />'Most Viewed Photos this Month'
<br />'Most Viewed Photos this Week'
<br />are installed but are set inactive because it requires 'Smartor Photo Album' (<a href=\"http://smartor.is-root.com/viewforum.php?f=7\" target=\"_blank\">http://smartor.is-root.com/viewforum.php?f=7</a>) or 'Full Album Pack' (<a href=\"http://www.mightygorgon.com/viewforum.php?f=682\" target=\"_blank\">http://www.mightygorgon.com/viewforum.php?f=682</a>)to be installed.</li>";
}
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/last_created_album_posts.pak', $active);
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/top_album_posters_ever.pak', $active);
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/top_album_posters_this_month.pak', $active);
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/top_album_posters_this_week.pak', $active);
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/most_viewed_photos_ever.pak', $active);
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/most_viewed_photos_this_month.pak', $active);
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/most_viewed_photos_this_week.pak', $active);
$active = 1;

$sql = "SELECT iso3661_1 FROM " . CF_ISO_TABLE ." LIMIT 1";
if (!$result = $db->sql_query($sql))
{
$there=0;
}
else
{
$there=1;
}
if ($there == 0)
{
$active = 0;
$mss .= "<li><br />Module 'Top Countries (IpCountryFlags)' is installed but is set inactive because it requires IpCountryFlags (<a href=\"http://www.you3d.net/ip2/index.php\" target=\"_blank\">http://www.you3d.net/ip2/index.php</a></li>";
}
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/top_countries_ipcountryflags.pak', $active);
$active = 1;


// Activity / Arcade Stats
$sql = "SELECT user_trophies FROM " . USERS_TABLE;
if (!$result = $db->sql_query($sql))
{
$there=0;
}
else
{
$there=1;
}
if ($there == 0)
{
$active = 0;
$mss .= "<li><br />Module 'Activity plus stats' is installed but is set inactive because it requires Activity Mod Plus_v1.1.0 (<a href=\"http://phpbb-amod.com/down_db.php?page=cat&id=14\" target=\"_blank\">http://phpbb-amod.com/down_db.php?page=cat&id=14</a>) to be installed.</li>";
$mss .= "<li><br />Module 'Activity Plus Mod xx Newest Games' is installed but is set inactive because it requires Activity Mod Plus_v1.1.0 (<a href=\"http://phpbb-amod.com/down_db.php?page=cat&id=14\" target=\"_blank\">http://phpbb-amod.com/down_db.php?page=cat&id=14</a>) to be installed.</li>";
$mss .= "<li><br />Module 'Activity Plus Mod Top xx Trophies' is installed but is set inactive because it requires Activity Mod Plus_v1.1.0 (<a href=\"http://phpbb-amod.com/down_db.php?page=cat&id=14\" target=\"_blank\">http://phpbb-amod.com/down_db.php?page=cat&id=14</a>) to be installed.</li>";
$mss .= "<li><br />Module 'Activity Plus Mod Top xx Players' is installed but is set inactive because it requires Activity Mod Plus_v1.1.0 (<a href=\"http://phpbb-amod.com/down_db.php?page=cat&id=14\" target=\"_blank\">http://phpbb-amod.com/down_db.php?page=cat&id=14</a>) to be installed.</li>";
$mss .= "<li><br />Module 'Activity Plus Mod Top xx Games' is installed but is set inactive because it requires Activity Mod Plus_v1.1.0 (<a href=\"http://phpbb-amod.com/down_db.php?page=cat&id=14\" target=\"_blank\">http://phpbb-amod.com/down_db.php?page=cat&id=14</a>) to be installed.</li>";
}
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/Activity_plus_stats.pak', $active);
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/Activity_Plus_Mod_xx_Newest_Games.pak', $active);
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/Activity_Plus_Mod_Top_xx_Trophies.pak', $active);
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/Activity_Plus_Mod_Top_xx_Players.pak', $active);
echo "<br /><br />";
install_module($phpbb_root_path.'modules/pakfiles/Activity_plus_Mod_Top_xx_Games.pak', $active);
$active = 1;

// We do not need this any longer, unset for safety purposes
unset($dbpasswd);


echo "<table border=\"2\"><tr><td><b><span class=\"somenotinstalled\"><ul>".$mss."</ul></span></b></td></tr></table>";
echo '<br /><br /><b>Finished... now first DELETE the install folder.</b><br /><br />Then go see your <a href="../statistics.php">BoardStatistics</a>';

?>

Dillon
09-25-2008, 09:27 PM
hello...? does anyone ever go on this forum...?