Navigation
Supportsider
Senest Online
flj02:01:12
helmuth19:58:48
orgermer 1 Dag
AlexF 1 Dag
HenningS 2 Uger
Niller 2 Uger
kobm 2 Uger
inga 3 Uger
gittedl 3 Uger
Henrik Bendtsen 4 Uger
Besøgende
Gæster online: 5

Brugere online: 0

Antal brugere: 179
Nyeste bruger: Michael Mogensen
Se indlæg
PHP-Fusion - Danmark » PHP-Fusion version 7 » MODs & Infusioner v7
 Udskriv debat
Oprettelse af tabeller i V7
egonbj
Jeg er lidt i gang med at konvertere nogle infusioner til version 7, og selvom jeg ikke helt har forstået brugen af infusions_db.php vil jeg alligevel forsøge at bruge den.
Jeg kan dog ikke få oprettet tabellerne i en af infusionerne, og kan ikke helt gennemskue hvad der går galt.
Først indholdet i infusion.php


/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright © 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: infusion.php
| Author: INSERT NAME HERE
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

$inf_folder = "my_booking"; // The folder in which the infusion resides.

include INFUSIONS.$inf_folder."/infusion_db.php";

// Check if locale file is available matching the current site locale setting.
if (file_exists(INFUSIONS.$inf_folder."/locale/".$settings['locale'].".php")) {
   // Load the locale file matching the current site locale setting.
   include INFUSIONS.$inf_folder."/locale/".$settings['locale'].".php";
} else {
   // Load the infusion's default locale file.
   include INFUSIONS.$inf_folder."/locale/English.php";
}


// Infusion general information
$inf_title = $locale['book_title'];
$inf_description = $locale['book_desc'];
$inf_version = "7.0";
$inf_developer = "Egon Jessen";
$inf_email = "egon@myphp.dk";
$inf_weburl = "http://www.myphp.dk";


$inf_newtable_[1] = DB_BOOKING_KONTAKT."(
kontakt_id smallint(6) UNSIGNED NOT NULL AUTO_INCREMENT,
bruger_id smallint(6) UNSIGNED NOT NULL DEFAULT '0',
navn varchar(100) NOT NULL DEFAULT '',
adresse varchar(150) NOT NULL DEFAULT '',
post_nr varchar(10) NOT NULL DEFAULT '',
town varchar(100) NOT NULL DEFAULT '',
telefon varchar(25) NOT NULL DEFAULT '',
mobil varchar(25) NOT NULL DEFAULT '',
email varchar(100) NOT NULL DEFAULT '',
sms_saldo smallint(6) UNSIGNED NOT NULL DEFAULT '0',
sms_godkendt varchar(25) NOT NULL DEFAULT '',
mail_godkendt varchar(25) NOT NULL DEFAULT '',
sex varchar(25) NOT NULL DEFAULT '',
birthday varchar(25) NOT NULL DEFAULT '',
remark text default NULL,
PRIMARY KEY  (kontakt_id)
) TYPE=MyISAM;";


$inf_newtable_[2] = DB_BOOKING_TYPE." (
type_id smallint(6) UNSIGNED NOT NULL AUTO_INCREMENT,
type_navn varchar(100) NOT NULL DEFAULT '',
type_pris varchar(25) NOT NULL DEFAULT '',
tekst varchar(200) NOT NULL DEFAULT '',
type_type varchar(100) NOT NULL DEFAULT '',
klip_antal smallint(6) UNSIGNED NOT NULL DEFAULT '0',
open varchar(25) NOT NULL DEFAULT '',
PRIMARY KEY  (type_id)
) TYPE=MyISAM;";

$inf_newtable_[3] = DB_BOOKING_MEDLEM." (
medlem_id smallint(6) UNSIGNED NOT NULL AUTO_INCREMENT,
kontakt_id smallint(6) UNSIGNED NOT NULL DEFAULT '0',
type_id smallint(6) UNSIGNED NOT NULL DEFAULT '0',
indmeldt_dato int(14) UNSIGNED NOT NULL DEFAULT '0',
medlem_navn varchar(100) NOT NULL DEFAULT '',
klip_saldo smallint(6) UNSIGNED NOT NULL DEFAULT '0',
godkendt varchar(25) NOT NULL DEFAULT '',
remark text default NULL,
PRIMARY KEY  (medlem_id)
) TYPE=MyISAM;";

