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:
Folgender Code: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
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?