Probleme mit UMIF - Installationsdatei

In diesem Forum kann man Fragen zur Programmierung stellen, die bei der Entwicklung von Mods für phpBB 3.0.x oder dem Modifizieren des eigenen Forums auftauchen.
Forumsregeln
phpBB 3.0 hat das Ende seiner Lebenszeit überschritten
phpBB 3.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 3.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf die neuste phpBB-Version, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Benutzeravatar
TW1920
Mitglied
Beiträge: 746
Registriert: 02.06.2007 16:31
Wohnort: Ismaning
Kontaktdaten:

Probleme mit UMIF - Installationsdatei

Beitrag von TW1920 »

Hallo,

Ich habe die Bewertungsmod erstellt. Dazu habe ich auf phpbb.com eine UMIF generieren lassen, sodass ich es anderen ermöglichen kann, die DB einfacher zu aktualisieren (mit UMIL).

Allerdings habe ich 2 Probleme:

1. Es gibt ein Problem, dass immer ein Fehler ausgegeben wird.

Code: Alles auswählen

[phpBB Debug] PHP Notice: in file /install.php on line 62: Use of undefined constant star_rating - assumed 'star_rating'
2. Bei der installation gibt es Probleme mit dem Tabellenpräfix


Das Script:

Code: Alles auswählen

<?php
/**
 *
 * @author TW1920 (Thomas Wolf) forum@twcmail.de
 * @version $Id$
 * @copyright (c) 2011 TW1920 & TWCmail
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
 */

/**
 * @ignore
 */
define('UMIL_AUTO', true);
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);

include($phpbb_root_path . 'common.' . $phpEx);
$user->session_begin();
$auth->acl($user->data);
$user->setup();


if (!file_exists($phpbb_root_path . 'umil/umil_auto.' . $phpEx))
{
	trigger_error('Please download the latest UMIL (Unified MOD Install Library) from: <a href="http://www.phpbb.com/mods/umil/">phpBB.com/mods/umil</a>', E_USER_ERROR);
}

// The name of the mod to be displayed during installation.
$mod_name = 'TWC - Star Mod';

/*
* The name of the config variable which will hold the currently installed version
* UMIL will handle checking, setting, and updating the version itself.
*/
$version_config_name = 'twcstarmod_version';


// The language file which will be included when installing
$language_file = 'mods/twcmod1';


/*
* Optionally we may specify our own logo image to show in the upper corner instead of the default logo.
* $phpbb_root_path will get prepended to the path specified
* Image height should be 50px to prevent cut-off or stretching.
*/
//$logo_img = 'styles/prosilver/imageset/site_logo.gif';

/*
* The array of versions and actions within each.
* You do not need to order it a specific way (it will be sorted automatically), however, you must enter every version, even if no actions are done for it.
*
* You must use correct version numbering.  Unless you know exactly what you can use, only use X.X.X (replacing X with an integer).
* The version numbering must otherwise be compatible with the version_compare function - http://php.net/manual/en/function.version-compare.php
*/
$versions = array(
	'1.1.1' => array(

		'table_add' => array(
			array(star_rating, array(
				'COLUMNS' => array(
					'R_ID' => array('INT:10', '', 'auto_increment'),
					'T_ID' => array('XSTEXT_UNI', ''),
					'U_ID' => array('XSTEXT_UNI', ''),
					'star' => array('INT:3', ''),
				),

				'PRIMARY_KEY'	=> array('R_ID', ''),

				'KEYS'		=> array(
					'R_ID' => array('PRIMARY', array('R_ID')),
				),
			)),

		),

		'table_column_add' => array(
			array('topics', 'feed', array('XSTEXT_UNI', '0')),
			array('topics', 'star', array('XSTEXT_UNI', '0')),
		),

		'config_add' => array(
			array('twc_star_ver', '101,01', 0),
		),

	),
);

// Include the UMIL Auto file, it handles the rest
include($phpbb_root_path . 'umil/umil_auto.' . $phpEx);
Ich habe bereits nach Lösungen gesucht, aber nichts gefunden, womit ich selbst die Fehler beheben konnte. Bis jetzt habe ich nie UMIL-Installationen erstellt.

