Birthday Hack macht bei Install schon schlapp

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
Levare
Mitglied
Beiträge: 22
Registriert: 20.04.2004 02:04

Birthday Hack macht bei Install schon schlapp

Beitrag von Levare »

Moin.

Wollte heute mal in meinem Forum ( http://trommelfeuer.umeon.de ) den beliebten Birthday Hack installieren. Aber schon am Anfang läufts schief. :-? :cry:

Habe alle Dateien in mein PHPbb-Verzeichnis kopiert, wie es in der Anleitung steht:

"copy birthday_db_update.php to birthday_db_update.php
copy root/birthday_popup.php to birthday_popup.php
copy root/templates/subSilver/greeting_popup.tpl to templates/subSilver/greeting_popup.tpl
# This MOD need a database update.
# Then, as you must have now copied the birthday_db_update.php file
# in your phpBB root directory, run it with your navigator...
# http://www.yourWebSite.xxx/phpbbRootDir ... update.php"


So. Dann gebe ich www.umeon.de/phpbb/birthday_db_update.php ein, und es erscheint folgende Fehlermeldung:

"Warning: mysql_connect(): Access denied for user: 'np116@localhost' (Using password: YES) in /home/www/np116/html/phpbb/db/mysql4.php on line 48

Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /home/www/np116/html/phpbb/db/mysql4.php on line 330

Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource in /home/www/np116/html/phpbb/db/mysql4.php on line 331
phpBB : Kritischer Fehler

Could not connect to the database "


Anscheinend kriegt er keine Verbindung zu Datenbank hin. Im Quelltext dieser Datei finde ich allerdings auch nichts, wo ich sowas eintragen könnte. Habt ihr ne Idee?

Danke für Hilfen!

Levare
Fähnchen
Ehemaliges Teammitglied
Beiträge: 2124
Registriert: 14.08.2004 23:38

Beitrag von Fähnchen »

Bist du als Admin eingeloggt wenn du das Script ausführen willst?

Funktioniert das Board sonst einwandfrei?
Die Signatur hat Urlaub.
Levare
Mitglied
Beiträge: 22
Registriert: 20.04.2004 02:04

Beitrag von Levare »

Das Board funktioniert sonst. Aber was meinst du damit, dass ich als Admin eingelogged sein soll? Wenn ich oben im Browser diese Adresse eingebe, ist das doch eh ein eigener Prozess, oder?
Benutzeravatar
Amdosh
Mitglied
Beiträge: 1011
Registriert: 21.10.2003 08:03

Beitrag von Amdosh »

Die meisten Datenbankupdates erfordern, dass der Admin frisch im Board eingeloggt ist, ist eine Sicherheitsfunktion, dass kein fremder es ausführen kann, der sich "nur" Zugang auf den FTP verschafft hat.

Grüsse Amdosh
Internetweisheiten:
Nutze die Fehlersuche, bringt schnellere Ergebnisse als ewig zu warten
Suche in der Foren/Doku(suche), sehr viele Dinge stehen oft genug zur sofortigen Verfügung.
Levare
Mitglied
Beiträge: 22
Registriert: 20.04.2004 02:04

Beitrag von Levare »

Ok, im Forum als Admin eingelogged, oben Adresse eingegeben, gleicher Fehler. :cry:
Fähnchen
Ehemaliges Teammitglied
Beiträge: 2124
Registriert: 14.08.2004 23:38

Beitrag von Fähnchen »

Kannst du mal den Quelltext der birthday_db_update.php die du verwendest verlinken?

Eine php-Datei zum Download bereitstellen
Zuletzt geändert von Fähnchen am 14.12.2004 18:56, insgesamt 1-mal geändert.
Die Signatur hat Urlaub.
Levare
Mitglied
Beiträge: 22
Registriert: 20.04.2004 02:04

Beitrag von Levare »

Der Inhalt sieht so aus:

<?php
#########################################################
## SQL commands to phpBB2
## Author: Niels Chr. Rød
## Nickname: Niels Chr. Denmark
## Email: ncr@db9.dk
##
## Ver 1.0.7
##
## phpBB2 database update script for mods
## this file is intended to use with phpBB2, when installing mods
## after so you may delete this file, but only admin can use so it really doesen't matter
## The script will look what prefix you are using, and use the existing DB defined by congig.php
## The execution of this script's included SQL is harmless, so you can run it as meny times you like
## note, though that the users last visit, will be set back to his/her last login,
## but that is a minor cosmetic isue, that will correct it self next time the use logs in
##
## the following example are from my mods, and you can add some self, for other mods if you like
## you will after execution get a list over those commands that are run with succes and those with warnings !
## delete the sample lines if you are using it only for other mods
##
#########################################################

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
define('SITE_HISTORY_TABLE', $table_prefix.'site_history');

###################################################################################################
##
## put the SQL commands below here, the SQL commands listed below are only exampels, substitude them with the one you need ##
##
###################################################################################################
$sql=array(
'ALTER TABLE '.USERS_TABLE.' ADD user_birthday INT DEFAULT "999999" not null ',
'ALTER TABLE '.USERS_TABLE.' ADD user_next_birthday_greeting INT DEFAULT "0" not null ',
'INSERT INTO '.CONFIG_TABLE.' (config_name, config_value) VALUES ("birthday_required", "0")',
'INSERT INTO '.CONFIG_TABLE.' (config_name, config_value) VALUES ("birthday_greeting", "1")',
'INSERT INTO '.CONFIG_TABLE.' (config_name, config_value) VALUES ("max_user_age", "100")',
'INSERT INTO '.CONFIG_TABLE.' (config_name, config_value) VALUES ("min_user_age", "5")',
'INSERT INTO '.CONFIG_TABLE.' (config_name, config_value) VALUES ("birthday_check_day", "7")'
);

$mods = array (
'Birthday PART 1 Mod','Birthday PART 1 Mod','Birthday PART 2 Mod','Birthday PART 2 Mod','Birthday PART 2 Mod','Birthday PART 2 Mod','Birthday PART 2 Mod',
);

############################################### Do not change anything below this line #######################################

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

if ($userdata['user_level']!=ADMIN)
message_die(GENERAL_ERROR, "You are not Authorised to do this");
$n=0;
$message="<b>This list is a result of the SQL queries needed for the additional mods in the pre-moded pack</b><br/><br/>";
while($sql[$n])
{
$message .= ($mods[$n-1] != $mods[$n]) ? '<p><b><font size=3>'.$mods[$n].'</font></b><br/>' : '';
if(!$result = $db->sql_query($sql[$n]))
$message .= '<b><font color=#FF0000>[Already added]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />';
else $message .='<b><font color=#0000fF>[Added/Updated]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />';
$n++;
}
message_die(GENERAL_MESSAGE, $message);
Fähnchen
Ehemaliges Teammitglied
Beiträge: 2124
Registriert: 14.08.2004 23:38

Beitrag von Fähnchen »

Wenn es mit dem Installionsscript nicht funktioniert versuche doch die Änderungen an der Datenbank manuell durchzuführen. Gehe dazu z.B. in phpMyAdmin, wähle deine Datenbank aus, gehe auf SQL und führe dann folgendes in der Datenbank aus:
ALTER TABLE phpbb_users ADD user_birthday INT DEFAULT "999999" not null;
ALTER TABLE phpbb_users ADD user_next_birthday_greeting INT DEFAULT "0" not null;
INSERT INTO phpbb_config (config_name, config_value) VALUES ("birthday_required", "0");
INSERT INTO phpbb_config (config_name, config_value) VALUES ("birthday_greeting", "1");
INSERT INTO phpbb_config (config_name, config_value) VALUES ("max_user_age", "100");
INSERT INTO phpbb_config (config_name, config_value) VALUES ("min_user_age", "5");
INSERT INTO phpbb_config (config_name, config_value) VALUES ("birthday_check_day", "7");
Falls du einen anderen Präfix als phpbb_ benutzt hast musst du das noch dementsprechend anpassen!

Das würde dein Problem den Birthday-Hack zum Laufen zu kriegen lösen, aber nicht die Ursache beheben.
Die Signatur hat Urlaub.
Antworten

Zurück zu „phpBB 2.0: Mod Support“