Huhu, ich wolte heute ein Modul installieren was zu fehlern führt.
Kurzgesagt die Tabellen werden nicht erstellt bekomme beim Manuell ausführen : ( Fatal error: Using $this when not in object context in )
Spoiler anzeigen
Spoiler anzeigen
Woran liegt es? Sonst muss ich die Tabellen Manuell erstellen nur das Problem ist das zu entziffern :
Aufbau :
ibf_guid_settings
Message1 TEXT "der text"
Message2 TEXT "der text"
liege ich soweit richtig?
Das hat nichts mit SQL zu tun, sondern ist PHP-spezifisch. Thema verschoben. ~Trade
Kurzgesagt die Tabellen werden nicht erstellt bekomme beim Manuell ausführen : ( Fatal error: Using $this when not in object context in )
PHP-Quellcode
- <?php
- $GUIDSettings = array(
- 'online' => "1",
- 'vonline' => "1",
- 'ponline' => "0",
- );
- $GUIDTextsettings = array(
- 'Message1' => "You can change this message by going to the admin CP -> My Apps -> GUID System",
- 'Message2' => "You can change this message by going to the admin CP -> My Apps -> GUID System",
- );
- $INSERT = array();
- $count = 1;
- foreach($GUIDSettings as $name => $title)
- {
- $test_count = $this->DB->buildAndFetch( array( 'select' => 'count(name) as count', 'from' => 'guid_settings', 'where' => "name='{$name}'" ) );
- if($test_count['count'] == 0)
- {
- $INSERT[] = "INSERT INTO guid_settings (`name` , `vaule` ) VALUES ('{$name}', '{$title}');";
- }
- $count++;
- }
- foreach($GUIDTextsettings as $name => $title)
- {
- $test_count = $this->DB->buildAndFetch( array( 'select' => 'count(name) as count', 'from' => 'guid_settings', 'where' => "name='{$name}'" ) );
- if($test_count['count'] == 0)
- {
- $INSERT[] = "INSERT INTO guid_settings (`name` , `textvaule` ) VALUES ('{$name}', '{$title}');";
- }
- $count++;
- }
- $this->DB->update( 'groups', array( 'g_guid_access' => 1 ), "g_id=4" );
- ?>
PHP-Quellcode
- [/spoiler][spoiler]<?php
- //add table g_guid_access
- if ( ! $this->DB->checkForField( 'g_guid_access', "groups" ) )
- {
- $this->DB->query("alter table {$this->DB->obj['sql_tbl_prefix']}groups ADD g_guid_access int(1) not null default 0");
- }
- if ( ! $this->DB->checkForField( 'g_guid_admin_', "groups" ) )
- {
- $this->DB->query("alter table {$this->DB->obj['sql_tbl_prefix']}groups ADD g_guid_admin_ int(1) not null default 0");
- }
- if ( ! $this->DB->checkForField( 'g_guid_group_access', "groups" ) )
- {
- $this->DB->query("alter table {$this->DB->obj['sql_tbl_prefix']}groups ADD g_guid_group_access int(1) not null default 0");
- }
- if ( ! $this->DB->checkForField( 'VGUID', "members" ) )
- {
- $this->DB->query("alter table {$this->DB->obj['sql_tbl_prefix']}members ADD VGUID varchar(32) not null default 'VIP GUID'");
- }
- if ( ! $this->DB->checkForField( 'PGUID', "members" ) )
- {
- $this->DB->query("alter table {$this->DB->obj['sql_tbl_prefix']}members ADD PGUID varchar(32) not null default 'PUBLIC GUID'");
- }
- if ( ! $this->DB->checkForField( 'gameonline', "members" ) )
- {
- $this->DB->query("alter table {$this->DB->obj['sql_tbl_prefix']}members ADD gameonline varchar(255) not null default ''");
- }
- if ( ! $this->DB->checkForField( 'lastcheck', "members" ) )
- {
- $this->DB->query("alter table {$this->DB->obj['sql_tbl_prefix']}members ADD lastcheck int(255) not null default ''");
- }
- //lets do the GUID settings now ;)
- if ( ! $this->DB->checkForTable( 'guid_settings' ) )
- {
- $this->DB->query("CREATE TABLE {$this->DB->obj['sql_tbl_prefix']}guid_settings(`name` varchar(255) NOT NULL,`vaule` int(1) NULL, `textvaule` varchar(255) NULL, PRIMARY KEY (name))TYPE=MyISAM AUTO_INCREMENT=1;");
- }
- //lets do the HACK settings now ;)
- if ( ! $this->DB->checkForTable( 'hack_settings' ) )
- {
- $this->DB->query("CREATE TABLE {$this->DB->obj['sql_tbl_prefix']}hack_settings(`id` INT( 10 ) NOT NULL AUTO_INCREMENT ,`name` VARCHAR( 255 ) NOT NULL ,`exename` VARCHAR( 255 ) NOT NULL default 'Enter your hack execuable here' ,`update` VARCHAR( 255 ) NOT NULL , `announcement` VARCHAR( 255 ) NOT NULL default 'Enter your hack announcement here', PRIMARY KEY ( `id` ) ) ENGINE = MYISAM;");
- }
- //make our admin group id 4 to admin on GUID tech :)
- if ( $this->DB->checkForField( 'g_guid_access', "groups" ) )
- {
- $this->DB->update( 'groups', array( 'g_guid_access' => 1 ), "g_id=4" );
- }
- ?>[/spoiler][spoiler]
Woran liegt es? Sonst muss ich die Tabellen Manuell erstellen nur das Problem ist das zu entziffern :
Aufbau :
ibf_guid_settings
Message1 TEXT "der text"
Message2 TEXT "der text"
liege ich soweit richtig?
Das hat nichts mit SQL zu tun, sondern ist PHP-spezifisch. Thema verschoben. ~Trade
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Trade“ ()