Fatal Error function acl_get

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.
CoKeSiDe
Mitglied
Beiträge: 39
Registriert: 06.04.2009 10:43

Fatal Error function acl_get

Beitrag von CoKeSiDe »

Hallo,

ich bin grade dabei eine Software mit phpBB zu Verbinden. Also, es soll eigentlich nur folgendes machen: Es soll ein Thema erstellen. Leider kommt der Error:
Fatal error: Call to a member function acl_get() on a non-object in /var/customers/webs/phplex/***/includes/functions_posting.php on line 1684
Folgender Code:

Code: Alles auswählen

////////////////////////////////////////////Only for phpLEX.de Demo /////////////////////////////////////////////////
define('IN_PHPBB', TRUE);
function utf8_htmlspecialchars($value)
{
    return htmlspecialchars($value, ENT_COMPAT, 'UTF-8');
}
    
function utf8_str_split($str, $split_len = 1)
{
    if (!is_int($split_len) || $split_len < 1)
    {
        return false;
    }

    $len = utf8_strlen($str);
    if ($len <= $split_len)
    {
        return array($str);
    }

    preg_match_all('/.{' . $split_len . '}|[^\x00]{1,' . $split_len . '}$/us', $str, $ar);
    return $ar[0];
}

    function utf8_strlen($text)
    {
        return mb_strlen($text, 'utf-8');
    }

    function acl_get($opt, $f = 0)
    {
        $negate = false;

        if (strpos($opt, '!') === 0)
        {
            $negate = true;
            $opt = substr($opt, 1);
        }

        if (!isset($this->cache[$f][$opt]))
        {
            // We combine the global/local option with an OR because some options are global and local.
            // If the user has the global permission the local one is true too and vice versa
            $this->cache[$f][$opt] = false;

            // Is this option a global permission setting?
            if (isset($this->acl_options['global'][$opt]))
            {
                if (isset($this->acl[0]))
                {
                    $this->cache[$f][$opt] = $this->acl[0][$this->acl_options['global'][$opt]];
                }
            }

            // Is this option a local permission setting?
            // But if we check for a global option only, we won't combine the options...
            if ($f != 0 && isset($this->acl_options['local'][$opt]))
            {
                if (isset($this->acl[$f]) && isset($this->acl[$f][$this->acl_options['local'][$opt]]))
                {
                    $this->cache[$f][$opt] |= $this->acl[$f][$this->acl_options['local'][$opt]];
                }
            }
        }

        // Founder always has all global options set to true...
        return ($negate) ? !$this->cache[$f][$opt] : $this->cache[$f][$opt];
    }        
include("../../forum/includes/functions_posting.php");
include("../../forum/includes/functions_content.php");
include("../../forum/includes/constants.php");
////////////////////////////////////////////Only for phpLEX.de Demo /////////////////////////////////////////////////    
[...]

Code: Alles auswählen

/////////////////////////////////Nur phpLEX.de DEMO        
        mysql_close($verbindung);
        
        $verbindung = mysql_connect ("localhost",
        "***", "****")
        or die ("Error: Verbindung mit der Datenbank schlug fehl!");

        mysql_select_db("****")
        or die ("Error: Datenbank konnte nicht ausgewählt werden.");
        
        $data = array(  
    // General Posting Settings 
    'forum_id'          => 4,    // The forum ID in which the post will be placed. (int) 
    'topic_id'          => 0,    // Post a new topic or in an existing one? Set to 0 to create a new one, if not, specify your topic ID here instead. 
    'icon_id'           => false,    // The Icon ID in which the post will be displayed with on the viewforum, set to false for icon_id. (int) 
  
    // Defining Post Options 
    'enable_bbcode' => true, // Enable BBcode in this post. (bool) 
    'enable_smilies'    => true, // Enabe smilies in this post. (bool) 
    'enable_urls'       => true, // Enable self-parsing URL links in this post. (bool) 
    'enable_sig'        => true, // Enable the signature of the poster to be displayed in the post. (bool) 
  
    // Message Body 
    'message'           => $text,     // Your text you wish to have submitted. It should pass through generate_text_for_storage() before this. (string) 
    'message_md5'   => md5($text),// The md5 hash of your message 
  
    // Values from generate_text_for_storage() 
    'bbcode_bitfield'   => $bitfield,    // Value created from the generate_text_for_storage() function. 
    'bbcode_uid'        => $uid,     // Value created from the generate_text_for_storage() function. 
  
    // Other Options 
    'post_edit_locked'  => 0,        // Disallow post editing? 1 = Yes, 0 = No 
    'topic_title'       => $ueber, // Subject/Title of the topic. (string) 
  
    // Email Notification Settings 
    'notify_set'        => false,        // (bool) 
    'notify'            => false,        // (bool) 
    'post_time'         => 0,        // Set a specific time, use 0 to let submit_post() take care of getting the proper time (int) 
    'forum_name'        => '',       // For identifying the name of the forum in a notification email. (string) 
  
    // Indexing 
    'enable_indexing'   => true,     // Allow indexing the post? (bool) 
  
    // 3.0.6 
    'force_approved_state'  => true,  // Allow the post to be submitted without going into unapproved queue 
);
        
        submit_post ( "post",  $ueber,  "News [Bot]",  "POST_NORMAL", $data, $poll);
        
        mysql_close($verbindung);
        include("_global/_mysql.php");
