here is the part if having error.
Fatal error: Using $this when not in object context in /pb_events.php on line 6
line 6 is: $jpp = $this->vars->data["jpp"];
function DoEvents($this) {
global $_CONF, $_PAGE, $_TSM , $base;
$jpp = $this->vars->data["jpp"];
$cache["departments"] = $this->db->QFetchRowArray("SELECT * FROM {$this->tables[job_departments]}");
$cache["locations"] = $this->db->QFetchRowArray("SELECT * FROM {$this->tables[job_location]}");
$cache["names"] = $this->db->QFetchRowArray("SELECT * FROM {$this->tables[job_names]}");
$cache["categories"] = $this->db->QFetchRowArray("SELECT * FROM {$this->tables[job_categories]}");
Thanks a lot! appreciate!
You cannot pass
$this
to a procedural function.$this
is a reserved variable.You have to make the object first.
$this only makes sense in methods, not in functions
this is ok
this is not
// edit: didn't notice he passes "$this" as parameter
advice: simply replace "$this" with "$somethingElse"
As per my comments. You want to use
$this
as passed variable and php doesn't allow it outside class methods body.