Seite 1 von 1

Projektweite Integration eines Boards

Verfasst: 29.10.2005 16:44
von Warui
Moinmoin,

Ich hab ein Problem damit, ein phpBB in meine Projektseite einzubinden.
Ich habe in einer neuen Datei, die automatisch vom System eingebunden wird (per rekursivem Including) folgenden Code:

Code: Alles auswählen

<?
// This code lives in $WEBROOT$/mod/phpbb_live_integration
define('IN_PHPBB',TRUE);
   global $ecms_config; // an array with config values loaded from the database
   $phpbb_root_path = "../../".$ecms_config['phpbb_path']; // as you can see here
   include($phpbb_root_path.'extension.inc'); // It might be possible, that you have to edit this file also.
   include($phpbb_root_path.'config.'.$phpEx);
   include($phpbb_root_path.'common.'.$phpEx);
   
   # Start session management
   $userdata = session_pagestart($user_ip,PAGE_ECMS);
   init_userprefs($userdata);
?> 
Ich wollte damit eine systemweite Integration der Userdaten haben ... damit man sich dort einloggen kann, PMs lesen und solche Mätzchen.

Das Problem is nur, es geht nicht :/


Fatal error: Call to a member function on a non-object in /var/www/board/includes/functions.php on line 602


Die entsprechende Zeile sieht so aus

Code: Alles auswählen

//
// Get SQL error if we are debugging. Do this as soon as possible to prevent
    // subsequent queries from overwriting the status of sql_error()
    //
    if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) )
    {   
       $sql_error = $db->sql_error();  // <== That's the line

        $debug_text = '';
... 
Danke schon im Voraus :D

Mata ne
Warui

Verfasst: 30.10.2005 12:37
von saerdnaer
ich tippe mal drauf das irgendwas mit der datenbank klasse ($db) nicht stimmt.

mfg ah

Verfasst: 30.10.2005 12:53
von Warui
Meine Meinung ... nur, wenn ich das Board als solches aufrufe, funktioniert alles :(

Verfasst: 30.10.2005 13:32
von saerdnaer
er kann aus irgend einem grund nicht auf $db zugreifen; gibt es bei deinem projekt zufällig ne variable die genauso heißt?

mfg ah

Verfasst: 30.10.2005 14:25
von Warui
IMHO nicht ... hab ich schon geprüft, sogar per grep -e ;)

dafür hab ich was anderes interessantes gefunden:
Ich hab an der entsprechenden Stelle mal was umgeschrieben ...

Code: Alles auswählen

if (is_object($db)) {
            echo "yay\n";
            $sql_error = $db->sql_error();
        } else echo "buh\n";
Da krieg ich raus ...
buh
Warning: message_die(language/lang_german/lang_main.php): failed to open stream: No such file or directory in /var/www/board/includes/functions.php on line 704

Warning: message_die(): Failed opening 'language/lang_german/lang_main.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/board/includes/functions.php on line 704


Zeile 704 sieht so aus (bei mir)

Code: Alles auswählen

        case CRITICAL_ERROR:
            //
            // Critical errors mean we cannot rely on _ANY_ DB information being
            // available so we're going to dump out a simple echo'd statement
            //
            include($phpbb_root_path . 'language/lang_german/lang_main.'.$phpEx); // <=== Zeile 704

            if ( $msg_text == '' )
            {
                $msg_text = $lang['A_critical_error'];
            }

            if ( $msg_title == '' )
            {
                $msg_title = 'phpBB : <b>' . $lang['Critical_Error'] . '</b>';
            }
            break;
In Zeile 704 hab ich deshalb mal

Code: Alles auswählen

 echo "ROOT_PATH: ".$phpbb_root_path."\n";
eingefügt ....
raus kommt im Output
buh ROOT_PATH:
Warning: message_die(language/lang_german/lang_main.php): failed to open stream: No such file or directory in /var/www/board/includes/functions.php on line 704
....


Der Fehler scheint also zumindest teilweise daran zu liegen, dass die Variable nicht korrekt mitübergeben wird ... hmm

Mata ne
Warui

Verfasst: 30.10.2005 14:34
von Warui
Nachtrag:

Dieser Fehler tritt wohl schon früher auf ...
Als weitere Information liefert phpbb:

Code: Alles auswählen

Could not query config information

DEBUG MODE

SELECT * FROM config

Line : 227
File : common.php
Die entsprechende Zeile liest sich bei mir wie folgt

Code: Alles auswählen

//
// Setup forum wide options, if this fails
// then we output a CRITICAL_ERROR since
// basic forum information is not available
//
$sql = "SELECT *
    FROM " . CONFIG_TABLE;
if( !($result = $db->sql_query($sql)) )
{
    message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql); <== Das ist die Zeile
}
Der Output deutet ja wohl darauf hin, dass er die Variable $table_prefix auch nicht bekommt .... was ja aber eigentlich phpbb-intern gehandhabt werden sollte .... die config.php in /board/ ist aber intakt, lesbar, etc und die Variable steht drin -.-

Mata ne
Warui

Verfasst: 30.10.2005 16:50
von saerdnaer
hast du das board lokal oder auf nem server?

mfg ah

Verfasst: 30.10.2005 17:38
von Warui
Auf nem Server

Verfasst: 30.10.2005 17:46
von saerdnaer
haste lust mir die ftp zugangsdaten zu geben; dann schau ich mal nach an was es liegt.

mfg ah

Verfasst: 30.10.2005 17:52
von Warui
ok, ich hab das Rätsel wohl teilweise gelöst ...
ich hatte "vorauseilend" in einer Projekte-Konstanten-Datei bereits einige Konstanten definiert, die zum sinnvollen gebrauch der Board-Fkt. wichtig sind ... z.B. die Definition der Tabellennamen. Bereits dort hat das Skript wegen nem Schreibfehler die $table_prefix nicht übernommen und die Konstante später nicht nochmal überschrieben ....
Danach kommt allerdings schon der nächste Fehler ... -.-

Fatal error: Call to a member function on a non-object in /var/www/board/includes/sessions.php on line 68

Hier liegt es auch tatsächlich an $db .... wenn ich die Query umscrheibe zu

Code: Alles auswählen

	global $mysql_connection;
	$sql = "SELECT * 
		FROM " . USERS_TABLE . " 
		WHERE user_id = $user_id";
	$result = mysql_query($sql,$mysql_connection);
	#if ( !($result = $db->sql_query($sql)) )
	#{
	#	message_die(CRITICAL_ERROR, 'Could not obtain lastvisit data from user table', '', __LINE__, __FILE__, $sql);
	#}

	$userdata = $db->sql_fetchrow($result);
kommt eben jener Fehler ...

Mata ne
Warui