Skrypcik jak by ktoś potrzebował http://www.phpkode.com/projects/item/ph ... ion-class/
Puki nie załącze tego skryptu do reszty strony to wszystko jest ok.
W momencie kiedy zaczynam korzystać z tej klasy wywala mi błąd :<b>Fatal error</b>: Call to undefined method dbal_mysqli::query() in
<b>/home/ftp/www/funkcje.php in line 61</b> w tej linijce jest:
Kod: Zaznacz cały
function dbQuery($query){
$db=dbInit();
$q=$db->query($query);
$db->num_queries++;
return $q;
}
wylogowanie wygląda tak:
Kod: Zaznacz cały
class phpbb{
//various table fields
var $table_fields = array();
//constructor
public function __construct($path, $php_extension = "php"){
global $phpbb_root_path, $phpEx, $db, $config, $user, $auth, $cache, $template;
define('IN_PHPBB', true);
$phpbb_root_path = $path;
$phpEx = $php_extension;
}
public function user_logout(){
global $phpbb_root_path, $phpEx, $db, $config, $user, $auth, $cache, $template;
//fail presumption
$phpbb_result = "FAIL";
//general info
$this->init(true);
//session management
$user->session_begin();
$auth->acl($user->data);
//destroy session if needed
if($user->data['user_id'] != ANONYMOUS){
$user->session_kill();
$user->session_begin();
$phpbb_result = "SUCCESS";
}
return $phpbb_result;
}
}
No i samo wywołanie
Kod: Zaznacz cały
require("./phpbb.class.php");
$phpbb = new phpbb("./forum/", "php");
$phpbb_vars = array("username" => $email, "password" => $haselko, "user_email" => $email, "group_id" => "2");
$phpbb_result = $phpbb->user_add($phpbb_vars);