root/trunk/dotnode-pub.php

Revision 16, 2.7 kB (checked in by alexx, 3 years ago)
  • cleanup crapy code in dotnode-xml.php
  • include new Smarty_dotnode object to fix #14
  • modify reset_data.sh bash script to fix log problem
  • remove hardcoded ini_set error_log in config (it must bi fixed in vhost, or if not possible: in config_server.inc.php
  • fix impossibility to change language in dotpage (cookie name not set correctly)
Line 
1 <?php
2 /****************************************************** Open .node ***
3  * Description:   
4  * Status:        Stable.
5  * Author:        Alexandre Dath <alexandre@dotnode.com>
6  * $Id$
7  *
8  * Copyright (C) 2005 Alexandre Dath <alexandre@dotnode.com>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software Foundation,
22  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23  ******************** http://opensource.ikse.net/projects/dotnode ***/
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 // Determination de l'include PHP a inclure
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 // Determination de la template a afficher
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 // Exportation des donnees pour Smarty
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 // Affiche du template
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 // ob_start('ob_gzhandler');
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
Note: See TracBrowser for help on using the browser.