Seite 1 von 2

Probleme mit UMIF - Installationsdatei

Verfasst: 19.02.2011 16:06
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,

Re: Probleme mit UMIF - Installationsdatei

Verfasst: 19.02.2011 16:09
von Birne94
Ersetz mal das star_rating durch den Tabellennamen (zB phpbb_stars). Das phpbb_ wird dann automatisch durch das entsprechende Prefix ersetzt...

Re: Probleme mit UMIF - Installationsdatei

Verfasst: 19.02.2011 16:33
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')),
            ),
         )),

      ), 

Re: Probleme mit UMIF - Installationsdatei

Verfasst: 19.02.2011 21:18
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,

Re: Probleme mit UMIF - Installationsdatei

Verfasst: 21.02.2011 10:36
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.

Re: Probleme mit UMIF - Installationsdatei

Verfasst: 22.02.2011 07:52
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',
         )),
      ),
   ),
);  

Re: Probleme mit UMIF - Installationsdatei

Verfasst: 22.02.2011 14:30
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. :)

Re: Probleme mit UMIF - Installationsdatei

Verfasst: 22.02.2011 15:29
von Frank1604
Jetzt bleibt halt nur die Frage, braucht das Feld Star einen Integer oder eher einen Decimal? Das musst du entscheiden.

Re: Probleme mit UMIF - Installationsdatei

Verfasst: 22.02.2011 22:50
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.

Re: Probleme mit UMIF - Installationsdatei

Verfasst: 22.02.2011 22:52
von Frank1604
Na, dann weiß ich ja was bald wieder auf mich zukommt ;)