Prepared to experimentaly fire smarty from database...
[mirrors/Kyberia-bloodline.git] / wwwroot / nodes.php
1 <?php
2 //echo($_SERVER['PATH_INFO']."\n<pre>"); var_dump(preg_split('/\//', $_SERVER['PATH_INFO'])); die(); //PATH_INFO Debug (usefull when messing with mod_rewrite)
3 // output buffering forcing (mx)
4 if (!empty($_POST['FORCE_OB']) && $_POST['FORCE_OB'] == 'true') ob_start();
5
6 //header("Location: http://web.archive.org/web/20020925021139/http://kyberia.sk");
7 //echo "je to uz uplne v pici. vsetky data su stratene, prajem pekny den :)";
8 //exit;
9
10 //starting timer for benchmarking purposes
11 $timer_start=Time()+SubStr(MicroTime(),0,8);
12
13 //setting PHPSESSID cookie and starting user session
14 session_start();
15
16 error_reporting(1);
17 //$_SESSION['debugging']=1;
18 //exit;
19
20
21 if ($_SESSION['debugging']) {
22
23 error_reporting(E_ALL);
24 echo 'GET VARIABLES::<br/>';
25 print_r($_GET);
26 echo 'POST VARIABLES::<br/>';
27 print_r($_POST);
28 echo '<b>SESSION VARIABLES::</b><br/>';
29 print_r($_SESSION);
30 }
31
32
33 //Path info (Experimental - this replaced most of mod_rewrites...)
34 @$PATH_INFO=trim($_SERVER[PATH_INFO]);
35 if($PATH_INFO != '') {
36 $PATH_CHUNKS = preg_split('/\//', $PATH_INFO);
37 if(isset($PATH_CHUNKS[1])) switch($PATH_CHUNKS[1]) {
38 case 'k':
39 if(isset($PATH_CHUNKS[2]) && $PATH_CHUNKS[2] != '') $_GET['node_kid'] = $PATH_CHUNKS[2];
40 if(isset($PATH_CHUNKS[3]) && $PATH_CHUNKS[3] != '') $_GET['template_kid'] = $PATH_CHUNKS[3];
41 break;
42 case 'id':
43 if(isset($PATH_CHUNKS[2]) && $PATH_CHUNKS[2] != '') $_GET['node_id'] = $PATH_CHUNKS[2];
44 if(isset($PATH_CHUNKS[3]) && $PATH_CHUNKS[3] != '') $_GET['template_id'] = $PATH_CHUNKS[3];
45 break;
46 default:
47 if($PATH_CHUNKS[1] != '') $_GET['node_name'] = $PATH_CHUNKS[1];
48 if(isset($PATH_CHUNKS[2]) && $PATH_CHUNKS[2] != '') $_GET['template_kid'] = $PATH_CHUNKS[2];
49 break;
50 }
51 }
52 if(
53 (!isset($_GET['node_kid']) || trim($_GET['node_kid']) == '') &&
54 (!isset($_GET['node_id']) || trim($_GET['node_id']) == '')
55 ) $_GET['node_kid'] = 1;
56
57 //Base36 http://en.wikipedia.org/wiki/Base_36 (Initial support only :-)
58 if(isset($_GET['node_kid'])) $_GET['node_id'] = base_convert($_GET['node_kid'], 36, 10);
59 if(isset($_GET['template_kid'])) $_GET['template_id'] = base_convert($_GET['template_kid'], 36, 10);
60
61 //requiring main config file with path/database etc. constants
62 require('config/config.inc');
63 require(INCLUDE_DIR.'senate.inc');
64
65 if (isset($_SERVER['HTTP_REFERER'])) {
66 preg_match('/(k|id)\/([0-9]*)\//',$_SERVER['HTTP_REFERER'],$ref_match);
67 $referer_id=$ref_match[1];
68 }
69
70 //connecting to database and creating universal $db object
71 require(INCLUDE_DIR.'log.inc');
72 require(INCLUDE_DIR.'ubik.inc');
73 require(INCLUDE_DIR.'nodes.inc');
74 require(INCLUDE_DIR.'error_messages.inc');
75 require(INCLUDE_DIR.'database.inc');
76
77 $db = new CLASS_DATABASE();
78
79 if (!empty($_GET['template_id'])) {
80 $template_id=$_GET['template_id'];
81 } else {
82 $template_id=false;
83 }
84
85 //initializing node methods
86 if (!empty($_GET['node_name'])) {
87 $node = nodes::redirByName($_GET['node_name']);
88 } elseif (!empty($_GET['node_id'])) {
89 $node = nodes::getNodeById($_GET['node_id'],
90 (isset($_SESSION['user_id']))?$_SESSION['user_id']:'');
91 }
92
93 //XXX Paths are wrong (!)
94 //loading smarty template engine and setting main parameters
95 require(SMARTY_DIR.'Smarty.class.php');
96 $smarty = new Smarty;
97 require(INCLUDE_DIR.'smarty/resource.kyberia.php');
98
99 //$smarty->php_handling = SMARTY_PHP_REMOVE; //XXX
100 $smarty->template_dir = TEMPLATE_DIR;
101 //echo TEMPLATE_DIR.TEMPLATE_SET;
102 //echo $smarty->template_dir;
103 $smarty->compile_dir = SYSTEM_DATA.'templates_c/';
104 $smarty->config_dir = SMARTY_DIR.'configs/'; //XXX neexistuje
105 $smarty->cache_dir = SMARTY_DIR.'cache/';
106 $smarty->plugins_dir = SMARTY_PLUGIN_DIR ;
107 if ($_SESSION['debugging']) $smarty->debugging=true;
108
109 // initializing variables
110 // preg_replace prevents LFI
111 if (empty($_POST['event'])) $event=false;
112 else $event= preg_replace( "![^a-zA-Z0-9_]+!", "", $_POST['event']);
113
114
115 if ($_SESSION['debugging']) {
116 echo "<pre><b>NODE::";
117 print_r($node);
118 echo "</pre>";
119 }
120
121 if ((isset($_SESSION['user_id']) && ($node['node_creator']==$_SESSION['user_id']))) {
122 $node['node_permission']='owner';
123 }
124
125 if (isset($_SESSION['cube_vector']) && ($_SESSION['cube_vector'])) {
126 if (strpos($node['node_vector'],$_SESSION['cube_vector'])===false) {
127 echo "node::".$node['node_vector'];
128 echo "cube_Vector::".$_SESSION['cube_vector'];
129 echo "you are out of allowed cwbe. access forbidden";
130 die();
131 }
132 }
133
134 //if not existent node show our own 404
135 if (empty($node)) {
136 $nodes= nodes::getNodesByName($_GET['node_name']);
137 if ($nodes) {
138 $smarty->assign('nodes',$nodes);
139 $content=$smarty->display("404.tpl");
140 die();
141 }
142 elseif ($_SESSION['user_id']) {
143 $smarty->assign('node_name',$_GET['node_name']);
144 $content=$smarty->display("modules/addnode.tpl");
145 }
146 }
147
148 //modifying node glass pearl //XXX WTF
149 if (is_array($children_types[$node['node_type']])) {
150 $smarty->assign('children_types',$children_types[$node['node_type']]);
151 }
152 $smarty->assign('types',$types);
153
154
155 //$node['node_type']=$types[$node['node_type']];
156 $node['node_content']= StripSlashes($node['node_content']);
157 $node['node_name']= StripSlashes($node['node_name']);
158
159 //checking permissions
160 function _checkPermissions()
161 {
162 global $permissions, $node;
163
164 require(INCLUDE_DIR.'permissions.inc');
165 $permissions=permissions::checkPermissions($node);
166 $permissions['h']=permissions::isHierarch($node);
167 }
168
169 // mail rss
170 if ($template_id=='rss') //XXX WHAT?
171 {
172 $_feedType = "RSS0.91";
173 if (!is_numeric($_SESSION['user_id']))
174 {
175 if (!isset($_SERVER['PHP_AUTH_USER'])) {
176 header('WWW-Authenticate: Basic realm="Kyberia"');
177 header('HTTP/1.0 401 Unauthorized');
178 echo 'Cancel button';
179 exit;
180 }
181 else
182 {
183 require_once(EVENT_DIR.'/login.inc');
184 $_POST['login'] = $_SERVER['PHP_AUTH_USER'];
185 $_POST['password'] = $_SERVER['PHP_AUTH_PW'];
186 $_POST['login_type'] = "name";
187 if (!login())
188 {
189 echo "Zle meno/heslo.";
190 exit();
191 }
192 }
193 }
194
195 _checkPermissions();
196
197 // Mail
198 if ($_GET['node_id']==='24' && $permissions['r'])
199 {
200 require_once(INCLUDE_DIR.'/feedcreator.class.php');
201
202 $rss = new UniversalFeedCreator();
203 $rss->title = "Kyberia mail";
204 $rss->description = "";
205 $rss->link = "https://". SYSTEM_URL . "/id/24";
206
207 //XXX into function
208 $query = "select date_format(mail.mail_timestamp,\"%e.%c. %k:%i:%s\") as cas,
209 userfrom.user_action as locationfrom_action,
210 userfrom.user_action_id as locationfrom_action_id,
211 userto.user_action as locationto_action,
212 userto.user_action_id as locationto_action_id,
213 userto.login as mail_to_name, userfrom.login as mail_from_name,
214 mail.* from mail left join users as userfrom on
215 mail_from=userfrom.user_id left join users as userto on mail_to=userto.user_id
216 where mail_user='$_SESSION[user_id]' and mail_to='$_SESSION[user_id]' order by mail_id desc limit 0,10";
217
218 $set = $db->query($query);
219
220 while($set->next()) {
221 $m = $set->getRecord();
222 if ($m['mail_to'] != $_SESSION['user_id'])
223 continue;
224 $item = new FeedItem();
225 $item->title = $m['mail_from_name'];
226 $item->link = "https://".SYSTEM_URL."/id/24";
227 $item->description = $m['mail_text'];
228 $rss->addItem($item);
229 }
230 }
231 // bookmarks
232 elseif ($_GET['node_id']=='19' && $permissions['r'])
233 {
234 require_once(INCLUDE_DIR.'/feedcreator.class.php');
235
236 $rss = new UniversalFeedCreator();
237 $rss->title = "Kyberia bookmarks";
238 $rss->link = "http://".SYSTEM_URL."/id/19"; //XXX https ?
239
240 require_once(SMARTY_PLUGIN_DIR.'/function.get_bookmarks.php');
241 smarty_function_get_bookmarks(array(), $smarty);
242 $_items = $smarty->get_template_vars('get_bookmarks');
243 foreach ($_items as $_item)
244 {
245 if (is_array($_item['children']))
246 foreach ($_item['children'] as $_b)
247 {
248 $item = new FeedItem();
249 $item->title = $_b['node_name'];
250 $item->link = "http://".SYSTEM_URL."/id/".$_b['node_id']."/rss";
251 $rss->addItem($item);
252 }
253 }
254 $_feedType = 'OPML';
255 }
256 elseif ($permissions['r'])
257 {
258 require_once(INCLUDE_DIR.'/feedcreator.class.php');
259
260 $rss = new UniversalFeedCreator();
261 $rss->title = $node['node_name'];
262 $rss->description = "";
263 $rss->link = "http://".SYSTEM_URL."/id/".$node['node_id'];
264
265 // K list
266 if ($_GET['node_id']=='15')
267 {
268 require_once(SMARTY_PLUGIN_DIR.'/function.get_k.php');
269 smarty_function_get_k(array(), $smarty);
270 $_items = $smarty->get_template_vars('get_k');
271 }
272 else
273 {
274 require_once(SMARTY_PLUGIN_DIR.'/function.get_children.php');
275 smarty_function_get_children(
276 array('orderby' => 'desc', 'orderby_type' => 'time'), $smarty);
277 $_items = $smarty->get_template_vars('get_children');
278 }
279
280 foreach ($_items as $_item)
281 {
282 $item = new FeedItem();
283 $item->title = $_item['node_name'];
284 $item->link = "http://".SYSTEM_URL."/id/".$_item['node_id'];
285 $item->description = $_item['node_content'];
286 $rss->addItem($item);
287 }
288 }
289
290 if ($permissions['r']) $rss->showFeed($_feedType);
291 exit();
292 }
293
294 _checkPermissions();
295
296 //entering the node
297
298 //sventest
299 if (($permissions['r']) || ($event != 'register')) {
300
301 //performing node_events (based on update/insert/delete db queries)
302 if ($event) {
303 require(INCLUDE_DIR.'eventz.inc');
304 }
305
306 elseif ($transaction) {
307 require(INCLUDE_DIR.'transaction.inc');
308 }
309 //end of performing node events
310
311 //sventest
312 }
313
314
315 if ($permissions['r']) {
316
317 // these 4 lines are not the source of kyberia lagging problems.
318 // leave them. started on the 10.4.
319 // data gained will be used for scientific purposes
320
321 // if (isset($_SESSION['user_id']) {
322 // log_levenshtein($_SESSION['user_id'],$node['node_id']);
323 // }
324
325 if ((isset($_SESSION['user_id'])) && ($_SESSION['user_id'])) {
326 $q="insert delayed into levenshtein set user_id='".$_SESSION['user_id']."',node_id='".$node['node_id']."'";
327 $db->update($q);
328 }
329
330 //if node is css
331 //XXX into function
332 if ($node['template_id']!='2019721'){
333
334 logger::log('enter',$node['node_id'],'ok',$node['node_user_subchild_count']);
335 if (!empty($_SESSION['user_id']) && is_numeric($node['node_id'])) {
336 $q="update node_access set visits=visits+1,node_user_subchild_count='0',last_visit=NOW() where node_id='".$node['node_id']."' and user_id='".$_SESSION['user_id']."'";
337 // echo $q;
338 $result=$db->update($q);
339
340 if (!$result) {
341 $q="insert into node_access set user_id='".$_SESSION['user_id']."',node_id='".$node['node_id']."',last_visit=NOW()";
342 $db->query($q);
343 }
344 }//end of if node os css
345 }
346
347 }
348
349 //XXX into function
350 // if (isset($_SESSION['user_id']) {
351 // if (isset($referer_id)) {
352 // update_nodes($_SESSION['user_id'],$node['node_id'],$referer_id);
353 // } else {
354 // update_nodes($_SESSION['user_id'],$node['node_id'],0);
355 // }
356 // }
357
358 // DO NOT MESS WITH THIS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
359 //creating neural network
360 $db->update("update nodes set node_views=node_views+1 where node_id='".$node['node_id']."'");
361 if (isset($referer_id) && is_numeric($referer_id)) {
362 $q="update neurons set synapse=synapse+1 where dst='".$node['node_id']."' and src='$referer_id'";
363 $result=$db->update($q);
364 if (!$result) {
365 $q="insert into neurons set synapse_creator='".$_SESSION['user_id']."',dst='".$node['node_id']."',src='$referer_id',synapse=1";
366 $db->query($q);
367 }
368 }
369
370
371 elseif (!$permissions['r'] && $_GET['magic_word']) {
372 $magic_word_big=$_GET['magic_word'];
373
374 if ( preg_match("/(\d+)-(.+)/",$_GET['magic_word'],$mu)) {
375 $magic_uid=$mu['1'];
376 $magic_word=addslashes($mu['2']);
377 // XXX WTF column magic_word does not exists
378 $q="select login from users where user_id='$magic_uid' and magic_word='$magic_word'";
379 $set=$db->query($q);
380 if ($set->getNumRows()) {
381 $permissions['r']=true;
382 }
383 }
384 }
385
386
387
388
389
390 else {
391 logger::log('enter',$node['node_id'],'failed');
392 }
393
394
395
396 //assigning user data to smarty if user logged in
397 if (isset($_SESSION['user_id'])&&($user_id=$_SESSION['user_id'])) {
398 $smarty->assign('_POST',$_POST);
399 $smarty->assign('bookmarks',$_SESSION['bookmarks']);
400 $smarty->assign('ignore',$_SESSION['ignore']);
401 $smarty->assign('bookstyl',$_SESSION['bookstyl']);
402 $smarty->assign('fook',$_SESSION['fook']);
403 $smarty->assign('user_id',$_SESSION['user_id']);
404 if (!empty($_SESSION['cube_vector']))
405 $smarty->assign('cube_vector',$_SESSION['cube_vector']);
406 $smarty->assign('friends',$_SESSION['friends']); //req by freezy, done by darkaural
407 $smarty->assign('user_quota',$_SESSION['user_quota']);
408
409 // XXX into function
410 $newmail_q = sprintf('select u.user_mail_id
411 , u.user_k
412 , u.k_wallet
413 , u.user_mail
414 , ms.user_id as mail_sender_id
415 , ms.login as mail_sender
416 from users u
417 left join users ms on ms.user_id = u.user_mail_id
418 where u.user_id = %d',
419 $user_id);
420 $newmailset = $db->query($newmail_q);
421
422
423 $newmailset->next();
424 $new_mail=$newmailset->getString('user_mail');
425 // XXX into function
426 $newmailset2 = $db->query("select users.user_mail_id,mailsender.login
427 from users left join users as mailsender on users.user_mail_id = mailsender.user_id where users.user_id = '$user_id'");
428 $newmailset2->next();
429 $smarty->assign('new_mail',$new_mail);
430 $smarty->assign('new_mail_name',$newmailset->getString('mail_sender'));
431 $smarty->assign('new_mail_name2',$newmailset2->getString('login'));
432 $user_k=$newmailset->getString('user_k');
433 $smarty->assign('user_k',$user_k);
434 $k_wallet=$newmailset->getString('k_wallet');
435 $smarty->assign('k_wallet',$k_wallet);
436 $user_id=$_SESSION['user_id'];
437
438 //mail node
439 if ($node['node_name']=='mail') {
440
441 //clear new mail message
442
443 if ($new_mail) $db->query("update users set user_mail=0 where user_id='$user_id'");
444
445 //set messages as delivered to recipient
446 $set=$db->query("select mail_id,mail_duplicate_id from mail where mail_user='$user_id' and mail_to='$user_id' and mail_read='no'");
447 while($set->next()) {
448 $db->query("update mail set mail_read='yes' where mail_id='".$set->getString('mail_duplicate_id')."'");
449 $db->query("update mail set mail_read='yes' where mail_id='".$set->getString('mail_id')."'");
450
451 $new_messages[$set->getString('mail_id')]=true;
452 }
453 /*
454 if (count($new_messages)) {
455 $db->query("update mail set mail_read='yes' where mail_user='$user_id' and mail_user=mail_to and mail_read='no'");
456 $smarty->assign('new_messages',$new_messages);
457
458 }
459 */
460 }
461 }
462
463
464
465 if ($node['node_system_access']=='crypto') {
466 $smarty->assign('crypto_pass',$_SESSION['crypto'][$node['node_id']]);
467 }
468
469 $smarty->assign('error',$error);
470 $smarty->assign('permissions',$permissions);
471 $smarty->assign('current_vector',$node['node_vector']);
472 if ($permissions['r']) $smarty->assign('node',$node);
473 else {
474
475 $smarty->assign('node',$node);
476 //new templates by Dark matter
477 $smarty->template_dir=OWN_TEMPLATE_DIR;
478
479 $smarty->display('1549864.tpl');
480 $smarty->display('1549885.tpl');
481 $smarty->display('630526.tpl');
482 die();
483
484 //redirect to mainpage
485 // looks like poeple totaly hate this redirect!
486 // header("Location: /id/1");
487 }
488
489
490 // XXX into function
491 if (($node['template_id']!='2019721') && (isset($_SESSION['user_id']))){
492 //setting user location
493 $q="update users set last_action=NOW(),user_location_vector='".$node['node_vector']."',user_action='".addslashes($node['node_name'])."',user_action_id='".$node['node_id']."' where user_id='".$_SESSION['user_id']."'";
494 $db->executequery($q);
495 }
496
497 $whole_time=SubStr((Time()+SubStr(MicroTime(),0,8)-$timer_start),0,7);
498 $smarty->assign('whole_time',$whole_time);
499
500
501 if ($template_id=='download' OR $template_id=='download.jpg') {
502 if ($permissions['r']) {
503 $linkname = SYSTEM_ROOT."/files/".$node['node_id'];
504 $filename= readlink($linkname);
505 $suffix=preg_replace("/(.*?)\.(.*?)/i","$2",$filename);
506
507 $ext = substr( $filename,-3 );
508 if( $filename == "" ) {
509 echo "ERROR: Empty file to download. ";
510 exit;
511 } elseif ( ! file_exists( $filename ) ) {
512 exit;
513 };
514 switch( strtolower($ext) ){
515 case "pdf": $ctype="application/pdf"; break;
516 case "exe": $ctype="application/octet-stream"; break;
517 case "zip": $ctype="application/zip"; break;
518 case "doc": $ctype="application/msword"; break;
519 case "xls": $ctype="application/vnd.ms-excel"; break;
520 case "ppt": $ctype="application/vnd.ms-powerpoint"; break;
521 case "gif": $ctype="image/gif"; break;
522 case "png": $ctype="image/png"; break;
523 case "jpg": $ctype="image/jpg"; break;
524 default: $ctype="application/force-download";
525 }
526 $file=str_replace(" ","_",$node['node_name']).".$ext";
527 header("Pragma: public");
528 header("Expires: 0");
529 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
530 header("Content-Type: $ctype");
531 $user_agent = strtolower ($_SERVER["HTTP_USER_AGENT"]);
532 if ((is_integer (strpos($user_agent, "msie"))) && (is_integer
533 (strpos($user_agent, "win")))) {
534 header( "Content-Disposition: filename=$file;" );
535 } else {
536 header( "Content-Disposition: attachment;
537 filename=$file;" );
538 }
539 header("Content-Transfer-Encoding: binary");
540 header("Content-Length: ".filesize($filename));
541 readfile("$filename");
542 exit();
543 }
544 else { echo "you don't have permissions for downloading this data"; die(); }
545 }
546
547 if ($node['template_id']=='2019721'){
548 Header("Cache-control: max-age=3600");
549 }else{
550 Header("Cache-control: no-cache");
551 Header("Expires:".gmdate("D, d M Y H:i:s")." GMT");
552 header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
553 }
554
555
556 //for cases like search & preview
557 $smarty->assign('post_vars',$_POST);
558 if (!empty($_POST['template_event'])) {
559 $smarty->assign('template_event',$_POST['template_event']);
560
561 }
562
563 //setting listing parameters
564 $children_count=$node['node_children_count'];
565 $descendant_count=$node['node_descendant_count'];
566
567 if (isset($_POST['listing_amount']) && is_numeric($_POST['listing_amount'])) {
568 $listing_amount=mysql_real_escape_string($_POST['listing_amount']);
569 }elseif (!empty($_SESSION['listing_amount'])) $listing_amount=$_SESSION['listing_amount'];
570 else $listing_amount=DEFAULT_LISTING_AMOUNT;
571 $smarty->assign('listing_amount',$listing_amount);
572
573 if (isset($_POST['listing_order']) && $_POST['listing_order']) {
574 $listing_order=mysql_real_escape_string($_POST['listing_order']);
575 } elseif (!empty($_SESSION['listing_order'])) $listing_order=$_SESSION['listing_order'];
576 else $listing_order=DEFAULT_LISTING_ORDER;
577 $smarty->assign('listing_order',$listing_order);
578
579 if (isset ($_POST['get_children_offset']) && is_numeric($_POST['get_children_offset'])) {
580 $offset=$_POST['get_children_offset'];
581 } else { $offset=0; }
582
583
584 //movement forward and backward
585 // if ($listing_order=='asc' && !$offset) $offset=$descendant_count-$listing_amount;
586
587 if ($_POST['get_children_move']=='<') {
588 $offset=$offset-$listing_amount;
589 if ($offset<0) $offset=0;
590 }
591 elseif ($_POST['get_children_move']=='>') {
592 $offset=$offset+$listing_amount;
593 }
594 elseif ($_POST['get_children_move']=='>>') {
595 $offset=$descendant_count-$listing_amount;
596 }
597
598 elseif ($_POST['get_children_move']=='<<') {
599 $offset=0;
600 }
601 if ($offset<0) $offset=0;
602 $_POST['offset']=$offset;
603 $smarty->assign('offset',$offset);
604
605
606 if ($node['external_link']=='header://svg' && !is_numeric($template_id)) {
607 header("Content-Type: image/svg+xml");
608 }
609
610 //show own header
611 elseif (isset($_SESSION['header_id']) && ($_SESSION['header_id']==true)) {
612 $smarty->assign('header_id',$_SESSION['header_id']);
613 $smarty->template_dir=OWN_TEMPLATE_DIR;
614 $content=$smarty->fetch($_SESSION['header_id'].".tpl");
615 $smarty->template_dir = TEMPLATE_DIR.TEMPLATE_SET;
616 //not registered user
617 if ($_SESSION['header_id']==2091520) {
618 echo $content;
619 session_destroy();
620 die();
621 }
622 }
623
624 $smarty->template_dir=OWN_TEMPLATE_DIR;
625
626 if (is_numeric($template_id)) {
627 $content.=$smarty->fetch($template_id.".tpl");
628 }
629
630 else {
631 $template_id=$node['template_id'];
632 $content.=$smarty->fetch($node['template_id'].".tpl");
633 }
634
635 if ($template_id=='2019721'){
636 $content=$smarty->fetch($template_id.".tpl");
637 echo $content;
638 }else{
639 $time=SubStr((Time()+SubStr(MicroTime(),0,8)-$timer_start),0,7);
640 echo $content;
641 // echo "<center>page generation took: $time second</center>";
642 }
643 //end of displaying
644
645 // output buffering forcing (mx)
646 if (!empty($_POST['FORCE_OB']) && $_POST['FORCE_OB'] == 'true') ob_end_flush();
647
648 ?>
This page took 1.026178 seconds and 5 git commands to generate.