$inf_newtable_[4] = DB_BOOKING_SETTINGS." (
settings_id smallint(6) UNSIGNED NOT NULL AUTO_INCREMENT,
klub_navn varchar(100) NOT NULL DEFAULT '',
adresse varchar(150) NOT NULL DEFAULT '',
post_nr varchar(10) NOT NULL DEFAULT '',
town varchar(100) NOT NULL DEFAULT '',
email varchar(100) NOT NULL DEFAULT '',
telefon varchar(100) NOT NULL DEFAULT '',
mobil varchar(100) NOT NULL DEFAULT '',
cvr varchar(25) NOT NULL DEFAULT '',
bank varchar(100) NOT NULL DEFAULT '',
reg_nr varchar(100) NOT NULL DEFAULT '',
konto_nr varchar(100) NOT NULL DEFAULT '',
use_sms varchar(25) NOT NULL DEFAULT '',
sms_bruger varchar(100) NOT NULL DEFAULT '',
sms_password varchar(100) NOT NULL DEFAULT '',
mail_emne varchar(100) NOT NULL DEFAULT '',
sms_add_booking int(25) UNSIGNED NOT NULL DEFAULT '0',
sms_saldo_start int(25) UNSIGNED NOT NULL DEFAULT '0',
sms_enhed_pris int(25) UNSIGNED NOT NULL DEFAULT '0',
sms_counter int(25) UNSIGNED NOT NULL DEFAULT '0',
sms_saldo int(25) UNSIGNED NOT NULL DEFAULT '0',
sms_max_lenght int(25) UNSIGNED NOT NULL DEFAULT '160',
PRIMARY KEY  (settings_id)
) TYPE=MyISAM;";


$inf_newtable_[5] = DB_BOOKING_GRUPPE." (
gruppe_id smallint(6) UNSIGNED NOT NULL AUTO_INCREMENT,
type_id smallint(6) UNSIGNED NOT NULL DEFAULT '0',
gruppe_navn varchar(100) NOT NULL DEFAULT '',
tekst varchar(200) NOT NULL DEFAULT '',
PRIMARY KEY  (gruppe_id)
) TYPE=MyISAM;";

$inf_newtable_[6] = DB_BOOKING_KONTAKT_GRUPPE." (
kg_id smallint(6) UNSIGNED NOT NULL AUTO_INCREMENT,
gruppe_id smallint(6) UNSIGNED NOT NULL DEFAULT '0',
kontakt_id smallint(6) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY  (kg_id)
) TYPE=MyISAM;";


$inf_newtable_[7] = DB_BOOKING_SLETTET." (
slettet_id smallint(6) UNSIGNED NOT NULL AUTO_INCREMENT,
medlem_id smallint(6) UNSIGNED NOT NULL DEFAULT '0',
type_id smallint(6) UNSIGNED NOT NULL DEFAULT '0',
kontakt_id smallint(6) UNSIGNED NOT NULL DEFAULT '0',
bruger_id smallint(6) UNSIGNED NOT NULL DEFAULT '0',
indmeldt_dato int(14) UNSIGNED NOT NULL DEFAULT '0',
udmeldt_dato int(14) UNSIGNED NOT NULL DEFAULT '0',
medlem_navn varchar(100) NOT NULL DEFAULT '',
betal_type varchar(100) NOT NULL DEFAULT '',
type_navn varchar(100) NOT NULL DEFAULT '',
type_pris varchar(25) NOT NULL DEFAULT '',
navn varchar(100) NOT NULL DEFAULT '',
adresse varchar(150) NOT NULL DEFAULT '',
post_nr varchar(10) NOT NULL DEFAULT '',
town varchar(100) NOT NULL DEFAULT '',
telefon varchar(25) NOT NULL DEFAULT '',
mobil varchar(25) NOT NULL DEFAULT '',
email varchar(100) NOT NULL DEFAULT '',
PRIMARY KEY  (slettet_id)
) TYPE=MyISAM;";


$inf_newtable_[8] = DB_BOOKING_KLIP_REGNING." (
klip_regning_id smallint(6) UNSIGNED NOT NULL AUTO_INCREMENT,
medlem_id smallint(6) UNSIGNED NOT NULL DEFAULT '0',
kontakt_id smallint(6) UNSIGNED NOT NULL DEFAULT '0',
tekst varchar(100) NOT NULL DEFAULT '',
dato_opret int(14) UNSIGNED NOT NULL DEFAULT '0',
dato_betalt int(14) UNSIGNED NOT NULL DEFAULT '0',
saldo smallint(6) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY  (klip_regning_id)
) TYPE=MyISAM;";