///////////////////////////////////////Nur phpLEX.de DEMO        
 

functions_posting.php

Code: Alles auswählen

    // This variable indicates if the user is able to post or put into the queue - it is used later for all code decisions regarding approval
    // The variable name should be $post_approved, because it indicates if the post is approved or not
    $post_approval = 1;

    // Check the permissions for post approval. Moderators are not affected.
    if (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) /////////////Die Zeile 1684
    {
        // Post not approved, but in queue
        $post_approval = 0;
    } 


Wo liegt mein Fehler?
Benutzeravatar
Frank1604
Ehemaliges Teammitglied
Beiträge: 2106
Registriert: 07.11.2007 09:25
Wohnort: Einhausen
Kontaktdaten:

Re: Fatal Error function acl_get

Beitrag von Frank1604 »

Dir fehlt die common.php, sowie die Erstellung der Objekte User und Auth. Schiebe mal folgendes an den Anfang..

Code: Alles auswählen

define('IN_PHPBB', true);
$phpbb_root_path = '../../forum/';
$phpEx = 'php';

include($phpbb_root_path.'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
include($phpbb_root_path . 'includes/functions_content.' . $phpEx);
 
$user->session_begin();
$auth->acl($user->data);
$user->setup(); 
Gruß, Frank
Meine Meinung steht fest. Bitte verwirrt mich nicht mit Tatsachen!
CoKeSiDe
Mitglied
Beiträge: 39
Registriert: 06.04.2009 10:43

Re: Fatal Error function acl_get

Beitrag von CoKeSiDe »

Hey,

danke! Aber ich musste:

Code: Alles auswählen

include($phpbb_root_path . 'includes/functions_content.' . $phpEx);
herausnehemen, den sonst kam ein Error ;).

So nun stehe ich vor einem weiterem Problem:
SQL ERROR [ mysql4 ]

Column 'forum_id' cannot be null [1048]

Beim Laden der Seite ist ein SQL-Fehler aufgetreten. Bitte kontaktiere die Board-Administration, falls dieses Problem fortlaufend auftritt.
Er meckert also jetzt, das forum_id nicht NULL bleiben darf. Warum? Ist doch ganz normal ausgefüllt (4).
CoKeSiDe
Mitglied
Beiträge: 39
Registriert: 06.04.2009 10:43

Re: Fatal Error function acl_get

Beitrag von CoKeSiDe »

Push
CoKeSiDe
Mitglied
Beiträge: 39
Registriert: 06.04.2009 10:43

Re: Fatal Error function acl_get

Beitrag von CoKeSiDe »

Keiner eine Antwort?!
CoKeSiDe
Mitglied
Beiträge: 39
Registriert: 06.04.2009 10:43

Re: Fatal Error function acl_get

Beitrag von CoKeSiDe »

Push!
Benutzeravatar
dagobert50gold
Gesperrt
Beiträge: 1316
Registriert: 04.11.2009 16:52

Re: Fatal Error function acl_get

Beitrag von dagobert50gold »

Nach deinem dritten Bump:

Welche SQL-Version besitzt du?
Der kleine phpBB.de-Knigge - unsere HausordnungF1 WebTipp von Dr.DeathF1 WebTipp SQL-Updates
Kein Support per PN! Auch nicht zu den F1WebTipp-SQL-Updates!
CoKeSiDe
Mitglied
Beiträge: 39
Registriert: 06.04.2009 10:43

Re: Fatal Error function acl_get

Beitrag von CoKeSiDe »

PHP Version 5.2.6-1+lenny8
MySQL Server Version 5.0.51a-24+lenny4

Auch wenn ein bisschen später.
Benutzeravatar
dagobert50gold
Gesperrt
Beiträge: 1316
Registriert: 04.11.2009 16:52

Re: Fatal Error function acl_get

Beitrag von dagobert50gold »

Hier hat jemand dieselbe Fehlermeldung:
viewtopic.php?f=74&t=204131

Welche Mods hast du eingebaut?
Der kleine phpBB.de-Knigge - unsere HausordnungF1 WebTipp von Dr.DeathF1 WebTipp SQL-Updates
Kein Support per PN! Auch nicht zu den F1WebTipp-SQL-Updates!
CoKeSiDe
Mitglied
Beiträge: 39
Registriert: 06.04.2009 10:43

Re: Fatal Error function acl_get

Beitrag von CoKeSiDe »

Hm, Ads (siehe Footer) Mod und Medall Mode.
Antworten

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