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