modulo switch temes erro ao alterar arquivo controller.php
Enviado: 25 Ago 2011, 00:53
help-me
Galera, ao mudar p código de acordo com a orientação abaixo,
Find the following (lines 57 to 71):–
if (file_exists(DIR_TEMPLATE . $this->template)) {
extract($this->data);
ob_start();
require(DIR_TEMPLATE . $this->template);
$this->output = ob_get_contents();
ob_end_clean();
return $this->output;
} else {
exit('Error: Could not load template ' . DIR_TEMPLATE . $this->template . '!');
}
and replace with:
$filename = $this->template;
if (isset($this->request->get['theme']) && $this->request->get['theme'] || isset($this->session->data['theme'])) {
$directories = glob(DIR_APPLICATION . 'view/theme/*', GLOB_ONLYDIR);
$this->session->data['theme'] = (isset($this->request->get['theme']) && $this->request->get['theme']) ? $this->request->get['theme'] : $this->session->data['theme'];
foreach ($directories as $directory) {
if ($this->session->data['theme'] == basename($directory)) {
$tmp = explode('/', $filename);
$tmp[0] = $this->session->data['theme'];
$filename2 = implode('/', $tmp);
$file2 = DIR_TEMPLATE . $filename2;
if (file_exists($file2)) {
$filename = $filename2;
$this->data['template'] = $tmp[0];
}
break;
}
}
}
$file = DIR_TEMPLATE . $filename;
if (file_exists($file)) {
extract($this->data);
ob_start();
require($file);
$this->output = ob_get_contents();
ob_end_clean();
return $this->output;
} else {
exit('Error: Could not load template ' . $file . '!');
}
Da o seguinte erro de sintaxe syntax error, unexpected ';', expecting T_FUNCTION in /home/evoluind/public_html/loja/system/engine/controller.php on line 93 como não sou expert em php preciso de ajuda.
Versão da loja 1.5.1
Galera, ao mudar p código de acordo com a orientação abaixo,
Find the following (lines 57 to 71):–
if (file_exists(DIR_TEMPLATE . $this->template)) {
extract($this->data);
ob_start();
require(DIR_TEMPLATE . $this->template);
$this->output = ob_get_contents();
ob_end_clean();
return $this->output;
} else {
exit('Error: Could not load template ' . DIR_TEMPLATE . $this->template . '!');
}
and replace with:
$filename = $this->template;
if (isset($this->request->get['theme']) && $this->request->get['theme'] || isset($this->session->data['theme'])) {
$directories = glob(DIR_APPLICATION . 'view/theme/*', GLOB_ONLYDIR);
$this->session->data['theme'] = (isset($this->request->get['theme']) && $this->request->get['theme']) ? $this->request->get['theme'] : $this->session->data['theme'];
foreach ($directories as $directory) {
if ($this->session->data['theme'] == basename($directory)) {
$tmp = explode('/', $filename);
$tmp[0] = $this->session->data['theme'];
$filename2 = implode('/', $tmp);
$file2 = DIR_TEMPLATE . $filename2;
if (file_exists($file2)) {
$filename = $filename2;
$this->data['template'] = $tmp[0];
}
break;
}
}
}
$file = DIR_TEMPLATE . $filename;
if (file_exists($file)) {
extract($this->data);
ob_start();
require($file);
$this->output = ob_get_contents();
ob_end_clean();
return $this->output;
} else {
exit('Error: Could not load template ' . $file . '!');
}
Da o seguinte erro de sintaxe syntax error, unexpected ';', expecting T_FUNCTION in /home/evoluind/public_html/loja/system/engine/controller.php on line 93 como não sou expert em php preciso de ajuda.
Versão da loja 1.5.1