<?php 


/** 
***************************************************
*欢迎使用免费版SiteTeam企业建站软件！
*这是一个专业为搜索引擎营销而设计的，极稳定、极易维护的建站软件！
*官方客服：help@php.net.cn
*官方下载网址：http://www.SiteTeam.cn 
***************************************************
**/




if(!defined('IN_SITETEAM')) { exit('Access Denied'); } define("CURSCRIPT", "first"); $pagename = "first"; $cache_html_data_dir = SITE_ROOT . "/data/tpl/{$site_url}"; $cache_siteteam_html = "{$cache_html_data_dir}/" . md5("siteteam") . ".html"; if (file_exists($cache_siteteam_html) && time() - filemtime($cache_siteteam_html) < CACHE_TIME && IN_CACHE) { include $cache_siteteam_html; exit(); } $userdata = cache_read($pagename); foreach ($userdata as $k => $v) { if(empty($v) && array_key_exists($k, $setting)) $userdata[$k] = $setting[$k]; } extract($userdata); $swap_text_links = $swap_img_links = array(); if (!empty($swap_links)) { $swap_text_links = $temp = array(); preg_match_all('|\<a[\s]*href\="([^"]+)"[\s]*title\="([^"]+)"\>([^\<]+)\</a\>|Uis', $swap_links, $temp, PREG_SET_ORDER); if (is_array($temp) && count($temp)) { foreach ($temp as $k => $v) { $swap_text_links[$k]['name'] = $v[3]; $swap_text_links[$k]['title'] = $v[2]; $swap_text_links[$k]['href'] = $v[1]; } } $swap_img_links = $temp = array(); preg_match_all('|\<a[\s]*href\="([^"]+)"[\s]*\>\<img[\s]*src\="([^"]+)"[\s]*alt\="([^"]+)"[\s]*/\>\</a\>|Uis', $swap_links, $temp, PREG_SET_ORDER); if (is_array($temp) && count($temp)) { foreach ($temp as $k => $v) { $swap_img_links[$k]['href'] = $v[1]; $swap_img_links[$k]['src'] = $v[2]; $swap_img_links[$k]['alt'] = $v[3]; } } } $db = new txtSQL('./data/siteteam'); if (!$db->connect("root", "siteteam")) { exit('当前数据繁忙，稍稍后访问该页！'); } $row = @count($db->execute("select", array('db' => dbname($site_id), 'select' => array('key'), 'table' => 'sm_article', 'where' => array('status = 8')))); if ($row > 0) { $article_list = $db->execute("select", array('db' => dbname($site_id), 'select' => array('*'), 'table' => 'sm_article', 'where' => array('status = 8'), 'orderby' => array('key', 'desc'), 'limit' => array(($row - 12), $row))); } else { $article_list = array(); } $row = @count($db->execute("select", array('db' => dbname($site_id), 'select' => array('key'), 'table' => 'sm_product', 'where' => array('status = 8', 'and', 'pass = 1')))); if ($row > 0) { $product_list = $db->execute("select", array('db' => dbname($site_id), 'select' => array('*'), 'table' => 'sm_product', 'where' => array('status = 8', 'and', 'pass = 1'), 'orderby' => array('key', PRODUCT_LIST_DESC ? 'desc' : 'asc'), 'limit' => array($row - 12, $row))); } else { $product_list = array(); } $db->disconnect(); ob_start(); @eval(tpl_render($skinid, $pagename)); $html = ob_get_clean(); $html = url_rewrite($html); if (CACHE_TIME > 0 && IN_CACHE) { if (!file_exists($cache_html_data_dir)) { mkdir($cache_html_data_dir); } if ($fp = @fopen($cache_siteteam_html, "w")) { if (@fwrite($fp, $html)) { @fclose($fp); echo $html; } else { exit(siteteam_sys_msg(3)); } } else { exit(siteteam_sys_msg(3)); } } else { echo $html; } ?>