Wollte gerade den Map-Mod installiert. In der install.txt steht:
## Autor Hinweise:
## DIESER MOD MUß MIT DEM MOD-INSTALLER "EASYMOD" INSTALLIERT WERDEN.
OK, gesagt getan.... nur war der irgendwie nicht willig die SQL-Änderung vorzunehmen. Jetzt will ich dass manuell machen.
Ist dies die Richtige Datei? db_install?
Wenn ja, welchen Teil davon muß ich ins SQL-Feld einfügen?
Code: Alles auswählen
<?php
define('IN_PHPBB', 1);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'config.'.$phpEx);
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/constants.'.$phpEx);
include($phpbb_root_path . 'includes/db.'.$phpEx);
function map_glob ($pattern) {
$path_parts = pathinfo ($pattern);
$pattern = '^' . str_replace (array ('*', '?'), array ('(.+)', '(.)'), $path_parts['basename'] . '$');
$dir = opendir (".{$path_parts['dirname']}/");
while ($file = readdir ($dir)) {
if (ereg ($pattern, $file)) $result[] = "{$path_parts['dirname']}/$file";
}
closedir ($dir);
return $result;
}
$base_queries = array(
"CREATE TABLE " . $table_prefix . "map_mod_map (
id smallint NOT NULL auto_increment,
name varchar(50) NOT NULL default '',
filename varchar(100) NOT NULL default '',
north float NOT NULL default '0',
east float NOT NULL default '0',
south float NOT NULL default '0',
west float NOT NULL default '0',
PRIMARY KEY (id)
)",
"CREATE TABLE " . $table_prefix . "map_mod_user (
user_id mediumint(8) NOT NULL default '0',
longitude float NOT NULL default '0',
latitude float NOT NULL default '0',
PRIMARY KEY (user_id)
)",
"CREATE TABLE " . $table_prefix . "map_mod_country (
id smallint NOT NULL auto_increment,
name varchar(100) NOT NULL default '',
PRIMARY KEY (id)
)",
"CREATE TABLE " . $table_prefix . "map_mod_config (
config_name varchar(255) NOT NULL default '',
config_value varchar(255) NOT NULL default '',
PRIMARY KEY (config_name)
)",
"CREATE TABLE " . $table_prefix . "map_mod_place (
country smallint NOT NULL,
place varchar(50) NOT NULL default '',
latitude float NOT NULL default '0',
longitude float NOT NULL default '0',
zipcode int NOT NULL default '0',
KEY idx_country_place (country, place)
)",
"CREATE TABLE " . $table_prefix . "map_mod_text (
id int(11) NOT NULL auto_increment,
text varchar(50) NOT NULL default '',
longitude float NOT NULL default '0',
latitude float NOT NULL default '0',
map_id int(11) NOT NULL default '0',
url varchar(200) NOT NULL default '',
target varchar(20) NOT NULL default '',
icon varchar(50) NOT NULL default '',
PRIMARY KEY (id)
)",
//default configuration values
"INSERT INTO " . $table_prefix . "map_mod_config VALUES ('default_map', '1')",
"INSERT INTO " . $table_prefix . "map_mod_config VALUES ('flag', 'images/map/flags/map_flag.png')",
"INSERT INTO " . $table_prefix . "map_mod_config VALUES ('flag_self', 'images/map/flags/map_flag_self.png')",
"INSERT INTO " . $table_prefix . "map_mod_config VALUES ('flag_highlight', 'images/map/flags/map_flag_highlight.png')",
"INSERT INTO " . $table_prefix . "map_mod_config VALUES ('flag_multiple', 'images/map/flags/map_flag.png')",
"INSERT INTO " . $table_prefix . "map_mod_config VALUES ('users_near', '10')",
"INSERT INTO " . $table_prefix . "map_mod_config VALUES ('flag_offset_x', '0')",
"INSERT INTO " . $table_prefix . "map_mod_config VALUES ('flag_offset_y', '0')",
"INSERT INTO " . $table_prefix . "map_mod_config VALUES ('max_picture_width', '600')",
"INSERT INTO " . $table_prefix . "map_mod_config VALUES ('max_picture_height', '600')",
"INSERT INTO " . $table_prefix . "map_mod_config VALUES ('move_percent', '40')",
"INSERT INTO " . $table_prefix . "map_mod_config VALUES ('cluster_distance', '5')",
"INSERT INTO " . $table_prefix . "map_mod_config VALUES ('users_near_more', '50')",
"INSERT INTO " . $table_prefix . "map_mod_config VALUES ('auth_view', '0')",
"INSERT INTO " . $table_prefix . "map_mod_config VALUES ('use_overlib', '1')",
"INSERT INTO " . $table_prefix . "map_mod_config VALUES ('overlib_path', '.')",
//default map
"INSERT INTO " . $table_prefix . "map_mod_map VALUES ('0', 'Germany', 'images/map/map_germany.png', '55.1', '15.0', '47.29', '5.85')"
);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
//
//
// Restrict to members:
if( !$userdata['session_logged_in'] )
{
header("Location: " . append_sid("login.$phpEx?redirect=db_install.$phpEx", true));
exit;
}
//
//
if (!( $userdata['user_level'] == ADMIN ))
{
message_die(GENERAL_MESSAGE, $lang['Not_Authorised'], $lang['Not_Authorised']);
exit;
}
?>
<html>
<head>
<title>Map MOD :: Database Installation</title>
</head>
<body>
<h1>Map MOD :: Database Installation</h1>
<hr />
<?
if (isset($HTTP_GET_VARS['install'])) {
// include the to be installed DB part
$db_file=$HTTP_GET_VARS['install'];
$base_install=($db_file=='base');
if ($base_install) {
$queries=$base_queries;
}
else {
$queries=file($db_file);
}
$success = true;
for ($index=0; $index<count($queries); $index++) {
$query=$queries[$index];
// run the given query
if (!$db->sql_query($query)) {
echo '<font color="red">An error occurred!<br />';
echo mysql_error();
echo '</font><br />';
$success = false;
break;
}
if ((($index % 500) == 0) or ($index == count($queries)-1)) {
echo "<font color=\"green\">Executed $index queries.<br /></font>";
flush();
}
}
if ($success) {
echo '<font color="green"><p>Database changes were successful.</p></font>';
}
}
if (!isset($HTTP_GET_VARS['install'])) {
echo '<h3>Step 1 - Base installation</h3>
<p>This will create the necessary tables for the Map MOD.<br />
<a href="?install=base">Start the base installation</a>.<br />
Do NOT start the base installation a second time!</p>';
}
?>
<h3>Step 2 - Clean up</h3>
<p>You should delete this database installer as soon as possible after performing the initial database installation!</p>
<h3> Step 3 - Admin Panel</h3>
<p>Finally you should go to the <a href="<?echo append_sid("admin/index.$phpEx");?>">administration panel</a> and perform these steps:
<ul>
<li>Check the configuration of the map MOD. In most cases the default configuration is fine.</li>
<li>Add maps to the MOD. The map of Germany (where I come from) is installed by default.</li>
<li>Import search places for countries so that your users can lookup their home town.</li>
</ul>
</p>
<p>
Have fun,
<a href="http://www.bananeweizen.de">Bananeweizen</a>
</p>
</body>
</html>
Gruß
Rockford