time()-$cache_time) { echo join('',file($FCache)).""; exit; } } ///////////////////////////////////////////////// $tpl->load_template ( 'main.tpl' ); $tpl->set ( '{calendar}', $tpl->result['calendar'] ); $tpl->set ( '{archives}', $tpl->result['archive'] ); $tpl->set ( '{tags}', $tpl->result['tags_cloud'] ); $tpl->set ( '{vote}', $tpl->result['vote'] ); $tpl->set ( '{topnews}', $tpl->result['topnews'] ); $tpl->set ( '{login}', $tpl->result['login_panel'] ); $tpl->set ( '{info}', $tpl->result['info'] ); $tpl->set ( '{speedbar}', $tpl->result['speedbar'] ); $limit = 8; function mpr($a) { var_dump('
',$a,'
'); } // $orders= $db->super_query( "SELECT COUNT(*) as count FROM shop_orders" ); //orders // $forum_user = $db->super_query( "SELECT COUNT(*) as count FROM vbluser" ); // $tpl->set( '{user_num}', $orders['count']+$forum_user['count'] ); //Count users // $row = $db->super_query( "SELECT COUNT(*) as count FROM shop_products" ); // $stats_products = $row['count']; // $tpl->set( '{total_products}', $stats_products ); //Shop itemsusers // $row = $db->super_query( "SELECT orderID FROM shop_orders ORDER BY orderID DESC LIMIT 1" ); // $stats_orders = $row['count']; // $tpl->set( '{total_orders}', $row['orderID'] ); //Shop orders if($_SESSION['dle_user_id']){ $user_id=$_SESSION['dle_user_id']; $row = $db->super_query( "SELECT name FROM dle_users WHERE user_id=$user_id LIMIT 1" ); $tpl->set( '{user_username}', $row[name] ); //User login } // new menu require_once ROOT_DIR . '/getshopkategory.php'; $main_kategory = catGetCategoryCListMin(); $tpl->set('{shop_menu_kategory}', $main_kategory); // spec $spec = ''; $spec_new = ''; $row = $db->super_query("SELECT p.productID, p.name, p.description, p.offers_description, t.filename as image, p.Price, p.list_price FROM shop_special_offers s INNER JOIN shop_products p ON p.productID = s.productID INNER JOIN shop_product_pictures t ON t.photoID = p.default_picture WHERE p.default_picture IS NOT NULL ORDER BY s.sort_order", $multi = true ); $tpl_lead = new dle_template(); $tpl_lead->dir = '/home/skuteris/public_html/templates/default'; $tpl_lead->load_template( 'slider.tpl' ); foreach($row as $k) { $t = implode(array_slice(explode('
',wordwrap($k['name'],45,'
',false)),0,1)); $percent = number_format((100 - ($k['Price']*100 / $k['list_price'])), 0, '.',''); $d = ($k['offers_description']!='' ? $k['offers_description'] : wordwrap($k['description'],180,'
',false)); $sale = ($k['list_price']>0 and $k['list_price']>$k['Price']) ? number_format($k['list_price'], 0, '.', ' ') : ''; $tpl_lead->set('{id}',$k['productID']); $tpl_lead->set('{image}','../../shop/pictures/'.$k['image']); $tpl_lead->set('{zag}',$t); $tpl_lead->set('{desc}',$d); $tpl_lead->set('{price}',number_format($k['Price'],0,'.',' ')); $tpl_lead->set('{sale}',$sale); $tpl_lead->set('{percent}',$percent); $tpl_lead->set('{unit}',$config['site_unit']); $tpl_lead->set('{button_buy}',$config['button_buy']); $tpl_lead->set('{href}', '../../shop/product_'.$k['productID'].'.html'); $tpl_lead->compile('content'); } $tpl->set( '{slider_new}', $tpl_lead->result['content']); unset($tpl_lead); $tpl->set( '{total_users}', $all_online ); //users online $tpl->set ('{home_time}', $config['home_time']); $tpl->set ('{home_top_phone_1}', $config['home_top_phone_1']); $tpl->set ('{home_top_phone_2}', $config['home_top_phone_2']); $tpl->set ('{home_top_phone_3}', $config['home_top_phone_3']); $tpl->set ('{home_title}', $config['header_title']); $sales = array(); $row = $db->super_query( "SELECT * FROM shop_products WHERE (list_price > 0 and Price > 0 and list_price > Price) and in_stock>0 ORDER BY items_sold DESC LIMIT 3", $multi = true ); $ids = array(); $tpl_lead = new dle_template(); $tpl_lead->dir = '/home/skuteris/public_html/templates/default'; $tpl_lead->load_template( 'specproduct.tpl' ); foreach($row as $key) { $ids[] = $key['productID']; $data = $db->super_query( "SELECT * FROM shop_product_pictures WHERE productID=$key[productID] LIMIT 1"); $procent = ceil(100 - ($key['Price']*100/$key['list_price'])); $tpl_lead->set('{id}', $key['productID']); $tpl_lead->set('{percent}', $procent); $tpl_lead->set('{sale}', $key['list_price']); $tpl_lead->set( '[sale]', "" ); $tpl_lead->set( '[/sale]', "" ); $tpl_lead->set( '[percent]', "" ); $tpl_lead->set( '[/percent]', "" ); $tpl_lead->set('{unit}', $config['site_unit']); $tpl_lead->set('{title}', implode(array_slice(explode('
',wordwrap($key['name'],70,'
',false)),0,1)) ); $tpl_lead->set('{href}', '../../shop/product_'.$key['productID'].'.html'); $tpl_lead->set('{image}','../../shop/pictures/'.$data['thumbnail']); $tpl_lead->set('{cost}', $key['Price']); $tpl_lead->set('{text}', $key['description']); $tpl_lead->set('{name}', $key['name']); $tpl_lead->compile('content'); } $tpl->set( '{spec_products}', $tpl_lead->result['content']); unset($tpl_lead); if (!empty($ids)) { $row = $db->super_query( "SELECT * FROM shop_products WHERE productID NOT IN (".implode(',', $ids).") and Price > 0 and in_stock>0 ORDER BY items_sold DESC LIMIT ".$limit, $multi = true ); } else $row = $db->super_query( "SELECT * FROM shop_products WHERE Price > 0 and in_stock>0 ORDER BY items_sold DESC LIMIT ".$limit, $multi = true ); $i = 1; $j = 0; $tpl_lead = new dle_template(); $tpl_lead->dir = '/home/skuteris/public_html/templates/default'; $tpl_lead->load_template( 'leadproduct.tpl' ); foreach($row as $key) { $data = $db->super_query( "SELECT * FROM shop_product_pictures WHERE productID=$key[productID] LIMIT 1"); if ($key['list_price'] > 0 and $key['Price'] > 0 and $key['list_price'] > $key['Price']) { $tpl_lead->set('{percent}', ceil(100 - ($key['Price']*100/$key['list_price']))); $tpl_lead->set('{sale}', $key['list_price']); $tpl_lead->set( '[sale]', "" ); $tpl_lead->set( '[/sale]', "" ); $tpl_lead->set( '[percent]', "" ); $tpl_lead->set( '[/percent]', "" ); } else { $tpl_lead->set( '{percent}', "" ); $tpl_lead->set_block( "'\\[percent\\](.*?)\\[/percent\\]'si", "" ); $tpl_lead->set( '{sale}', "" ); $tpl_lead->set_block( "'\\[sale\\](.*?)\\[/sale\\]'si", "" ); } $tpl_lead->set('{unit}', $config['site_unit']); $tpl_lead->set('{button_cart}', $config['button_cart']); $tpl_lead->set('{button_more}', $config['button_more']); $tpl_lead->set('{id}', $key['productID']); $tpl_lead->set('{title}', implode(array_slice(explode('
',wordwrap($key['name'],70,'
',false)),0,1)) ); $tpl_lead->set('{href}', '../../shop/product_'.$key['productID'].'.html'); $tpl_lead->set('{image}','../../shop/pictures/'.$data['thumbnail']); $tpl_lead->set('{cost}', $key['Price']); $tpl_lead->set('{text}', $key['description']); $tpl_lead->set('{name}', $key['name']); $tpl_lead->compile('content'); } $tpl->set( '{lead_product_new}', $tpl_lead->result['content']); unset($tpl_lead); if ( $dle_module == "showfull" ) { $tpl->set( '[related-news]', "" ); $tpl->set( '[/related-news]', "" ); $tpl->set( '{related-news}', $related_buffer ); } else { $tpl->set( '{related-news}', "" ); $tpl->set_block( "'\\[related-news\\](.*?)\\[/related-news\\]'si", "" ); } if ($config['allow_skin_change'] == "yes") $tpl->set ( '{changeskin}', ChangeSkin ( ROOT_DIR . '/templates', $config['skin'] ) ); if (count ( $banners ) and $config['allow_banner']) { foreach ( $banners as $name => $value ) { $tpl->copy_template = str_replace ( "{banner_" . $name . "}", $value, $tpl->copy_template ); if ( $value ) { $tpl->copy_template = str_replace ( "[banner_" . $name . "]", "", $tpl->copy_template ); $tpl->copy_template = str_replace ( "[/banner_" . $name . "]", "", $tpl->copy_template ); } } } $tpl->set_block ( "'{banner_(.*?)}'si", "" ); $tpl->set_block ( "'\\[banner_(.*?)\\](.*?)\\[/banner_(.*?)\\]'si", "" ); if (count ( $informers ) and $config['rss_informer']) { foreach ( $informers as $name => $value ) { $tpl->copy_template = str_replace ( "{inform_" . $name . "}", $value, $tpl->copy_template ); } } if ($allow_active_news AND $news_found AND $config['allow_change_sort'] AND $do != "userinfo") { $tpl->set ( '[sort]', "" ); $tpl->set ( '{sort}', news_sort ( $do ) ); $tpl->set ( '[/sort]', "" ); } else { $tpl->set_block ( "'\\[sort\\](.*?)\\[/sort\\]'si", "" ); } if (stripos ( $tpl->copy_template, "[category=" ) !== false) { $tpl->copy_template = preg_replace ( "#\\[category=(.+?)\\](.*?)\\[/category\\]#ies", "check_category('\\1', '\\2', '{$category_id}')", $tpl->copy_template ); } if (stripos ( $tpl->copy_template, "[not-category=" ) !== false) { $tpl->copy_template = preg_replace ( "#\\[not-category=(.+?)\\](.*?)\\[/not-category\\]#ies", "check_category('\\1', '\\2', '{$category_id}', false)", $tpl->copy_template ); } if (stripos ( $tpl->copy_template, "[static=" ) !== false) { $tpl->copy_template = preg_replace ( "#\\[static=(.+?)\\](.*?)\\[/static\\]#ies", "check_static('\\1', '\\2')", $tpl->copy_template ); } if (stripos ( $tpl->copy_template, "[not-static=" ) !== false) { $tpl->copy_template = preg_replace ( "#\\[not-static=(.+?)\\](.*?)\\[/not-static\\]#ies", "check_static('\\1', '\\2', false)", $tpl->copy_template ); } if (stripos ( $tpl->copy_template, "{custom" ) !== false) { $tpl->copy_template = preg_replace_callback ( "#\\{custom(.+?)\\}#i", "custom_print", $tpl->copy_template ); } $config['http_home_url'] = explode ( "index.php", strtolower ( $_SERVER['PHP_SELF'] ) ); $config['http_home_url'] = reset ( $config['http_home_url'] ); if (! $user_group[$member_id['user_group']]['allow_admin']) $config['admin_path'] = ""; $ajax .= <<{$lang['ajax_info']}{$pm_alert} HTML; if (strpos ( $tpl->result['content'], "hs.expand" ) !== false or strpos ( $tpl->copy_template, "hs.expand" ) !== false) { if ($config['thumb_dimming']) $dimming = "hs.dimmingOpacity = 0.60;"; else $dimming = ""; if ($config['thumb_gallery'] AND ($dle_module == "showfull" OR $dle_module == "static") ) { $gallery = " hs.align = 'center'; hs.transitions = ['expand', 'crossfade']; hs.addSlideshow({ interval: 4000, repeat: false, useControls: true, fixedControls: 'fit', overlayOptions: { opacity: .75, position: 'bottom center', hideOnMouseOut: true } });"; } else { $gallery = ""; } $js_array[] = "engine/classes/highslide/highslide.js"; switch ( $config['outlinetype'] ) { case 1 : $type = "hs.wrapperClassName = 'wide-border';"; break; case 2 : $type = "hs.wrapperClassName = 'borderless';"; break; case 3 : $type = "hs.wrapperClassName = 'less';\nhs.outlineType = null;"; break; default : $type = "hs.outlineType = 'rounded-white';"; break; } $ajax .= << HTML; } $js_array = build_js($js_array, $config); if ($allow_comments_ajax AND ($config['allow_comments_wysiwyg'] OR $config['allow_quick_wysiwyg'])) { $lang['wysiwyg_language'] = totranslit( $lang['wysiwyg_language'], false, false ); if ( $config['allow_quick_wysiwyg'] == "2" OR $config['allow_comments_wysiwyg'] == "2" ) { $js_array .="\n"; } if ( $config['allow_quick_wysiwyg'] == "1" OR $config['allow_comments_wysiwyg'] == "1" ) { $js_array .="\n"; $js_array .="\n"; } } if ($config['allow_admin_wysiwyg'] == "1" OR $config['allow_site_wysiwyg'] == "1" OR $config['allow_static_wysiwyg'] == "1") { $js_array .="\n"; $js_array .="\n"; $js_array .="\n"; } if (strpos ( $tpl->result['content'], ""; $js_array .="\n"; } if ( $config['allow_share'] AND ($dle_module == "showfull" OR $dle_module == "static") ) { $js_array .="\n"; $js_array .="\n"; } $tpl->set ( '{AJAX}', $ajax ); // $tpl->set ( '{headers}', $metatags."\n".$js_array ); // $metatags = array ( // 'title' => $config['home_title'], // 'description' => $config['description'], // 'keywords' => $config['keywords'], // 'header_title' => "" ); $tpl->set ( '{headers}', $metatags); $tpl->set ( '{content}', "
" . $tpl->result['content'] . "
" ); ob_start(); $tpl->compile ( 'main' ); $tpl->result['main'] = str_ireplace( '{THEME}', $config['http_home_url'] . 'templates/' . $config['skin'], $tpl->result['main'] ); //if ($replace_url) $tpl->result['main'] = str_replace ( $replace_url[0]."/", $replace_url[1]."/", $tpl->result['main'] ); $tpl->result['main'] = str_replace ( 'result['main'] ); //echo $tpl->result['main'];exit; eval (' ?' . '>' . $tpl->result['main'] . '<' . '?php '); $tpl->global_clear (); $db->close (); echo "\n\r\n"; GzipOut(); //////////Файловое кэширование////////// if($_SESSION['dle_user_id'] == 0 && $_SERVER['REQUEST_METHOD'] == "GET") { $pageBuf = ob_get_contents(); $fp = fopen($FCache, "w"); fputs($fp, $pageBuf); fclose($fp); } //////////////////////////////////////// ?>