$inf_newtable_[9] = DB_BOOKING_BOOKING." (
booking_id smallint(5) unsigned NOT NULL auto_increment,
udstyr_id smallint(5) unsigned NOT NULL default '0',
user_id smallint(6) unsigned NOT NULL default '0',
user_navn varchar(100) NOT NULL default '',
booking_start int(25) unsigned NOT NULL default '0',
booking_slut int(25) unsigned NOT NULL default '0',
mobil varchar(25) NOT NULL DEFAULT '',
ev_id SMALLINT(5) unsigned NOT NULL default '0',
remark text default NULL,
dato_opret int(25) unsigned NOT NULL default '0',
PRIMARY KEY  (booking_id)
) TYPE=MyISAM;";


$inf_newtable_[10] = DB_BOOKING_UDSTYR."(
udstyr_id SMALLINT(5) unsigned NOT NULL auto_increment,
tekst varchar(255) NOT NULL DEFAULT '',
email varchar(100) NOT NULL default '',
mobil varchar(25) NOT NULL default '',
online varchar(25) NOT NULL default '',
aw_booking varchar(25) NOT NULL default '',
sendmail varchar(25) NOT NULL default '',
sendsms varchar(25) NOT NULL default '',
ansvarlig varchar(100) NOT NULL default '',
ud_gr_id SMALLINT(5) unsigned NOT NULL default '0',
remark text default NULL,
PRIMARY KEY (udstyr_id)
) TYPE=MyISAM;";

$inf_newtable_[11] = DB_BOOKING_UDSTYR_GRUPPER." (
udstyr_gruppe_id SMALLINT(5) unsigned NOT NULL auto_increment,
udstyr_id SMALLINT(5) unsigned NOT NULL default '0',
gruppe_id SMALLINT(5) unsigned NOT NULL default '0',
PRIMARY KEY (udstyr_gruppe_id)
) TYPE=MyISAM;";


$inf_newtable_[12] = DB_BOOKING_MAIL." (
mail_id SMALLINT(5) unsigned NOT NULL auto_increment,
booking_id SMALLINT(5) unsigned NOT NULL default '0',
fra_bruger_id SMALLINT(5) unsigned NOT NULL default '0',
til_bruger_id SMALLINT(5) unsigned NOT NULL default '0',
dato_opret int(25) unsigned NOT NULL default '0',
tekst text default NULL,
PRIMARY KEY (mail_id)
) TYPE=MyISAM;";

$inf_newtable_[13] = DB_BOOKING_KVITTERING." (
kvittering_id SMALLINT(5) unsigned NOT NULL auto_increment,
mail_id SMALLINT(5) unsigned NOT NULL default '0',
tekst varchar(100) NOT NULL default '',
dato_opret int(25) unsigned NOT NULL default '0',
PRIMARY KEY (kvittering_id)
) TYPE=MyISAM;";

$inf_newtable_[14] = DB_BOOKING_SHOUT." (
shout_id SMALLINT(5) unsigned NOT NULL auto_increment,
shout_name varchar(50) NOT NULL default '',
shout_message varchar(255) NOT NULL default '',
shout_datestamp int(10) unsigned NOT NULL default '0',
shout_ip varchar(20) NOT NULL default '',
PRIMARY KEY (shout_id)
) TYPE=MyISAM;";

$inf_newtable_[15] = DB_BOOKING_SMS." (
sms_id SMALLINT(5) unsigned NOT NULL auto_increment,
booking_id SMALLINT(5) unsigned NOT NULL default '0',
fra_bruger_id SMALLINT(5) unsigned NOT NULL default '0',
til_bruger_id SMALLINT(5) unsigned NOT NULL default '0',
til_mobil varchar(25) NOT NULL DEFAULT '',
dato_opret int(25) unsigned NOT NULL default '0',
tekst text default NULL,
PRIMARY KEY (sms_id)
) TYPE=MyISAM;";

$inf_newtable_[16] = DB_BOOKING_UD_GR." (
ud_gr_id SMALLINT(5) unsigned NOT NULL auto_increment,
gruppe_navn varchar(100) NOT NULL DEFAULT '',
tekst varchar(200) NOT NULL DEFAULT '',
PRIMARY KEY (ud_gr_id)
) TYPE=MyISAM;";


$inf_droptable_[1] = DB_BOOKING_KONTAKT;

$inf_droptable_[2] = DB_BOOKING_TYPE;

$inf_droptable_[3] = DB_BOOKING_MEDLEM;

