-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·478 lines (402 loc) · 22.9 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
<?php
#####################################
# ShopCMS: Ñêðèïò èíòåðíåò-ìàãàçèíà
# Copyright (c) by ADGroup
# http://shopcms.ru
#####################################
define('ERROR_DB_INIT', 'Database connection problem!');
function gmts()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
$sc_1 = gmts(); $sc_4 = 0; $sc_8 = 0; $gmc = 1;
include("core/config/init.php");
include("core/includes/database/mysql.php");
$far_1 = array("core/config/connect.inc.php"
,"core/config/language_list.php"
,"core/classes/class.ajax.php"
,"core/classes/class.kcaptcha.php"
,"core/classes/class.virtual.paymentmodule.php"
,"core/classes/class.virtual.shippingratecalculator.php"
,"core/classes/class.xml2array.php");
$far_2 = glob("core/functions/*.php");
$far = array_merge($far_1,$far_2);
$cfar = count($far);
if(file_exists("core/cache/fcache.php")) include ("core/cache/fcache.php");
else for ($n=0; $n<$cfar; $n++) include ($far[$n]);
define('PATH_DELIMITER', isWindows()?';':':');
$_POST = xStripSlashesGPC($_POST);
$_GET = xStripSlashesGPC($_GET);
$_COOKIE = xStripSlashesGPC($_COOKIE);
db_connect(DB_HOST, DB_USER, DB_PASS) or die(ERROR_DB_INIT);
db_select_db(DB_NAME) or die(db_error());
settingDefineConstants();
// Friendly URLs module
include('url_rewriter.php');
include ("core/config/headers.php");
include ("core/config/error_handler.php");
function set_cookie($Name, $Value = '', $Expires = '', $Secure = false, $Path = '', $Domain = '', $HTTPOnly = false) {
header('Set-Cookie: ' . rawurlencode($Name) . '=' . rawurlencode($Value)
. (empty($Expires) ? '' : '; expires=' . gmdate('D, d-M-Y H:i:s', $Expires) . ' GMT')
. (empty($Path) ? '' : '; path=' . $Path)
. (empty($Domain) ? '' : '; domain=' . $Domain)
. (!$Secure ? '' : '; secure')
. (!$HTTPOnly ? '' : '; HttpOnly'), false);
}
# ñòàðòóåì ñåññèþ
define("SECURITY_EXPIRE", 60 * 60 * CONF_SECURITY_EXPIRE);
session_set_save_handler("sess_open", "sess_close", "sess_read", "sess_write", "sess_destroy", "sess_gc");
session_start();
# ïîñûëàåì cookie ñåññèè
if (isset ($_COOKIE["PHPSESSID"])){
if(SECURITY_EXPIRE > 0){
set_cookie("PHPSESSID", $_COOKIE["PHPSESSID"], time() + SECURITY_EXPIRE);
}else{
set_cookie("PHPSESSID", $_COOKIE["PHPSESSID"]);
}
}
//select a new language?
if (isset($_POST["lang"])) $_SESSION["current_language"] = $_POST["lang"];
//current language session variable
if (!isset($_SESSION["current_language"]) || $_SESSION["current_language"] < 0 || $_SESSION["current_language"] >
count($lang_list)) $_SESSION["current_language"] = 0; //set default language
//include a language file
if (isset($lang_list[$_SESSION["current_language"]]) && file_exists("core/languages/".$lang_list[$_SESSION["current_language"]]->
filename))
{
//include current language file
include ("core/languages/".$lang_list[$_SESSION["current_language"]]->filename);
}
else
{
die("<font color=red><b>ERROR: Couldn't find language file!</b></font>");
}
if ( isset ( $_GET["do"] )) {
# BEGIN filter-ajax
#if ( in_array($_GET["do"], array( "captcha", "cart", "rss", "compare", "yandex", "invoice_jur", "invoice_phys", "stat", "get_file" ))) {
if ( in_array($_GET["do"], array( "captcha", "cart", "rss", "compare", "yandex", "invoice_jur", "invoice_phys", "stat", "get_file", "filter" ))) {
# END filter-ajax
include ( "core/includes/processor/".$_GET["do"].".php" );
}
else {
header("HTTP/1.0 404 Not Found");
header("HTTP/1.1 404 Not Found");
header("Status: 404 Not Found");
die(ERROR_404_HTML);
}
} else {
//init Smarty
require ("core/smarty/smarty.class.php");
$smarty = new Smarty; //core smarty object
$smarty_mail = new Smarty; //for e-mails
if ((int)CONF_SMARTY_FORCE_COMPILE) //this forces Smarty to recompile design each time someone runs index.php
{
$smarty->force_compile = true;
$smarty_mail->force_compile = true;
}
$relaccess = checklogin();
//# of selected currency
$current_currency = isset($_SESSION["current_currency"]) ? $_SESSION["current_currency"] : CONF_DEFAULT_CURRENCY;
$smarty->assign("current_currency", $current_currency);
$q = db_query("select code, currency_value, where2show, currency_iso_3, Name, roundval from ".CURRENCY_TYPES_TABLE." where CID=".(int)$current_currency);
if ($row = db_fetch_row($q))
{
$smarty->assign("currency_name", $row[0]);
$selected_currency_details = $row; //for show_price() function
}
else //no currency found. In this case check is there any currency type in the database
{
$q = db_query("select code, currency_value, where2show, roundval from ".CURRENCY_TYPES_TABLE);
if ($row = db_fetch_row($q))
{
$smarty->assign("currency_name", $row[0]);
$selected_currency_details = $row; //for show_price() function
}
}
$smarty->assign("currency_roundval", $selected_currency_details["roundval"]);
//set $categoryID
if (isset($_GET["categoryID"]) || isset($_POST["categoryID"]))
{
$categoryID = isset($_GET["categoryID"]) ? $_GET["categoryID"] : $_POST["categoryID"];
$categoryID = (int)$categoryID;
}
// else $categoryID = 1;
// set $productID
if (isset($_GET["productID"]) || isset($_POST["productID"]))
{
$productID = isset($_GET["productID"]) ? $_GET["productID"] : $_POST["productID"];
$productID = (int)$productID;
}
//and different vars...
if (isset($_GET["register"]) || isset($_POST["register"]))
$register = isset($_GET["register"]) ? $_GET["register"] : $_POST["register"];
if (isset($_GET["update_details"]) || isset($_POST["update_details"]))
$update_details = isset($_GET["update_details"]) ? $_GET["update_details"] : $_POST["update_details"];
if (isset($_GET["order"]) || isset($_POST["order"]))
$order = isset($_GET["order"]) ? $_GET["order"] : $_POST["order"];
if (isset($_GET["order_without_billing_address"]) || isset($_POST["order_without_billing_address"]))
$order_without_billing_address = isset($_GET["order_without_billing_address"]) ? $_GET["order_without_billing_address"] : $_POST["order_without_billing_address"];
if (isset($_GET["check_order"]) || isset($_POST["check_order"]))
$check_order = isset($_GET["check_order"]) ? $_GET["check_order"] : $_POST["check_order"];
if (isset($_GET["proceed_ordering"]) || isset($_POST["proceed_ordering"]))
$proceed_ordering = isset($_GET["proceed_ordering"]) ? $_GET["proceed_ordering"] : $_POST["proceed_ordering"];
if (isset($_GET["update_customer_info"]) || isset($_POST["update_customer_info"]))
$update_customer_info = isset($_GET["update_customer_info"]) ? $_GET["update_customer_info"] : $_POST["update_customer_info"];
if (isset($_GET["show_aux_page"]) || isset($_POST["show_aux_page"]))
$show_aux_page = isset($_GET["show_aux_page"]) ? $_GET["show_aux_page"] : $_POST["show_aux_page"];
if (isset($_GET["visit_history"]) || isset($_POST["visit_history"])) $visit_history = 1;
if (isset($_GET["order_history"]) || isset($_POST["order_history"])) $order_history = 1;
if (isset($_GET["address_book"]) || isset($_POST["address_book"])) $address_book = 1;
if (isset($_GET["address_editor"]) || isset($_POST["address_editor"]))
$address_editor = isset($_GET["address_editor"]) ? $_GET["address_editor"] : $_POST["address_editor"];
if (isset($_GET["add_new_address"]) || isset($_POST["add_new_address"]))
$add_new_address = isset($_GET["add_new_address"]) ? $_GET["add_new_address"] : $_POST["add_new_address"];
if (isset($_GET["contact_info"]) || isset($_POST["contact_info"]))
$contact_info = isset($_GET["contact_info"]) ? $_GET["contact_info"] : $_POST["contact_info"];
if (isset($_GET["comparison_products"]) || isset($_POST["comparison_products"])) $comparison_products = 1;
if (isset($_GET["register_authorization"]) || isset($_POST["register_authorization"])) $register_authorization = 1;
if (isset($_GET["page_not_found"]) || isset($_POST["page_not_found"])) $page_not_found = 1;
if (isset($_GET["news"]) || isset($_POST["news"])) $news = 1;
if (isset($_GET["quick_register"])) $quick_register = 1;
if (isset($_GET["order2_shipping_quick"])) $order2_shipping_quick = 1;
if (isset($_GET["order3_billing_quick"])) $order3_billing_quick = 1;
if (isset($_GET["order2_shipping"]) || isset($_POST["order2_shipping"])) $order2_shipping = 1;
if (isset($_GET["order3_billing"]) || isset($_POST["order3_billing"])) $order3_billing = 1;
if (isset($_GET["change_address"]) || isset($_POST["change_address"])) $change_address = 1;
if (isset($_GET["order4_confirmation"]) || isset($_POST["order4_confirmation"])) $order4_confirmation = 1;
if (isset($_GET["order4_confirmation_quick"]) || isset($_POST["order4_confirmation_quick"])) $order4_confirmation_quick = 1;
if (isset($_GET["order_detailed"]) || isset($_POST["order_detailed"]))
$order_detailed = isset($_GET["order_detailed"]) ? $_GET["order_detailed"] : $_POST["order_detailed"];
if (isset($_GET["p_order_detailed"]) || isset($_POST["p_order_detailed"]))
$p_order_detailed = isset($_GET["p_order_detailed"]) ? $_GET["p_order_detailed"] : $_POST["p_order_detailed"];
if (!isset($_SESSION["vote_completed"])) $_SESSION["vote_completed"] = array();
//checking for proper $offset init
$offset = isset($_GET["offset"]) ? $_GET["offset"] : 0;
if ($offset < 0 || $offset % CONF_PRODUCTS_PER_PAGE) $offset = 0;
if (isset($productID)) //to rollout categories navigation table
{
$q = db_query("select categoryID FROM ".PRODUCTS_TABLE." WHERE productID=".(int)$productID);
$r = db_fetch_row($q);
if ($r) $categoryID = $r[0];
}
if (isset($_POST["change_design"])) $_SESSION['CUSTOM_DESIGN'] = $_POST["change_design"];
if (isset($_SESSION["CUSTOM_DESIGN"]))
{
$smarty->template_dir = "core/tpl/user/".$_SESSION["CUSTOM_DESIGN"];
define('TPL', $_SESSION["CUSTOM_DESIGN"]);
}
else
{
$smarty->template_dir = "core/tpl/user/".CONF_DEFAULT_TEMPLATE;
define('TPL', CONF_DEFAULT_TEMPLATE);
}
$smarty_mail->template_dir = "core/tpl/email";
//fetch currency types from database
$q = db_query("select CID, Name, code, currency_value, where2show, roundval, currency_iso_3 from ".CURRENCY_TYPES_TABLE." order by sort_order");
$currencies = array();
while ($row = db_fetch_row($q)) $currencies[] = $row;
$smarty->assign("currencies", $currencies);
$smarty->assign("currencies_count", count($currencies));
$smarty->assign("lang_list", $lang_list);
if (isset($_SESSION["current_language"])) $smarty->assign("current_language", $_SESSION["current_language"]);
if (isset($_SESSION["log"])) $smarty->assign("log", $_SESSION["log"]);
// - following vars are used as hidden in the customer survey form
if (isset($categoryID)) $smarty->assign("categoryID", $categoryID);
if (isset($productID)) $smarty->assign("productID", $productID);
if (isset($_GET["currency"])) $smarty->assign("currency", $_GET["currency"]);
if (isset($_GET["user_details"])) $smarty->assign("user_details", $_GET["user_details"]);
if (isset($_GET["aux_page"])) $smarty->assign("aux_page", $_GET["aux_page"]);
if (isset($_GET["show_price"])) $smarty->assign("show_price", $_GET["show_price"]);
if (isset($_GET["searchstring"])) $smarty->hassign("searchstring", $_GET["searchstring"]);
if (isset($register)) $smarty->assign("register", $register);
if (isset($order)) $smarty->assign("order", $order);
if (isset($check_order)) $smarty->assign("check_order", $check_order);
//set defualt main_content template to homepage
$smarty->assign("main_content_template", "home.tpl.html");
//catalog
$q = db_query("select categoryID, name, products_count, products_count_admin, parent, picture, subcount FROM ".CATEGORIES_TABLE." ORDER BY sort_order, name");
$fc = array(); //parents
$mc = array(); //parents
while ($row = db_fetch_row($q)) {
$fc[(int)$row["categoryID"]] = $row;
$mc[(int)$row["categoryID"]] = (int)$row["parent"];
}
$cats = catGetCategoryCListMin();
//include all .php files from core/includes/ dir or from cache
if ((int)CONF_SMARTY_FORCE_COMPILE)
{
if(file_exists("core/cache/incache.php")) unlink ("core/cache/incache.php");
if(file_exists("core/cache/fcache.php")) unlink ("core/cache/fcache.php");
$fls = glob("core/includes/*.php");
$cfls = count($fls);
for ($zc=0; $zc<$cfls; $zc++) include ($fls[$zc]);
}else{
if(file_exists("core/cache/incache.php")) include ("core/cache/incache.php");
else{
ob_start();
for ($n=0; $n<$cfar; $n++) readfile ($far[$n]);
$_res = ob_get_contents();
ob_end_clean();
$fh = fopen("core/cache/fcache.php", 'w');
fwrite($fh, $_res);
fclose($fh);
unset($_res);
$fls = glob("core/includes/*.php");
$cfls = count($fls);
ob_start();
for ($i=0; $i<$cfls; $i++) readfile ($fls[$i]);
$_res = ob_get_contents();
ob_end_clean();
$fh = fopen("core/cache/incache.php", 'w');
fwrite($fh, $_res);
fclose($fh);
unset($_res);
include ("core/cache/incache.php");
}
}
//show admin a administrative mode link
if (isset($_SESSION["log"]) && in_array(100, $relaccess))
{
$smarty->assign("isadmin", "yes");
$adminislog = true;
}
else
{
$adminislog = false;
}
$exploerrors = "";
if (file_exists("install.php")) $exploerrors .= WARNING_DELETE_INSTALL_PHP;
if (!is_writable("core/cache")) die(WARNING_WRONG_CHMOD);
$RGLBLS = @ini_get('register_globals');
if (strtolower($RGLBLS)=="on" || (int)$RGLBLS==1) die(WARNING_REGISTER_GLOBALS);
$smarty->assign("exploerrors", $exploerrors);
$tmpb = array();
foreach ($leftb as $keylb => $vallb)
{
if ($vallb["which"] == 1) {
if (!in_array($smarty -> get_template_vars("main_content_template"), $vallb["pages"]) && !in_array($aux_page["aux_page_ID"], $vallb["dpages"]) && !in_array($categoryID, $vallb["categories"]) && !in_array($productID, $vallb["products"])) $vallb["state"] = false;
if (in_array($categoryID, $vallb["categories"]) && !in_array($productID, $vallb["products"]) && $smarty -> get_template_vars("main_content_template") == "product_detailed.tpl.html") $vallb["state"] = false;
} else {
if ($vallb["which"] == 2)
if (in_array($smarty -> get_template_vars("main_content_template"), $vallb["pages"]) || in_array($aux_page["aux_page_ID"], $vallb["dpages"]) || in_array($categoryID, $vallb["categories"]) || in_array($productID, $vallb["products"])) $vallb["state"] = false;
if (in_array($categoryID, $vallb["categories"]) && !in_array($productID, $vallb["products"]) && $smarty -> get_template_vars("main_content_template") == "product_detailed.tpl.html") $vallb["state"] = true;
}
if ($vallb["admin"] == 1) if (!$adminislog) $vallb["state"] = false;
if ($vallb["state"] == true) {
if ($vallb["url"] == "filter.tpl.html") {
if ($smarty -> get_template_vars("main_content_template") == ("category.tpl.html" || "category_search_result.tpl.html")) {
if ($smarty -> get_template_vars("categories_to_select")) $vallb["state"] = false;
if (!$categoryID) $vallb["state"] = false;
if (!$smarty -> get_template_vars("allow_products_search")) $vallb["state"] = false;
} else {
$vallb["state"] = false;
}
}
}
if ($vallb["state"] == true) $tmpb[] = $vallb;
}
$smarty->assign("left_blocks",$tmpb);
$smarty->assign("countlb",count($tmpb));
$tmpb = array();
foreach ($rightb as $keylb => $vallb)
{
if ($vallb["which"] == 1) {
if (!in_array($smarty -> get_template_vars("main_content_template"), $vallb["pages"]) && !in_array($aux_page["aux_page_ID"], $vallb["dpages"]) && !in_array($categoryID, $vallb["categories"]) && !in_array($productID, $vallb["products"])) $vallb["state"] = false;
if (in_array($categoryID, $vallb["categories"]) && !in_array($productID, $vallb["products"]) && $smarty -> get_template_vars("main_content_template") == "product_detailed.tpl.html") $vallb["state"] = false;
} else {
if ($vallb["which"] == 2)
if (in_array($smarty -> get_template_vars("main_content_template"), $vallb["pages"]) || in_array($aux_page["aux_page_ID"], $vallb["dpages"]) || in_array($categoryID, $vallb["categories"]) || in_array($productID, $vallb["products"])) $vallb["state"] = false;
if (in_array($categoryID, $vallb["categories"]) && !in_array($productID, $vallb["products"]) && $smarty -> get_template_vars("main_content_template") == "product_detailed.tpl.html") $vallb["state"] = true;
}
if ($vallb["admin"] == 1) if (!$adminislog) $vallb["state"] = false;
if ($vallb["state"] == true) {
if ($vallb["url"] == "filter.tpl.html") {
if ($smarty -> get_template_vars("main_content_template") == ("category.tpl.html" || "category_search_result.tpl.html")) {
if ($smarty -> get_template_vars("categories_to_select")) $vallb["state"] = false;
if (!$categoryID) $vallb["state"] = false;
if (!$smarty -> get_template_vars("allow_products_search")) $vallb["state"] = false;
} else {
$vallb["state"] = false;
}
}
}
if ($vallb["state"] == true) $tmpb[] = $vallb;
}
$smarty->assign("right_blocks",$tmpb);
$smarty->assign("countrb",count($tmpb));
$tmpb = array();
foreach ($topb as $keylb => $vallb)
{
if ($vallb["which"] == 1) {
if (!in_array($smarty -> get_template_vars("main_content_template"), $vallb["pages"]) && !in_array($aux_page["aux_page_ID"], $vallb["dpages"]) && !in_array($categoryID, $vallb["categories"]) && !in_array($productID, $vallb["products"])) $vallb["state"] = false;
if (in_array($categoryID, $vallb["categories"]) && !in_array($productID, $vallb["products"]) && $smarty -> get_template_vars("main_content_template") == "product_detailed.tpl.html") $vallb["state"] = false;
} else {
if ($vallb["which"] == 2)
if (in_array($smarty -> get_template_vars("main_content_template"), $vallb["pages"]) || in_array($aux_page["aux_page_ID"], $vallb["dpages"]) || in_array($categoryID, $vallb["categories"]) || in_array($productID, $vallb["products"])) $vallb["state"] = false;
if (in_array($categoryID, $vallb["categories"]) && !in_array($productID, $vallb["products"]) && $smarty -> get_template_vars("main_content_template") == "product_detailed.tpl.html") $vallb["state"] = true;
}
if ($vallb["admin"] == 1) if (!$adminislog) $vallb["state"] = false;
if ($vallb["state"] == true) {
if ($vallb["url"] == "filter.tpl.html") {
if ($smarty -> get_template_vars("main_content_template") == ("category.tpl.html" || "category_search_result.tpl.html")) {
if ($smarty -> get_template_vars("categories_to_select")) $vallb["state"] = false;
if (!$categoryID) $vallb["state"] = false;
if (!$smarty -> get_template_vars("allow_products_search")) $vallb["state"] = false;
} else {
$vallb["state"] = false;
}
}
}
if ($vallb["state"] == true) $tmpb[] = $vallb;
}
$smarty->assign("top_blocks",$tmpb);
$smarty->assign("counttb",count($tmpb));
$tmpb = array();
foreach ($bottomb as $keylb => $vallb)
{
if ($vallb["which"] == 1) {
if (!in_array($smarty -> get_template_vars("main_content_template"), $vallb["pages"]) && !in_array($aux_page["aux_page_ID"], $vallb["dpages"]) && !in_array($categoryID, $vallb["categories"]) && !in_array($productID, $vallb["products"])) $vallb["state"] = false;
if (in_array($categoryID, $vallb["categories"]) && !in_array($productID, $vallb["products"]) && $smarty -> get_template_vars("main_content_template") == "product_detailed.tpl.html") $vallb["state"] = false;
} else {
if ($vallb["which"] == 2)
if (in_array($smarty -> get_template_vars("main_content_template"), $vallb["pages"]) || in_array($aux_page["aux_page_ID"], $vallb["dpages"]) || in_array($categoryID, $vallb["categories"]) || in_array($productID, $vallb["products"])) $vallb["state"] = false;
if (in_array($categoryID, $vallb["categories"]) && !in_array($productID, $vallb["products"]) && $smarty -> get_template_vars("main_content_template") == "product_detailed.tpl.html") $vallb["state"] = true;
}
if ($vallb["admin"] == 1) if (!$adminislog) $vallb["state"] = false;
if ($vallb["state"] == true) {
if ($vallb["url"] == "filter.tpl.html") {
if ($smarty -> get_template_vars("main_content_template") == ("category.tpl.html" || "category_search_result.tpl.html")) {
if ($smarty -> get_template_vars("categories_to_select")) $vallb["state"] = false;
if (!$categoryID) $vallb["state"] = false;
if (!$smarty -> get_template_vars("allow_products_search")) $vallb["state"] = false;
} else {
$vallb["state"] = false;
}
}
}
if ($vallb["state"] == true) $tmpb[] = $vallb;
}
$smarty->assign("bottom_blocks",$tmpb);
$smarty->assign("countbb",count($tmpb));
$sc_2 = getmicrotime();
$sr_1 = $sc_2 - $sc_1 - $sc_8;
//show Smarty output
$smarty->display("index.tpl.html");
if ($adminislog && CONF_DISPLAY_INFO == 1)
{
$sr3 = getmicrotime();
$sr_2 = $sr3 - $sc_2;
$sr_3 = $sr3 - $sc_1;
$sr_1 = number_format(round($sr_1, 3), 3, '.', '');
$sr_2 = number_format(round($sr_2, 3), 3, '.', '');
$sr_3 = number_format(round($sr_3, 3), 3, '.', '');
$sc_8 = number_format(round($sc_8, 3), 3, '.', '');
$_SESSION["tgenexe"] = $sr_1;
$_SESSION["tgencompile"] = $sr_2;
$_SESSION["tgendb"] = $sc_8;
$_SESSION["tgenall"] = $sr_3;
$_SESSION["tgensql"] = $sc_4;
}
}
?>