har phpbb 2.0.19
men när jag skall köra album_db_install.php (har även skickat upp album_mysql.sql)
får jag bara "phpbb: Kritiskt fel" "Could not connect to the database"
det felmeddelandet kommer från includes/db.php
tror jag, det är det enda stället den texten finns
testade bara för att se ett annat "db_install.php" och det funkade utan problem
(har ju gjort ett flertal sådana här datbasuppdateringar tidigare utan problem)
så orsaken gissar jag är är i album_db_install.php
några förslag?
dallas
klistrar för säkerhets skull in båda filerna nedan
Kod: Markera allt
<?php
/***************************************************************************
* album_db_install.php
* -------------------
* begin : Sunday, February 02, 2003
* copyright : (C) 2003 Smartor
* email : smartor_xp@hotmail.com
*
* $Id: album_db_install.php,v 1.0 2003/02/02 12:41:19 ngoctu Exp $
*
***************************************************************************/
/***************************************************************************
*
* 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.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path.'extension.inc');
include($phpbb_root_path.'common.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
include($phpbb_root_path.'includes/db.'.$phpEx);
?>
<!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}
-->
</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 align="center" width="100%" valign="middle"><span class="maintitle">Installing Photo Album Addon for phpBB2</span></td>
</tr>
</table></td>
</tr>
</table>
<br clear="all" />
<?php
//
// Here we go
//
include($phpbb_root_path.'includes/sql_parse.'.$phpEx);
$available_dbms = array(
"mysql" => array(
"SCHEMA" => "album_mysql",
"DELIM" => ";",
"DELIM_BASIC" => ";",
"COMMENTS" => "remove_remarks"
),
"mysql4" => array(
"SCHEMA" => "album_mysql",
"DELIM" => ";",
"DELIM_BASIC" => ";",
"COMMENTS" => "remove_remarks"
),
"mssql" => array(
"SCHEMA" => "album_mssql",
"DELIM" => "GO",
"DELIM_BASIC" => ";",
"COMMENTS" => "remove_comments"
),
"mssql-odbc" => array(
"SCHEMA" => "album_mssql",
"DELIM" => "GO",
"DELIM_BASIC" => ";",
"COMMENTS" => "remove_comments"
),
"postgres" => array(
"LABEL" => "PostgreSQL 7.x",
"SCHEMA" => "album_postgres",
"DELIM" => ";",
"DELIM_BASIC" => ";",
"COMMENTS" => "remove_comments"
)
);
$dbms_file = $available_dbms[$dbms]['SCHEMA'] . '.sql';
$remove_remarks = $available_dbms[$dbms]['COMMENTS'];;
$delimiter = $available_dbms[$dbms]['DELIM'];
$delimiter_basic = $available_dbms[$dbms]['DELIM_BASIC'];
if ( !($fp = @fopen($dbms_file, 'r')) )
{
message_die(GENERAL_MESSAGE, "Can't open " . $dbms_file);
}
fclose($fp);
//
// process db schema & basic
//
$sql_query = @fread(@fopen($dbms_file, 'r'), @filesize($dbms_file));
$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++)
{
echo "Running :: " . $sql_query[$i];
flush();
if ( !($result = $db->sql_query($sql_query[$i])) )
{
$errored = true;
$error = $db->sql_error();
echo " -> <b>FAILED</b> ---> <u>" . $error['message'] . "</u><br /><br />\n\n";
}
else
{
echo " -> <b><span class=\"ok\">COMPLETED</span></b><br /><br />\n\n";
}
}
$message = '';
if ( $errored )
{
$message .= '<br />Some queries failed. Please contact me at <a href="http://smartor.is-root.com">http://smartor.is-root.com</a> we may solve your problems...<br />To Undo the changes to your database please execute album_db_uninstall.php.';
}
else
{
$message .= '<br />Photo Album Tables generated successfully. To Undo the changes to your database please execute album_db_uninstall.php';
}
echo "\n<br />\n<b>COMPLETE!</b><br />\n";
echo $message . "<br />";
echo "<br /><b>NOW DELETE THIS FILE</b><br />\n";
echo "</body>";
echo "</html>";
?>Kod: Markera allt
#
# Photo Album Addon v2.x.x for phpBB 2.0.x - MySQL schema & basic (by Smartor)
#
CREATE TABLE phpbb_album (
pic_id int(11) UNSIGNED NOT NULL auto_increment,
pic_filename varchar(255) NOT NULL,
pic_thumbnail varchar(255),
pic_title varchar(255) NOT NULL,
pic_desc text,
pic_user_id mediumint(8) NOT NULL,
pic_username varchar(32),
pic_user_ip char(8) NOT NULL DEFAULT '0',
pic_time int(11) UNSIGNED NOT NULL,
pic_cat_id mediumint(8) UNSIGNED NOT NULL DEFAULT '1',
pic_view_count int(11) UNSIGNED NOT NULL DEFAULT '0',
pic_lock tinyint(3) NOT NULL DEFAULT '0',
pic_approval tinyint(3) NOT NULL DEFAULT '1',
PRIMARY KEY (pic_id),
KEY pic_cat_id (pic_cat_id),
KEY pic_user_id (pic_user_id),
KEY pic_time (pic_time));
CREATE TABLE phpbb_album_rate (
rate_pic_id int(11) UNSIGNED NOT NULL,
rate_user_id mediumint(8) NOT NULL,
rate_user_ip char(8) NOT NULL,
rate_point tinyint(3) UNSIGNED NOT NULL,
KEY rate_pic_id (rate_pic_id),
KEY rate_user_id (rate_user_id),
KEY rate_user_ip (rate_user_ip),
KEY rate_point (rate_point));
CREATE TABLE phpbb_album_comment (
comment_id int(11) UNSIGNED NOT NULL auto_increment,
comment_pic_id int(11) UNSIGNED NOT NULL,
comment_user_id mediumint(8) NOT NULL,
comment_username varchar(32),
comment_user_ip char(8) NOT NULL,
comment_time int(11) UNSIGNED NOT NULL,
comment_text TEXT,
comment_edit_time int(11) UNSIGNED,
comment_edit_count smallint(5) UNSIGNED NOT NULL DEFAULT '0',
comment_edit_user_id mediumint(8),
PRIMARY KEY(comment_id),
KEY comment_pic_id (comment_pic_id),
KEY comment_user_id (comment_user_id),
KEY comment_user_ip (comment_user_ip),
KEY comment_time (comment_time));
CREATE TABLE phpbb_album_cat (
cat_id mediumint(8) UNSIGNED NOT NULL auto_increment,
cat_title varchar(255) NOT NULL,
cat_desc text,
cat_order mediumint(8) NOT NULL,
cat_view_level tinyint(3) NOT NULL DEFAULT '-1',
cat_upload_level tinyint(3) NOT NULL DEFAULT '0',
cat_rate_level tinyint(3) NOT NULL DEFAULT '0',
cat_comment_level tinyint(3) NOT NULL DEFAULT '0',
cat_edit_level tinyint(3) NOT NULL DEFAULT '0',
cat_delete_level tinyint(3) NOT NULL DEFAULT '2',
cat_view_groups varchar(255),
cat_upload_groups varchar(255),
cat_rate_groups varchar(255),
cat_comment_groups varchar(255),
cat_edit_groups varchar(255),
cat_delete_groups varchar(255),
cat_moderator_groups varchar(255),
cat_approval tinyint(3) NOT NULL DEFAULT '0',
PRIMARY KEY (cat_id),
KEY cat_order (cat_order));
CREATE TABLE phpbb_album_config (
config_name varchar(255) NOT NULL,
config_value varchar(255) NOT NULL,
PRIMARY KEY (config_name));
INSERT INTO phpbb_album_config VALUES ('max_pics', '1024');
INSERT INTO phpbb_album_config VALUES ('user_pics_limit', '50');
INSERT INTO phpbb_album_config VALUES ('mod_pics_limit', '250');
INSERT INTO phpbb_album_config VALUES ('max_file_size', '128000');
INSERT INTO phpbb_album_config VALUES ('max_width', '800');
INSERT INTO phpbb_album_config VALUES ('max_height', '600');
INSERT INTO phpbb_album_config VALUES ('rows_per_page', '3');
INSERT INTO phpbb_album_config VALUES ('cols_per_page', '4');
INSERT INTO phpbb_album_config VALUES ('fullpic_popup', '1');
INSERT INTO phpbb_album_config VALUES ('thumbnail_quality', '50');
INSERT INTO phpbb_album_config VALUES ('thumbnail_size', '125');
INSERT INTO phpbb_album_config VALUES ('thumbnail_cache', '1');
INSERT INTO phpbb_album_config VALUES ('sort_method', 'pic_time');
INSERT INTO phpbb_album_config VALUES ('sort_order', 'DESC');
INSERT INTO phpbb_album_config VALUES ('jpg_allowed', '1');
INSERT INTO phpbb_album_config VALUES ('png_allowed', '1');
INSERT INTO phpbb_album_config VALUES ('gif_allowed', '0');
INSERT INTO phpbb_album_config VALUES ('desc_length', '512');
INSERT INTO phpbb_album_config VALUES ('hotlink_prevent', '0');
INSERT INTO phpbb_album_config VALUES ('hotlink_allowed', 'smartor.is-root.com');
INSERT INTO phpbb_album_config VALUES ('personal_gallery', '0');
INSERT INTO phpbb_album_config VALUES ('personal_gallery_private', '0');
INSERT INTO phpbb_album_config VALUES ('personal_gallery_limit', '10');
INSERT INTO phpbb_album_config VALUES ('personal_gallery_view', '-1');
INSERT INTO phpbb_album_config VALUES ('rate', '1');
INSERT INTO phpbb_album_config VALUES ('rate_scale', '10');
INSERT INTO phpbb_album_config VALUES ('comment', '1');
INSERT INTO phpbb_album_config VALUES ('gd_version', '1');
INSERT INTO phpbb_album_config VALUES ('album_version', '.0.53');



