ho fatto le prove con l'include_path e non funzia lo stesso... non mi dà errore... però non funziona neanche, perchè non mi mostra i risultati.
Codice PHP:
<?php
class Index
{
//<!--inclusioni--!>
//<!--do i valori alle classi--!>
var $p;
var $smarty="";
var $config="";
var $sql="";
var $themedir="";
function Index(){
error_reporting(E_ALL ^E_NOTICE);
session_start();
include_once 'C:/Programmi/PAMPA/PAMPA/apache/htdocs/php2/config.php';
$this->config = new config;
include_once $this->config->sitedir.'/includes/php/zend/library/Zend/Db.php';
include_once $this->config->sitedir.'/includes/php/zend/library/Zend.php';
include_once $this->config->sitedir.'/includes/php/libs/Smarty.class.php';
$this->smarty=new Smarty;
$params = array(
'host' => $this->config->host,
'username' => $this->config->user,
'password' => $this->config->pass,
'dbname' => $this->config->dbname
);
$this->sql = Zend_Db::factory('pdo_mysql', $params);
$result = $this->sql->query('SELECT value FROM '.$this->config->prefix.'config WHERE varname = :varname',array('varname'=>'style'));
$style = $result->fetchAll();
$style['value'] = 'classic';
$this->themedir = $this->config->sitedir.'/Theme/'.$style['value'];
$this->smarty->template_dir=$this->config->sitedir.'/Theme/'.$style['value'];
$this->smarty->compile_dir=$this->config->sitedir.'/Theme/'.$style['value'].'/templates_c';
$this->smarty->config_dir=$this->config->sitedir.'/Theme/'.$style['value'].'/config';
$this->smarty->compile_check = true;
$this->smarty->debugging = false;
if ($this->config->gzip == 'on')
{
if (@extension_loaded('zlib') && !headers_sent())
{
@ob_start('ob_gzhandler');
}
}
}
function view(){
$q=$this->sql->query('SELECT url, nome, visible FROM '.$this->config->prefix.'page ORDER BY id ASC LIMIT 0,10');
while($que = $q->fetchAll()){
if($que['visible'] == 1){
$ris .= '[url="'.$this->config->siteurl.'/'.$que['url'].'"]'.$que['nome'].'[/url] | ';
}
}
$pa=$this->config->path();
$this->p = $_GET['page'];
include_once($this->config->sitedir.'/page/'.$this->p.'.php');
$class='page_'.$this->p;
$var=array();
$var['themedir'] = $this->config->themedir;
$var['basedir'] = $this->config->sitedir;
$var['title'] = $this->config->title;
$var['forumurl'] = $this->config->forumurl;
$var['siteurl'] = $this->config->siteurl;
$var['p'] = $this->p;
$var['sid'] = isset($_SESSION['log']) ? session_id() : 'no';
$var['menu'] = $ris;
$time=time()-3600; // secondi
$this->sql->query("DELETE FROM ".$this->config->prefix."useron WHERE sessiontime < :time ",array('time'=>$time));
$page=new $class();
$page->variable = $var;
$page->page();
if(isset($_SESSION['log'])){
$this->sql->query('UPDATE '.$this->config->prefix.'useron SET sessiontime = \' :time \', zone = \' :zone \' WHERE sessionid = \' :sid \'',array('time'=>time(),'zone'=>ZONE, 'sid'=>$_SESSION['log']['sid']));
}
}
}
$index=new Index();
$index->view();
?>
non sò proprio che fare...
[ps] scusate se non mi funziona niente, ma io sono cocciadura... prima che capisco...