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