first commit
This commit is contained in:
51
common.php
Normal file
51
common.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
|
||||
//AUTOLOAD BEÁLLÍTÁSA
|
||||
spl_autoload_register(function ($class_name) {
|
||||
$exception = array(
|
||||
'Smarty',
|
||||
'Smarty_Internal_Data',
|
||||
'SmartyException',
|
||||
'Smarty_Internal_TemplateCompilerBase',
|
||||
'Smarty_Internal_Templatelexer',
|
||||
'Smarty_Internal_Templateparser',
|
||||
'Smarty_Internal_ParseTree_Template',
|
||||
'Smarty_Internal_ParseTree',
|
||||
'Smarty_Internal_ParseTree_Tag',
|
||||
'Smarty_Internal_ParseTree_Text',
|
||||
'Smarty_Internal_Extension_CodeFrame',
|
||||
'Smarty_Internal_Write_File',
|
||||
'Smarty_Internal_Extension_CodeFrame',
|
||||
'Smarty_Internal_Extension_CodeFrame',
|
||||
'Smarty_Internal_Extension_CodeFrame',
|
||||
'Smarty_Internal_CompileBase',
|
||||
'Smarty_Undefined_Variable',
|
||||
);
|
||||
if (!in_array($class_name, $exception)) include '_class/class_' . $class_name . '.php';
|
||||
});
|
||||
|
||||
//SMARTY BEÁLLÍTÁSA
|
||||
require('../Smarty/Smarty.class.php');
|
||||
|
||||
$smarty = new Smarty();
|
||||
|
||||
$smarty->setTemplateDir('template/templates');
|
||||
$smarty->setCompileDir('template/templates_c');
|
||||
$smarty->setCacheDir('template/cache');
|
||||
$smarty->setConfigDir('template/configs');
|
||||
|
||||
//SQL KAPCSOLAT BEÁLLÍTÁSA
|
||||
$sql = new sql('localhost','root','','badminton_coach');
|
||||
|
||||
if (isset($_COOKIE['badminton_coach_user'])) {
|
||||
$user = new user();
|
||||
$user->set_user_data_by_id($_COOKIE['badminton_coach_user']);
|
||||
//var_dump($user);
|
||||
}
|
||||
|
||||
//$page = new page();
|
||||
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user