Ich würde mich freuen, wenn mir jemand sagen könnte, was ich ändern muss.


Danke im Vorraus,
Mfg T. Wolf
-Mods gesucht? Ne weitere Community gesucht?
-Mods gesucht? Mod-Übersetzungen gesucht?:->hier klicken
Birne94
Mitglied
Beiträge: 129
Registriert: 22.02.2009 18:57
Kontaktdaten:

Re: Probleme mit UMIF - Installationsdatei

Beitrag von Birne94 »

Ersetz mal das star_rating durch den Tabellennamen (zB phpbb_stars). Das phpbb_ wird dann automatisch durch das entsprechende Prefix ersetzt...
Benutzeravatar
Dr.Death
Moderator
Moderator
Beiträge: 17473
Registriert: 23.04.2003 08:22
Wohnort: Xanten
Kontaktdaten:

Re: Probleme mit UMIF - Installationsdatei

Beitrag von Dr.Death »

Hi,

die zu modifizierende Tabelle muß in Hochkommatas gesetzt werden:

Code: Alles auswählen

   '1.1.1' => array(

      'table_add' => array(
         array('phpbb_star_rating', array(
            'COLUMNS' => array(
               'R_ID' => array('INT:10', '', 'auto_increment'),
               'T_ID' => array('XSTEXT_UNI', ''),
               'U_ID' => array('XSTEXT_UNI', ''),
               'star' => array('INT:3', ''),
            ),

            'PRIMARY_KEY'   => array('R_ID', ''),

            'KEYS'      => array(
               'R_ID' => array('PRIMARY', array('R_ID')),
            ),
         )),

      ), 
Benutzeravatar
TW1920
Mitglied
Beiträge: 746
Registriert: 02.06.2007 16:31
Wohnort: Ismaning
Kontaktdaten:

Re: Probleme mit UMIF - Installationsdatei

Beitrag von TW1920 »

Danke, nun gibt es nur noch einen Fehler:

Code: Alles auswählen

SQL ERROR You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), R_ID (R_ID) ) CHARACTER SET utf8 COLLATE utf8_bin' at line 6

Habe bereits ein bisschen experimentiert, aber habe den fehler nicht beheben können :-?

Der Code:

Code: Alles auswählen

<?php
/**
 *
 * @author TW1920 (Thomas Wolf) forum@twcmail.de
 * @version $Id$
 * @copyright (c) 2011 TW1920 & TWCmail
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
 */

/**
 * @ignore
 */
define('UMIL_AUTO', true);
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);

include($phpbb_root_path . 'common.' . $phpEx);
$user->session_begin();
$auth->acl($user->data);
$user->setup();


if (!file_exists($phpbb_root_path . 'umil/umil_auto.' . $phpEx))
{
	trigger_error('Please download the latest UMIL (Unified MOD Install Library) from: <a href="http://www.phpbb.com/mods/umil/">phpBB.com/mods/umil</a>', E_USER_ERROR);
}

// The name of the mod to be displayed during installation.
$mod_name = 'TWC - Star Mod';

/*
* The name of the config variable which will hold the currently installed version
* UMIL will handle checking, setting, and updating the version itself.
*/
$version_config_name = 'twcstarmod_version';


// The language file which will be included when installing
$language_file = 'mods/twcmod1';


/*
* Optionally we may specify our own logo image to show in the upper corner instead of the default logo.
* $phpbb_root_path will get prepended to the path specified
* Image height should be 50px to prevent cut-off or stretching.
*/
//$logo_img = 'styles/prosilver/imageset/site_logo.gif';

/*
* The array of versions and actions within each.
* You do not need to order it a specific way (it will be sorted automatically), however, you must enter every version, even if no actions are done for it.
*
* You must use correct version numbering.  Unless you know exactly what you can use, only use X.X.X (replacing X with an integer).
* The version numbering must otherwise be compatible with the version_compare function - http://php.net/manual/en/function.version-compare.php
*/
$versions = array(
   '1.1.1' => array(

      'table_add' => array(
         array('phpbb_star_rating', array(
            'COLUMNS' => array(
               'R_ID' => array('INT:10', NULL, 'auto_increment'),
               'T_ID' => array('XSTEXT_UNI', ''),
               'U_ID' => array('XSTEXT_UNI', ''),
               'star' => array('INT:3', ''),
            ),

			
            'PRIMARY_KEY'   => array('R_ID', ''),
			
            'KEYS'      => array(
               'R_ID' => array('PRIMARY', array('R_ID')),
            ),

         )),

      ), 
	),
);

