Yellow Card + easyMOD, problem z baza danych

Jeśli masz problem z nie autoryzowaną modyfikacją, nie możesz jej zainstalować lub występują błędy po jej instalacji to pisz w tym dziale.
gumis_pl
Posty: 4
Rejestracja: 01 stycznia 2006, 11:51

Yellow Card + easyMOD, problem z baza danych

Post autor: gumis_pl » 01 stycznia 2006, 12:05

Witam.
Mam "mały" problemik z instalacją modu Yellow Cards.
Zainstalowałem sobie easyMOD 0.3 a następnie za pomocą easyMOD zacząłem instalację Yellow Cards.

Wystąpił jednak problem podczas instalacji:

SQL PROCESSING ERROR:
No SQL alterations will be performed. However, you may skip SQL processing, continue installing the MOD, and deal with the SQL manually

The following error occured:

Error:
Unknown SQL command "COPY", statement: 1

SQL:
copy yellow_card_db_update.php to yellow_card_db_update.php execute yellow_card_db_update.php delete yellow_card_db_update.php
Teraz gdy chcę wejść do jakiegoś działu wyskakuje:
Failed obtaining forum access control lists

DEBUG MODE

SQL Error : 1054 Unknown column 'a.auth_ban' in 'field list'

SELECT a.forum_id, a.auth_view, a.auth_read, a.auth_post, a.auth_reply, a.auth_edit, a.auth_delete, a.auth_sticky, a.auth_announce, a.auth_vote, a.auth_pollcreate, a.auth_ban, a.auth_greencard, a.auth_bluecard, a.auth_mod FROM phpbb_auth_access a, phpbb_user_group ug WHERE ug.user_id = 3 AND ug.user_pending = 0 AND a.group_id = ug.group_id AND a.forum_id = 15

Line : 173
File : auth.php
Jak się domyślam problem wynika z tego iż w bazie nie utowrzyłem odpowiednich tabel.
Jakie to mają być tabele ?

W pliku yellow_card_db_update.php jest coś takiego:

Kod: Zaznacz cały

<?php
#########################################################
## SQL commands to phpBB2
## Author: Niels Chr. Rřd
## Nickname: Niels Chr. Denmark
## Web: http://mods.db9.dk
## Email: ncr@db9.dk
##
## Ver 1.0.9
##
## 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);
###################################################################################################
##
## 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 '.FORUMS_TABLE.' ADD auth_ban TINYINT (2) not null DEFAULT "3"',
'ALTER TABLE '.FORUMS_TABLE.' ADD auth_greencard TINYINT (2) not null DEFAULT "5"',
'ALTER TABLE '.FORUMS_TABLE.' ADD auth_bluecard TINYINT (2) not null DEFAULT "1"',
'ALTER TABLE '.AUTH_ACCESS_TABLE.' ADD auth_ban TINYINT (1) not null DEFAULT "0"',
'ALTER TABLE '.AUTH_ACCESS_TABLE.' ADD auth_greencard TINYINT (1) not null DEFAULT "0"',
'ALTER TABLE '.AUTH_ACCESS_TABLE.' ADD auth_bluecard TINYINT (1) not null DEFAULT "0"',
'INSERT INTO '.CONFIG_TABLE.' (config_name, config_value) VALUES ("bluecard_limit", "3")',
'INSERT INTO '.CONFIG_TABLE.' (config_name, config_value) VALUES ("bluecard_limit_2", "1")',
'INSERT INTO '.CONFIG_TABLE.' (config_name, config_value) VALUES ("max_user_bancard", "10")',
'INSERT INTO '.CONFIG_TABLE.' (config_name, config_value) VALUES ("report_forum", "0")',
'ALTER TABLE '.USERS_TABLE.' ADD user_warnings SMALLINT (5) DEFAULT "0"',
'ALTER TABLE '.POSTS_TABLE.' ADD post_bluecard TINYINT (1)'
);


$mods = array ( 
'Yellow Card Mod','Yellow Card Mod','Yellow Card Mod','Yellow Card Mod','Yellow Card Mod',
'Yellow Card Mod','Yellow Card Mod','Yellow Card Mod','Yellow Card Mod','Yellow Card Mod',
'Yellow Card Mod','Yellow Card 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 this Mod</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); 
?>
Próbowałem wgrywać to do bazy jako zapytanie ale wywala błedy.
Mógłby ktoś podać gotowy kod który musiałbym wykonać w bazie ?

Z góry dziękuję za odpowiedź

Awatar użytkownika
Duch Forum
Posty: 356
Rejestracja: 15 maja 2005, 10:33
Lokalizacja: Duszniki
Kontakt:

Post autor: Duch Forum » 01 stycznia 2006, 13:02

Kod: Zaznacz cały

ALTER TABLE `phpbb_forums` ADD auth_ban TINYINT (2) not null DEFAULT "3", 
ALTER TABLE `phpbb_forums` ADD auth_greencard TINYINT (2) not null DEFAULT "5", 
ALTER TABLE `phpbb_forums` ADD auth_bluecard TINYINT (2) not null DEFAULT "1", 
ALTER TABLE `phpbb_auth_access` ADD auth_ban TINYINT (1) not null DEFAULT "0", 
ALTER TABLE `phpbb_auth_access` ADD auth_greencard TINYINT (1) not null DEFAULT "0", 
ALTER TABLE `phpbb_auth_access` ADD auth_bluecard TINYINT (1) not null DEFAULT "0", 
INSERT INTO `phpbb_config` (config_name, config_value) VALUES ("bluecard_limit", "3"), 
INSERT INTO `phpbb_config` (config_name, config_value) VALUES ("bluecard_limit_2", "1"), 
INSERT INTO `phpbb_config` (config_name, config_value) VALUES ("max_user_bancard", "10"), 
INSERT INTO `phpbb_config` (config_name, config_value) VALUES ("report_forum", "0"), 
ALTER TABLE `phpbb_users` ADD user_warnings SMALLINT (5) DEFAULT "0", 
ALTER TABLE `phpbb_posts` ADD post_bluecard TINYINT (1)
O to chyba chodzi.

gumis_pl
Posty: 4
Rejestracja: 01 stycznia 2006, 11:51

Post autor: gumis_pl » 01 stycznia 2006, 13:41

Dzięki działa :D
Tylko zamiast "," na końcu dawałem ";" bo coś mu nie pasowało 8)

Zablokowany

Wróć do „Pomoc”