Pagina 1 van 1

Foutje, MySQL :(

Geplaatst: 20 sep 2004, 19:55
door Ibot
Ik heb de Activity mod geinstalleerd, alle bestanden heb ik ge-edit, maar ik moest ook de mod_install.php even runnen.

Toen ik dit deed kreeg ik dit:

Code: Selecteer alles

Information
Database type    :: mysql
This mod only works with version 2.0.6 or above of phpBB.
Ik draai phpbb versie 2.0.10


De mod_install.php ziet er zo uit, iemand een idee hoe ik de sql via mijn phpmyadmin kan toevoegen? en wat ik dan op welke manier moet doen?

Code: Selecteer alles

<?php
/***************************************************************************
 *                               mod_install.php
 *                            -------------------
 *   begin                : Sunday, June 27th, 2004
 *   copyright            : (C) 2004 Free Game
 *   email                : defenders_realm@yahoo.com
 *
 *   $Id: mod_install.php,v 1.0.2 2004/06/27 12:59:59 dEfEndEr Exp $
 *
 *	Credits to Napoleon & Whoo.
 ***************************************************************************/

/***************************************************************************
 *
 *   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.
 *
 ***************************************************************************/
 
function _sql($sql, &$errored, &$error_ary, $echo_dot = true)
{
	global $db;

	if (!($result = $db->sql_query($sql)))
	{  
		$errored = true;
		$error_ary['sql'][] = (is_array($sql)) ? $sql[$i] : $sql;
		$error_ary['error_code'][] = $db->sql_error();
	}

	if ($echo_dot)
	{
		echo '.';
		flush();
	}

	return $result;
}

define('IN_PHPBB', 1);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'config.'.$phpEx);
include($phpbb_root_path . 'includes/constants.'.$phpEx);
include($phpbb_root_path . 'includes/db.'.$phpEx);
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//

if (!$userdata['session_logged_in'])
{
	header('Location: ' . append_sid("login.$phpEx?redirect=mod_install.$phpEx", true));
}

if ($userdata['user_level'] != ADMIN)
{
	message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
}

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Mod Installation</title>
<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}

/* Import the fancy styles for IE only (NS4.x doesn't use the @import function) */
@import	url("templates/subSilver/formIE.css"); 
-->
</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">Mod Installation</span></td>
			</tr>
		</table></td>
	</tr>
</table>

<br	clear="all" />

<h2>Information</h2>

<?php

echo '<p>Database type &nbsp; &nbsp;:: <b>' . SQL_LAYER . '</b><br />' . "\n";

$sql = "SELECT config_value  
	FROM " . CONFIG_TABLE . " 
	WHERE config_name = 'version'";
if (!($result = $db->sql_query($sql)))
{
	die("Couldn't obtain version info");
}

$row = $db->sql_fetchrow($result);

$sql = array();

if ($row['config_value'] < '.0.6')
{
	echo 'This mod only works with version 2.0.6 or above of phpBB.<br />';
	exit();
}

echo 'phpBB version &nbsp; &nbsp;:: <b>2' . $row['config_value'] . '</b></p>' . "\n";

if(!defined(iNA))
{
	define('iNA', $table_prefix.'ina_data');
	define('iNA_GAMES', $table_prefix.'ina_games');
	define('iNA_SCORES', $table_prefix.'ina_scores');
	define('iNA_AT_SCORES', $table_prefix.'ina_at_scores');
	define('iNA_SESSIONS', $table_prefix.'ina_sessions');
}
$sql[] = "CREATE TABLE " . iNA . " ( version VARCHAR(255) DEFAULT NULL )";

$sql[] = "CREATE TABLE " . iNA_GAMES . " (
							`game_id` mediumint(9) NOT NULL auto_increment, 
							`cat_id` mediumint(8) default NULL,
							`game_name` varchar(25) default NULL, 
							`game_path` varchar(255) default NULL, 
							`image_path` varchar(255) default NULL, 
							`game_desc` varchar(255) default NULL, 
							`game_charge` int(11) unsigned default '0', 
							`game_reward` int(11) unsigned NOT NULL default '0', 
							`game_bonus` smallint(5) unsigned default '0', 
							`game_use_gl` tinyint(3) unsigned default '0', 
							`game_flash` tinyint(1) unsigned NOT NULL default '0', 
							`game_show_score` tinyint(1) NOT NULL default '1',
							`game_avail` tinyint(1) unsigned default '1',
							`allow_guest` tinyint(1) unsigned default '0', 
							`win_width` smallint(6) NOT NULL default '0', 
							`win_height` smallint(6) NOT NULL default '0', 
							`highscore_limit` int(11) default NULL, 
							`reverse_list` tinyint(1) NOT NULL default '0', 
							`played` int(10) unsigned NOT NULL default '0', 
							`instructions` text, PRIMARY KEY (`game_id`) )";