// Include the UMIL Auto file, it handles the rest
include($phpbb_root_path . 'umil/umil_auto.' . $phpEx);
Danke,
Mfg T. Wolf
-Mods gesucht? Ne weitere Community gesucht?
-Mods gesucht? Mod-Übersetzungen gesucht?:->hier klicken
Benutzeravatar
TW1920
Mitglied
Beiträge: 746
Registriert: 02.06.2007 16:31
Wohnort: Ismaning
Kontaktdaten:

Re: Probleme mit UMIF - Installationsdatei

Beitrag von TW1920 »

TW1920 hat geschrieben:Danke, nun gibt es nur noch einen Fehler:

Code: Alles auswählen

SQL ERROR You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), R_ID (R_ID) ) CHARACTER SET utf8 COLLATE utf8_bin' at line 6

Habe bereits ein bisschen experimentiert, aber habe den fehler nicht beheben können :-?

Der Code:

Code: Alles auswählen

<?php
/**
 *
 * @author TW1920 (Thomas Wolf) forum@twcmail.de
 * @version $Id$
 * @copyright (c) 2011 TW1920 & TWCmail
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
 */

/**
 * @ignore
 */
define('UMIL_AUTO', true);
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);

include($phpbb_root_path . 'common.' . $phpEx);
$user->session_begin();
$auth->acl($user->data);
$user->setup();


if (!file_exists($phpbb_root_path . 'umil/umil_auto.' . $phpEx))
{
	trigger_error('Please download the latest UMIL (Unified MOD Install Library) from: <a href="http://www.phpbb.com/mods/umil/">phpBB.com/mods/umil</a>', E_USER_ERROR);
}

// The name of the mod to be displayed during installation.
$mod_name = 'TWC - Star Mod';

/*
* The name of the config variable which will hold the currently installed version
* UMIL will handle checking, setting, and updating the version itself.
*/
$version_config_name = 'twcstarmod_version';


// The language file which will be included when installing
$language_file = 'mods/twcmod1';


/*
* Optionally we may specify our own logo image to show in the upper corner instead of the default logo.
* $phpbb_root_path will get prepended to the path specified
* Image height should be 50px to prevent cut-off or stretching.
*/
//$logo_img = 'styles/prosilver/imageset/site_logo.gif';

/*
* The array of versions and actions within each.
* You do not need to order it a specific way (it will be sorted automatically), however, you must enter every version, even if no actions are done for it.
*
* You must use correct version numbering.  Unless you know exactly what you can use, only use X.X.X (replacing X with an integer).
* The version numbering must otherwise be compatible with the version_compare function - http://php.net/manual/en/function.version-compare.php
*/
$versions = array(
   '1.1.1' => array(

      'table_add' => array(
         array('phpbb_star_rating', array(
            'COLUMNS' => array(
               'R_ID' => array('INT:10', NULL, 'auto_increment'),
               'T_ID' => array('XSTEXT_UNI', ''),
               'U_ID' => array('XSTEXT_UNI', ''),
               'star' => array('INT:3', ''),
            ),

			
            'PRIMARY_KEY'   => array('R_ID', ''),
			
            'KEYS'      => array(
               'R_ID' => array('PRIMARY', array('R_ID')),
            ),

         )),

      ), 
	),
);

// Include the UMIL Auto file, it handles the rest
include($phpbb_root_path . 'umil/umil_auto.' . $phpEx);
Danke,

Kann mir vieleicht jemand bei dem letzten Problem noch helfen?

Ich würde mich sehr freuen.
Mfg T. Wolf
-Mods gesucht? Ne weitere Community gesucht?
-Mods gesucht? Mod-Übersetzungen gesucht?:->hier klicken
Benutzeravatar
Frank1604
Ehemaliges Teammitglied
Beiträge: 2106
Registriert: 07.11.2007 09:25
Wohnort: Einhausen
Kontaktdaten:

