<?php 


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




 header("Cache-Control: no-cache, must-revalidate"); header("Content-type: text/html;charset=GBK"); require_once "include/data_safe.php"; require_once "include/common.inc.php"; $setting = cache_read("setting"); extract($setting); $action = empty($_GET['action']) ? empty($_POST['action']) ? empty($_COOKIE['loginid']) ? 'login' : 'index' : $_POST['action'] : $_GET['action']; if ($action == 'guestbook') { if (empty($_POST['postSubmit'])) { ob_start(); include "tool/guestbook/guestbook.tpl.php"; $html = ob_get_clean(); echo tool_plus($html); } else { require_once SITE_ROOT . "/include/mail.inc.php"; $email_message = "\r\n---------------------------------------------------------\r\n留言内容："; $email_message .= "\r\n" . @iconv("utf-8", "gbk//IGNORE", $_POST['content']); $email_message .= "\r\n\r\n电话：\r\n" . @iconv("utf-8", "gbk//IGNORE", $_POST['tel']); $email_message .= "\r\n\r\n邮件：\r\n" . @iconv("utf-8", "gbk//IGNORE", $_POST['email']); $email_message .= "\r\n\r\n即时通讯：\r\n" . @iconv("utf-8", "gbk//IGNORE", $_POST['im']); $email_message .= "\r\n\r\n联系地址：\r\n" . @iconv("utf-8", "gbk//IGNORE", $_POST['address']); $email_message .= "\r\n\r\n其它信息：\r\nIP[" . remote_ip() . "],TIME[" . date("Y-m-d H:i:s", time()) . "]"; $email_message .= "\r\n---------------------------------------------------------"; $email_message .= "\r\n{$company_name}"; $email_from = ""; $target_email = empty($company_email) ? "28693177@qq.com" : $company_email; @send_mail($company_name, $target_email, "来自[{$site_title}]的留言", strip_tags($email_message), '客户邮件', @iconv("utf-8", "gbk//IGNORE", $_POST['email'])); @send_mail('你好', trim($_POST['email']), "欢迎你在在 [ {$site_title} ] 上留言,我们尽快处理!", @strip_tags(iconv("utf-8", "gbk//IGNORE", $_POST['content'])), $company_name, $target_email); ob_start(); include "tool/guestbook/guestbook.ok.tpl.php"; $html = ob_get_clean(); echo tool_plus($html); } } if ($action == 'jsguestbook') { } if ($action == 'show_product') { require_once "include/xml.class.php"; $category = strip_tags(empty($_GET['category']) ? empty($_POST['category']) ? '' : $_POST['category'] : $_GET['category']); $key = intval(empty($_GET['key']) ? empty($_POST['key']) ? '' : $_POST['key'] : $_GET['key']); ob_start(); $product_info = read_array_file(SITE_ROOT . "/data/setting/{$site_url}/product/{$category}/{$key}.txt"); if (is_array($product_info) && count($product_info) > 1 && array_key_exists('product_pic', $product_info)) { $pic_count = 0; foreach ($product_info['product_pic'] as $k => $v) { if (!empty($v)) { $pic_count++; } } } else { exit('参数不正确'); } include "tool/show/show_product.tpl.php"; $html = ob_get_clean(); echo url_rewrite($html, "url"); } function tool_plus(&$tpl) { global $plus; if (isset($plus)) { if (!empty($plus['END_PAGE'])) { if (is_array($plus['END_PAGE'])) { foreach ($plus['END_PAGE'] as $k => $siteteam) { include SITE_ROOT . "/plus/{$siteteam}"; } } else { include SITE_ROOT . "/plus/{$plus['END_PAGE']}"; } } } return $tpl; } ?>