| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
include('../includes/includes.inc.php'); |
|---|
| 26 |
include('../includes/config/global.inc.php'); |
|---|
| 27 |
|
|---|
| 28 |
$smarty = new Smarty_dotnode; |
|---|
| 29 |
$smarty->compile_id = 'pub'; |
|---|
| 30 |
|
|---|
| 31 |
$token = retreive_url_info($_SERVER["PHP_SELF"]); |
|---|
| 32 |
|
|---|
| 33 |
if( array_key_exists('dotnodeSessID', $_COOKIE) ) |
|---|
| 34 |
session_start(); |
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
for($idx=(count($token)-1); $idx>=0; $idx--) |
|---|
| 39 |
{ |
|---|
| 40 |
$inc = ""; |
|---|
| 41 |
for($level=0; $level<=$idx; $level++) |
|---|
| 42 |
$inc .= $token[$level].'/'; |
|---|
| 43 |
$inc = substr($inc,0,-1).'.inc.php'; |
|---|
| 44 |
if(file_exists(INCLUDEPATH.'/'.$inc)) |
|---|
| 45 |
break; |
|---|
| 46 |
} |
|---|
| 47 |
|
|---|
| 48 |
if(!file_exists(INCLUDEPATH.'/'.$inc)) |
|---|
| 49 |
$inc = 'index.inc.php'; |
|---|
| 50 |
|
|---|
| 51 |
include (INCLUDEPATH.'/'.$inc); |
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
for($idx=(count($token)-1); $idx>=0; $idx--) |
|---|
| 56 |
{ |
|---|
| 57 |
$tpl = ""; |
|---|
| 58 |
for($level=0; $level<=$idx; $level++) |
|---|
| 59 |
$tpl .= $token[$level].'/'; |
|---|
| 60 |
$tpl = substr($tpl,0,-1).'.tpl'; |
|---|
| 61 |
if($smarty->template_exists($tpl)) |
|---|
| 62 |
break; |
|---|
| 63 |
} |
|---|
| 64 |
|
|---|
| 65 |
if(!$smarty->template_exists($tpl)) |
|---|
| 66 |
$tpl='default.tpl'; |
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
$_SMARTY['token'] = $token; |
|---|
| 72 |
$_SMARTY['menu'] = $menu['pub']; |
|---|
| 73 |
$_SMARTY['smenu'] = $smenu['pub']; |
|---|
| 74 |
|
|---|
| 75 |
$_SMARTY['tpl'] = $tpl; |
|---|
| 76 |
$_SMARTY['lang'] = $lang; |
|---|
| 77 |
|
|---|
| 78 |
|
|---|
| 79 |
if($_SERVER['REMOTE_ADDR'] == $config['admin_ip']) |
|---|
| 80 |
{ |
|---|
| 81 |
$debug['session'] = $_SESSION; |
|---|
| 82 |
$_SMARTY['debug'] = $debug; |
|---|
| 83 |
$_SMARTY['php_mem'] = memory_get_usage()/1024; |
|---|
| 84 |
$_SMARTY['inc'] = $inc; |
|---|
| 85 |
} |
|---|
| 86 |
|
|---|
| 87 |
$smarty->assign($_SMARTY); |
|---|
| 88 |
|
|---|
| 89 |
header('Content-type: text/html; charset=UTF-8'); |
|---|
| 90 |
|
|---|
| 91 |
|
|---|
| 92 |
$smarty->display('index_head.tpl'); |
|---|
| 93 |
$smarty->display($tpl); |
|---|
| 94 |
$smarty->display('index_foot.tpl'); |
|---|
| 95 |
|
|---|
| 96 |
unset($_SESSION['error']); |
|---|
| 97 |
unset($_SESSION['temp']); |
|---|
| 98 |
|
|---|
| 99 |
?> |
|---|
| 100 |
|
|---|