Re: Probleme mit UMIF - Installationsdatei

Beitrag von Frank1604 »

TW1920 hat geschrieben:

Code: Alles auswählen

         array('phpbb_star_rating', array(
            'COLUMNS' => array(
               'R_ID' => array('INT:10', NULL, 'auto_increment'),
               'T_ID' => array('XSTEXT_UNI', ''),
               'U_ID' => array('XSTEXT_UNI', ''),
               'star' => array('INT:3', ''),
            ),

         
            'PRIMARY_KEY'   => array('R_ID', ''),
         
            'KEYS'      => array(
               'R_ID' => array('PRIMARY', array('R_ID')),
            ), 
Was ist das denn? Warum gibst du der R_ID denn mehrfach einen Schlüssel? Und warum XSTEXT_UNI?

Versuchs mal so:

Code: Alles auswählen

$versions = array(
   '1.1.1' => array(
      'table_add' => array(
         array('phpbb_star_rating', array(
            'COLUMNS' => array(
               'R_ID' => array('UINT:10', NULL, 'auto_increment'),
               'T_ID' => array('VCHAR:100', ''),
               'U_ID' => array('VCHAR:100', ''),
               'star' => array('INT:3', 0),
            ),
            'PRIMARY_KEY'    => 'R_ID',
         )),
      ),
   ),
);  
Gruß, Frank
Meine Meinung steht fest. Bitte verwirrt mich nicht mit Tatsachen!
Benutzeravatar
TW1920
Mitglied
Beiträge: 746
Registriert: 02.06.2007 16:31
Wohnort: Ismaning
Kontaktdaten:

Re: Probleme mit UMIF - Installationsdatei

Beitrag von TW1920 »

Das Ergebnis:

Code: Alles auswählen

Eine neue Datenbanktabelle erstellen: de_help_star_rating

Erfolgreich

--------------------------------------------------------------------------------

Lege neue Konfigurationsvariable an: twcstarmod_version

Erfolgreich

Vielen Dank, die Installationsdatei funktioniert jetzt so, wie es sein soll. :)
Mfg T. Wolf
-Mods gesucht? Ne weitere Community gesucht?
-Mods gesucht? Mod-Übersetzungen gesucht?:->hier klicken
Benutzeravatar
Frank1604
Ehemaliges Teammitglied
Beiträge: 2106
Registriert: 07.11.2007 09:25
Wohnort: Einhausen
Kontaktdaten:

Re: Probleme mit UMIF - Installationsdatei

Beitrag von Frank1604 »

Jetzt bleibt halt nur die Frage, braucht das Feld Star einen Integer oder eher einen Decimal? Das musst du entscheiden.
Gruß, Frank
Meine Meinung steht fest. Bitte verwirrt mich nicht mit Tatsachen!
Benutzeravatar
TW1920
Mitglied
Beiträge: 746
Registriert: 02.06.2007 16:31
Wohnort: Ismaning
Kontaktdaten:

Re: Probleme mit UMIF - Installationsdatei

Beitrag von TW1920 »

es braucht keine decimal, da nur die bewertung als ganze zahl espeichert wird.

Habe die mo getestet, alles funktioniert. nur noch die modx datei überprüfen, dann sind alle bekannten fehler behoben.
Mfg T. Wolf
-Mods gesucht? Ne weitere Community gesucht?
-Mods gesucht? Mod-Übersetzungen gesucht?:->hier klicken
Benutzeravatar
Frank1604
Ehemaliges Teammitglied
Beiträge: 2106
Registriert: 07.11.2007 09:25
Wohnort: Einhausen
Kontaktdaten:

Re: Probleme mit UMIF - Installationsdatei

Beitrag von Frank1604 »

Na, dann weiß ich ja was bald wieder auf mich zukommt ;)
Gruß, Frank
Meine Meinung steht fest. Bitte verwirrt mich nicht mit Tatsachen!
Antworten

Zurück zu „[3.0.x] Mod Bastelstube“