$sql[] = "CREATE TABLE " . iNA_SCORES . " (
							`game_name` varchar(255) default NULL, 
							`player_id` mediumint(8) default NULL, 
							`score` int(10) unsigned NOT NULL default '0', 
							`date` int(11) default NULL )";

$sql[] = "CREATE TABLE " . iNA_AT_SCORES . " (
							`game_name` varchar(255) default NULL, 
							`player_id` mediumint(8) default NULL, 
							`score` int(10) unsigned NOT NULL default '0', 
							`date` int(11) default NULL )";

$sql[] = "CREATE TABLE " . iNA_SESSIONS . " (
							`session_id` varchar(32) default NULL,
							`user_id` mediumint(8) NOT NULL default '0',
							`start_time` int(11) NOT NULL default '0',
							`session_ip` varchar(8) NOT NULL default '',
							`page` int(1) NOT NULL default '0',
							`game_name` varchar(25) default NULL,
							`user_ip` varchar(16) default '0',
							`ip_name` varchar(255) default NULL)";

$sql[] = "INSERT INTO " . iNA . " VALUES ('v2.0.4')";

$sql[] = "INSERT INTO " . iNA_GAMES . " (`game_id`, `game_name`, `game_path`, `image_path`, `game_desc`, `game_charge`, `game_reward`, `game_bonus`, `game_use_gl`, `game_flash`, `game_show_score`, `win_width`, `win_height`, `highscore_limit`, `reverse_list`, `played`, `instructions`, `game_avail`, `allow_guest`, `cat_id`) VALUES (1, 'donkeykong', 'games/donkeykong/', '', 'The Classic - Donkey Kong', 0, 0, 0, 0, 1, 1, 448, 600, 0, 0, 0, 'CLICK where it says \'Press Space Bar To Start\' to start the game :(', 1, 1, NULL)";

$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('default_reward_dbfield','')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('default_cash','')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('use_rewards_mod','0')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('use_cash_system','0')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('report_cheater','0')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('warn_cheater','0')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('use_point_system','0')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('use_gamelib','0')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('games_path','')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('gamelib_path','')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('use_gk_shop','0')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('use_allowance_system','0')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('games_per_page','20')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('games_default_img','templates/subSilver/images/games.gif')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('games_default_txt','More games available to Registered Members - No Fee - No Catch.<br />')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('games_default_id','0')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('games_offline','0')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('games_cheat_mode','1')";

echo '<h2>Updating database schema & data</h2>' . "\n";
echo '<p>Progress :: <b>';
flush();

$error_ary = array();
$errored = false;
if (count($sql))
{
	for($i = 0; $i < count($sql); $i++)
	{
		_sql($sql[$i], $errored, $error_ary);
	}

	echo '</b> <b class="ok">Done</b><br />Result &nbsp; :: ' . "\n";

	if ($errored)
	{
		echo '<b>Some queries failed, the statements and errors are listing below</b>' . "\n";
		echo '<ul>';

		for($i = 0; $i < count($error_ary['sql']); $i++)
		{
			echo '<li>Error :: <b>' . $error_ary['error_code'][$i]['message'] . '</b><br />';
			echo 'SQL &nbsp; :: <b>' . $error_ary['sql'][$i] . '</b><br /><br /></li>';
		}

		echo '</ul>' . "\n";
		echo '<p>Contact me so I can fix the errors.</p>' . "\n";
		exit();
	}
	else
	{
		echo '<b>No errors</b>' . "\n";
	}
}

echo '<h2>Install completed</h2>' . "\n";
echo 'You can now delete this file. To undo any changes run the mod_uninstall.php file.';
?>

<br	clear="all" />

</body>
</html>

Geplaatst: 20 sep 2004, 19:58
door Podium4
Open mod_install.php,

verwijder:

Code: Selecteer alles

if ($row['config_value'] != '.0.6')
{
	echo 'This mod only works with version 2.0.6 of phpBB.<br />';
	exit();
}

Geplaatst: 20 sep 2004, 19:59
door Ibot
dat staat er niet in :(

*edit

Sorry, ik zie het nu wel staan, alleen me zoekfunctie van homesite vond het niet

*edit 2

Thanq!

Had het zelf kunnen verzinnen :bier: stom man!

Bedankt podium4!

Geplaatst: 20 sep 2004, 20:03
door Podium4
hmm blijkbaar heb je een andere versie van de acitivity mod dan ik. Nu de mod_install.php file er staat is het ook niet zo moeilijk te vinden...

Code: Selecteer alles

if ($row['config_value'] < '.0.6') 
{ 
   echo 'This mod only works with version 2.0.6 or above of phpBB.<br />'; 
   exit(); 
}

tja

Geplaatst: 21 sep 2004, 19:51
door svenn
bij deze mod zieden ze me op phphacks.com dat je de common.php moets hebben van 2.0.8 en dan werkte alles ...

svennson