Witam mam problem z odczytywaniem globalncyh z funkcji. poniżej załączam kod plików.
#PLIK INDEX.PHP WCZYTUJE PLIK LOAD.PHP.
#PLIK LOAD.PHP:
class load
{
private $web_online = web_online;
public function __construct()
{
require_once CE_PATH_LIB . '/load_components.php';
else
die("PL: blad wczytywania pliku <b>load_components.php</b><br>EN: Error loading file <b>load_components.php</b>");
if($this->web_online >0)
if(file_exists(CE_PATH_THEMES
. DIRECTORY_SEPARATOR
. templates_name
. '/index.php')) {
require_once CE_PATH_THEMES . DIRECTORY_SEPARATOR . templates_name . '/index.php';
}else{
die("PL: blad wczytywania szablonu <b>" .templates_name
. "</b><br>EN: Error loading themes <b>" .templates_name
); }
else
require_once CE_PATH_THEMES . DIRECTORY_SEPARATOR . 'offline/index.php';
}
}
$load = new load;
#############################################################################
JAK WIDAĆ TEN PLIK WCZYTUJE SZABLON STRONY ORAZ INNY PLIK KTÓRY ODPOWIADA ZA WCZYTYWANIE KOMPONENTÓW, PLIK LOAD_COMPONTENTS.PHP
# PLIK LOAD_COMPONTENTS.PHP
class load_components
{
protected $com_script = "script/script.php";
protected $com_config = "script/config.php";
protected $script;
protected $themes;
public function components($value1)
{
$result = $db->query("SELECT com_name,themes_name,active FROM ".WEB
.".`web_components` WHERE `themes_name`=? LIMIT 1", array($value1), "fetch"); {
define($result['com_name'] . '_' . $result['themes_name'] . '_enable', $result['active']);
$com_name = $result['com_name'];
$themes_name = $result['themes_name'];
$script = CE_PATH_COMPONENTS . DIRECTORY_SEPARATOR . $com_name . DIRECTORY_SEPARATOR . $this->com_script;
{
$this->script = $script;
}else{
$this->script = CE_PATH_COMPONENTS . DIRECTORY_SEPARATOR . $this->com_script;
}
$themes = CE_PATH_COMPONENTS . DIRECTORY_SEPARATOR . $com_name . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $themes_name . '.php';
$update_themes = CE_PATH_THEMES . DIRECTORY_SEPARATOR . templates_name . DIRECTORY_SEPARATOR . 'update' . DIRECTORY_SEPARATOR . $com_name . DIRECTORY_SEPARATOR . $themes_name . '.php';
{
{
$this->themes = $update_themes;
}else{
$this->themes = $themes;
}
}else{
$this->themes = CE_PATH_COMPONENTS . DIRECTORY_SEPARATOR . 'com_offline/index.php';
}
require_once $this->script;
require_once $this->themes;
}
}
}
$com = new load_components;
podając nazwe komponentu wygeneruje nam adresy do wczytania po czym na samym dole mamy require_once które wczyta plik script oraz themes do tej pory wszystko dziala super.
#################################################################
LADOWANIE COMPONENTU WEWNATRZ PLIKU INDEX.PHP W SZABLONIE
$com->components('themes_login');
################################################################
ZAWARTOSC PLIKU SCRIPT.PHP W KATALOGU COM_LOGIN
class com_login
{
private $account_table = Array(1 => 'id',2 => 'login',3 => 'email',4 => 'cash',5 => 'social_id',6 => 'silver_expire');
public function start_login()
{
global $db, $lang, $start_login_massage, $start_login_status; $table = $this->account_table;
if((test_input
($_POST['login']) && test_input
($_POST['pass'])) && !empty($_POST['login']) && !empty($_POST['pass'])) {
$login = clear($_POST['login']);
$pass = clear($_POST['pass']);
$result = $db->query("SELECT id,login,email,cash,social_id,silver_expire FROM ".ACCOUNT
.".`account` WHERE `login`=? AND `password`=PASSWORD(?) LIMIT 1", array($login,$pass), "fetch"); if($result)
{
for( $x = 1; $x <= count($table); $x++ ) {
$_SESSION[$table[$x]] = $result[$table[$x]];
}
header('Location: '.url
() . 'konto'); }else{
$start_login_massage = 'login_incorrect_data_account';
$start_login_status = 'error';
}
}else{
$start_login_massage = 'login_null_incorrect_data';
$start_login_status = 'error';
}
}
[...]
}
$com_login = new com_login;
# Jeżeli wykonam funkcję $com_login->start_login(); to funkcja się wykona oraz całe logowanie, jednak problem jest z GLOBAL w funkcji start_login
# zmiennej $start_login_massage z pliku com_login/script.php nie mogę odczytać w pliku com_login/themes_login.php
Czy ktoś może wie jaki popełniłem błąd w kodzie? Bardzo proszę o pomoc gdyż morduje ten kod już 4 dzień i dalej nie działa tak ja bym tego chciał.