$inf_droptable_[4] = DB_BOOKING_SETTINGS;

$inf_droptable_[5] = DB_BOOKING_GRUPPE;

$inf_droptable_[6] = DB_BOOKING_KONTAKT_GRUPPE;

$inf_droptable_[7] = DB_BOOKING_SLETTET;

$inf_droptable_[8] = DB_BOOKING_KLIP_REGNING;

$inf_droptable_[9] = DB_BOOKING_BOOKING;

$inf_droptable_[10] = DB_BOOKING_UDSTYR;

$inf_droptable_[11] = DB_BOOKING_UDSTYR_GRUPPER;

$inf_droptable_[12] = DB_BOOKING_MAIL;

$inf_droptable_[13] = DB_BOOKING_KVITTERING;

$inf_droptable_[14] = DB_BOOKING_SHOUT;

$inf_droptable_[15] = DB_BOOKING_SMS;

$inf_droptable_[16] = DB_BOOKING_UD_GR;


$inf_sitelink[1] = array(
   "title" => $locale['book_link1'],
   "url" => "start.php",
   "visibility" => "0"
);
?>


og så indholdet i infusion_db.php



/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright © 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: infusion_db.php
| Author: INSERT NAME HERE
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

//table 1
if (!defined("DB_BOOKING_KONTAKT")) {
   define("DB_BOOKING_KONTAKT", DB_PREFIX."my_booking_kontakt");
}

//table 2
if (!defined("DB_BOOKING_TYPE")) {
   define("DB_BOOKING_TYPE", DB_PREFIX."my_booking_type");
}

//table 3
if (!defined("DB_BOOKING_MEDLEM")) {
   define("DB_BOOKING_MEDLEM", DB_PREFIX."my_booking_medlem");
}

//table 4
if (!defined("DB_BOOKING_SETTINGS")) {
   define("DB_BOOKING_SETTINGS", DB_PREFIX."my_booking_type");
}

//table 5
if (!defined("DB_BOOKING_GRUPPE")) {
   define("DB_BOOKING_GRUPPE", DB_PREFIX."my_booking_gruppe");
}

//table 6
if (!defined("DB_BOOKING_KONTAKT_GRUPPE")) {
   define("DB_BOOKING_KONTAKT_GRUPPE", DB_PREFIX."my_booking_kontakt_gruppe");
}

//table 7
if (!defined("DB_BOOKING_SLETTET")) {
   define("DB_BOOKING_SLETTET", DB_PREFIX."my_booking_slettet");
}

//table 8
if (!defined("DB_BOOKING_KLIP_REGNING")) {
   define("DB_BOOKING_KLIP_REGNING", DB_PREFIX."my_booking_klip_regning");
}

//table 9
if (!defined("DB_BOOKING_BOOKING")) {
   define("DB_BOOKING_BOOKING", DB_PREFIX."my_booking_booking");
}

//table 10
if (!defined("DB_BOOKING_UDSTYR")) {
   define("DB_BOOKING_UDSTYR", DB_PREFIX."my_booking_udstyr");
}

//table 11
if (!defined("DB_BOOKING_UDSTYR_GRUPPER")) {
   define("DB_BOOKING_UDSTYR_GRUPPER", DB_PREFIX."my_booking_udstyr_grupper");
}

//table 12
if (!defined("DB_BOOKING_MAIL")) {
   define("DB_BOOKING_MAIL", DB_PREFIX."my_booking_booking_mail");
}

//table 13
if (!defined("DB_BOOKING_KVITTERING")) {
   define("DB_BOOKING_KVITTERING", DB_PREFIX."my_booking_booking_kvittering");
}

//table 14
if (!defined("DB_BOOKING_SHOUT")) {
   define("DB_BOOKING_SHOUT", DB_PREFIX."my_booking_shout");
}

//table 15
if (!defined("DB_BOOKING_SMS")) {
   define("DB_BOOKING_SMS", DB_PREFIX."my_booking_booking_sms");
}

//table 16
if (!defined("DB_BOOKING_UD_GR")) {
   define("DB_BOOKING_UD_GR", DB_PREFIX."my_booking_ud_gr");
}
?>

Redigeret af egonbj d. 14-07-2008 21:49
 
www.myphp.dk
egonbj
Har løst problemet med oprettelsen.
i V6 bruges der $inf_newtable_[1]
og i V7 $inf_newtable[1]
uden underscore.
Redigeret af egonbj d. 15-07-2008 12:00
 
www.myphp.dk
Spring til debat: