tpl = $tpl;
$this->options = array();
$this->options['path'] = $options_array[0]; // (STRING), se termine toujours par un /
$this->options['meta'] = $options_array[1]; // (ARRAY) (titre, sous-titre);
$this->options['css_int'] = $options_array[2]; // (ARRAY) array(1,3,8);
$this->options['js_int'] = $options_array[3]; // (ARRAY) array(1,3,8);
$this->CSS();
$this->JS();
$this->meta();
$this->foot();
}
private function CSS ()
{
$css_array = array (
array('base','screen'),
array('bbcode', 'all'),
array('forms', 'screen'),
array('messages', 'screen'),
array('msg', 'screen'),
array('pagination', 'screen'),
array('table', 'screen')
);
$css = '';
foreach($this->options['css_int'] as $v)
{
$css .=
''."\n";
}
$this->tpl->assign('css_include', $css);
return true;
}
private function JS()
{
$js_array = array(
'mootools','scroll','textarea', 'windoo'
);
$js = '';
foreach($this->options['js_int'] as $v)
{
$js .=
''."\n";
}
$this->tpl->assign('url_directory_tpl', $this->options['path']);
$this->tpl->assign('js_include', $js);
return true;
}
private function meta()
{
$keywords = strtr(strtolower($this->options['meta'][0]),
'áàâäãåçéèêëíìîïñóòôöõúùûüýÿ','aaaaaaceeeeiiiinooooouuuuyy');
$carsforbidden = array('~', '`', '!', '@',
'#', '\$', '%', '^', '&', '*', '(',
')', '+', '{', '}', '-', '_', '[',
']', '|', '\\', '\'', ':' ,'"', ';',
'<', '>', ',', '.', '/', '?', '+', '=' );
$keywords = str_replace($carsforbidden, '', $keywords);
$arr = explode(' ', $keywords);
rsort($arr);
$i = 0;
$c =count($arr);
while($i < $c){
if($arr[$i] == NULL)
{
unset($arr[$i]);
}
$i++;
}
$this->tpl->assign('title', implode(' - ', $this->options['meta']));
$this->tpl->assign('meta_include',
''."\n".'
options['meta'][0]).'" />');
return true;
}
private function foot()
{
global $sql, $bench;
$objetxml = new XMLStats();
if($_SESSION['connect'] === true)
{
$objetxml->AddMember(
$_SESSION['context']['pseudo'],
$_SESSION['context']['ID'],
'http://'.htmlspecialchars($_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'])
);
}
else
{
$objetxml->AddGuest(
'http://'.htmlspecialchars($_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'])
);
}
$objetxml->RefreshList();
$nbu = $objetxml->UsersCount();
$nbq = $sql->nbQuery;
$foot =
$nbu.' connecté
'.(($nbu > 1) ? 's' : '').'
-
'.$nbq.' requête
'.(($nbq > 1) ? 's' : '').'
- ';
$bench->end_bench();
$foot .= $bench->return_simple_result();
$this->tpl->assign('footer', $foot);
return true;
}
}
?>