Witajcie!
Nie moge sobie poradzić z jedną rzeczą. Posiadam stronę WWW, która jest zintegrowana z PHPBB3 - wszystko ładnie działa - sesja, logowanie itp. Problem jest z wysyłaniem prywatnych wiadomości.
Wywali mi taki oto błąd:
Kod
Fatal error: Call to undefined method db::sql_transaction() in /home/xxx/domains/xxx/public_html/includes/functions_privmsgs.php on line 1386
Skrypt integracyjny:
<?php
global $phpbb_root_path, $phpEx, $db, $sql, $config, $user, $auth, $cache, $template;
}
//
$forumurl = 'xxx';
$newurl = 'xxx';
$phpEx = "php";
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH
: ROOT_PATH
. '/'; include($phpbb_root_path . 'common.' . $phpEx);
$user->session_begin();
$auth->acl($user->data);
$user->setup();
?>
Plik z wysyłaniem wiadomości:
<?php
function sendphpbbpm($pmmessage,$userid,$pmsubject, $od_id, $od_nazwa, $od_ip) {
global $phpbb_root_path, $phpEx, $db, $config, $user, $auth, $cache, $template; include_once('../includes/functions_privmsgs.php');
$message = utf8_normalize_nfc($pmmessage);
$uid = $bitfield = $options = ''; // will be modified by generate_text_for_storage
$allow_bbcode = $allow_smilies = true;
$allow_urls = true;
//generate_text_for_storage($message, $uid, $bitfield, $options, $allow_bbcode, $allow_urls, $allow_smilies);
'from_user_id' => $od_id,
'from_user_ip' => $od_ip,
'from_username' => $od_nazwa,
'enable_sig' => false,
'enable_bbcode' => true,
'enable_smilies' => true,
'enable_urls' => false,
'icon_id' => 0,
'bbcode_bitfield' => $bitfield,
'bbcode_uid' => $uid,
'message' => $message,
'address_list' => array('u' => array($userid => 'to')), );
//Now We Have All Data Lets Send The PM!!
submit_pm('post', $pmsubject, $pm_data, false, false);
}
$pmsubject = 'Please read this PM.';
$pmmessage = 'Thank you for reading this PM!';
$userid = '2';
sendphpbbpm($pmmessage,$userid,$pmsubject, '1', 'User', '127.0.0.1' );
?>
Jak odkomentuje linię
generate_text_for_storage($message, $uid, $bitfield, $options, $allow_bbcode, $allow_urls, $allow_smilies);
to wywala:
Kod
Fatal error: Call to undefined method db::sql_escape() in /home/xxx/domains/xxx/public_html/includes/functions.php on line 147
Tak jakby zgubił albo nie widzi klasy db.
Coś pominałem?
Z góry dzięki za pomoc.
Pozdrawiam