<?php 


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




if(!defined('IN_SITETEAM')) { exit('Access Denied'); } $settingfile = "data/setting/{$site_url}/setting.txt"; $defaultsettingfile = "data/default.setting.txt"; $site['logofile'] = array("type"=>"images", "length" => 1024 * 1024, "name" => "LOGO文件", "class" => "uploadbtn marginbot", "description" => "<a target='_blank' href='" . (ADMIN_IS_LOCAL ? "http://ps.net.cn" : (!empty($logofile)?"http://ps.net.cn?locktarget=true&title=" . basename($logofile) . "&referrer=siteteam&image=http://{$site_url}" . SITE_PATH . "/" . $logofile:"http://ps.net.cn")) . "'>在线编辑此文件</a>"); $site['logofile_alt'] = array("type"=>"varchar", "length" => "90", "name" => "LOGO图片标题", "class" => "txt"); $site['banner_ad'] = array("type"=>"images", "length" => "10000", "name" => "BANNER文件", "class" => "uploadbtn marginbot", "description" => "<a target='_blank' href='" . (ADMIN_IS_LOCAL ? "http://ps.net.cn" : (!empty($banner_ad)?"http://ps.net.cn?locktarget=true&title=" . basename($banner_ad) . "&referrer=siteteam&image=http://{$site_url}" . SITE_PATH . "/" . $banner_ad:"http://ps.net.cn")) . "'>在线编辑此文件</a>"); $site['banner_flv'] = array("type"=>"varchar", "length" => "90", "name" => "BANNER视频的链接地址", "class" => "txt", "description" => "如果开启视频BANNER，请输入正确的“FLV”视频文件的地址"); $site['banner_ad_alt'] = array("type"=>"varchar", "length" => "90", "name" => "BANNER文件的图片标题", "class" => "txt", "description" => ""); $site['banner_ad_link_url'] = array("type"=>"varchar", "length" => "90", "name" => "BANNER文件的链接地址", "class" => "txt", "description" => ""); $site['banner_big_ad'] = array("type"=>"images", "length" => "10000", "name" => "首页横幅广告文件", "class" => "uploadbtn marginbot", "description" => "请上传宽：927，高：150的广告图片， <a target='_blank' href='" . (ADMIN_IS_LOCAL ? "http://ps.net.cn" : (!empty($banner_big_ad)?"http://ps.net.cn?locktarget=true&title=" . basename($banner_big_ad) . "&referrer=siteteam&image=http://{$site_url}" . SITE_PATH . "/" . $banner_big_ad:"http://ps.net.cn")) . "'>在线编辑此文件</a>"); $site['banner_big_ad_link_url'] = array("type"=>"varchar", "length" => "90", "name" => "首页横幅广告的链接地址", "class" => "txt", "description" => "空填此项，可等效于关闭首页横幅广告显示"); $site['first_bgsound'] = array("type"=>"varchar", "length" => "90", "name" => "首页背音乐MP3文件URL地址", "class" => "txt", "description" => "只能是正确的MP3格式"); $com['company_name'] = array("type"=>"varchar", "length" => "90", "name" => "企业名称", "class" => "txt"); $com['company_trade'] = array("type"=>"varchar", "length" => "90", "name" => "企业所属行业", "class" => "txt"); $com['company_type'] = array("type"=>"varchar", "length" => "90", "name" => "企业性质", "class" => "txt"); $com['company_service'] = array("type"=>"varchar", "length" => "90", "name" => "企业主营产品/服务", "class" => "txt"); $com['company_area'] = array("type"=>"varchar", "length" => "90", "name" => "企业所在地区", "class" => "txt"); $com['company_create'] = array("type"=>"varchar", "length" => "90", "name" => "企业成立时间", "class" => "txt"); $com['company_employ'] = array("type"=>"varchar", "length" => "90", "name" => "企业员工人数", "class" => "txt"); $com['company_turnover'] = array("type"=>"varchar", "length" => "90", "name" => "企业年营业额", "class" => "txt"); $com['company_linkman'] = array("type"=>"varchar", "length" => "90", "name" => "企业联系人", "class" => "txt"); $com['company_telephone'] = array("type"=>"int", "length" => "50", "name" => "企业联系电话", "class" => "txt"); $com['company_fax'] = array("type"=>"int", "length" => "50", "name" => "企业传真", "class" => "txt"); $com['company_post'] = array("type"=>"varchar", "length" => "90", "name" => "企业邮政编码", "class" => "txt"); $com['company_email'] = array("type"=>"varchar", "length" => "90", "name" => "Email", "class" => "txt", "description" => "管理员信箱"); $com['company_qq1'] = array("type"=>"varchar", "length" => "90", "name" => "企业QQ", "class" => "txt", "description" => "只能填一个数字QQ号码"); $com['company_qq2'] = array("type"=>"varchar", "length" => "90", "name" => "企业QQ", "class" => "txt", "description" => "只能填一个数字QQ号码"); $com['company_address'] = array("type"=>"varchar", "length" => "90", "name" => "企业联系地址", "class" => "txt"); $menu['site_index_name'] = array("type"=>"varchar", "length" => "90", "name" => "首页名字", "class" => "txt", "description" => ""); $menu['site_index_url'] = array("type"=>"varchar", "length" => "90", "name" => "重定义首页URL", "class" => "txt", "description" => "必须以英文字母开头且只能是英文字母及数字，且必填<br />一搬的情况空，请空填此项。当此项不为空时，将启用网站封面页"); $menu['site_product_name'] = array("type"=>"varchar", "length" => "90", "name" => "产品列表名称", "class" => "txt", "description" => ""); $menu['site_product_list_url'] = array("type"=>"varchar", "length" => "90", "name" => "产品列表URL名字", "class" => "txt", "description" => "必须以英文字母开头且只能是英文字母及数字，且必填"); $menu['site_product_url'] = array("type"=>"varchar", "length" => "90", "name" => "产品详细页URL名字", "class" => "txt", "description" => "必须以英文字母开头且只能是英文字母及数字，且必填"); $seo['seo_title'] = array("type"=>"varchar", "length" => "90", "name" => "SEO标题", "class" => "txt", "description" => ""); $seo['seo_description'] = array("type"=>"varchar", "length" => "90", "name" => "SE0描述", "class" => "txt", "description" => ""); $seo['seo_keywords'] = array("type"=>"varchar", "length" => "90", "name" => "SEO关键词", "class" => "txt", "description" => ""); $seo['seo_author'] = array("type"=>"varchar", "length" => "90", "name" => "SEO作者", "class" => "txt", "description" => ""); $seo['seo_copyright'] = array("type"=>"varchar", "length" => "90", "name" => "SEO版权信息", "class" => "txt", "description" => ""); $content['top_title'] = array("type"=>"varchar", "length" => "90", "name" => "顶部标题宣传语", "class" => "txt", "description" => ""); $content['top_description'] = array("type"=>"varchar", "length" => "1024", "name" => "顶部标题宣传语简述", "class" => "tarea", "description" => ""); $content['body_name'] = array("type"=>"varchar", "length" => "90", "name" => "内容区标题名字", "class" => "txt", "description" => ""); $content['body_title'] = array("type"=>"varchar", "length" => "90", "name" => "内容区标题小描述", "class" => "txt", "description" => ""); $content['swap_links'] = array("type"=>"varchar", "length" => "5000", "name" => "网站友情链接", "class" => "tarea", "description" => "<br /><br />文字链接格式为：“&lt;a href=&quot;***&quot; title=&quot;***&quot;&gt;****&lt;/a&gt;”，一行一个；图片链接格式为：“&lt;a href=&quot;***&quot;&gt;&lt;img src=&quot;***&quot; alt=&quot;***&quot; /&gt;&lt;/a&gt;”，一行一个<br />"); $style['site_css_file'] = array("type"=>"file", "length" => 1024 * 1024, "name" => "自定义样式文件", "class" => "uploadbtn marginbot"); $app['ajax_mod'] = array("type"=>"varchar", "length" => "255", "name" => "是否启用AJAX浏览网站", "class" => "txt", "description" => "可选值为：为空或者“1”表示开启，“4”表示关闭，默认为“1”"); $app['auto_start_editor'] = array("type"=>"varchar", "length" => "255", "name" => "是否默认启用HTML编辑器", "class" => "txt", "description" => "可选值为：为空或者“1”表示开启，“4”表示关闭，默认为“1”"); $app['auto_image'] = array("type"=>"varchar", "length" => "255", "name" => "发内容时，是否自动下载远程图片", "class" => "txt", "description" => "可选值为：“1”表示开启，“4”表示关闭，默认为“4”"); $app['anonymity'] = array("type"=>"varchar", "length" => "255", "name" => "是否允许匿名发布信息", "class" => "txt", "description" => "可选值为：“1”表示开启，“4”表示关闭，默认为“4”"); $app['display_main_style'] = array("type"=>"varchar", "length" => "255", "name" => "首页内容扩展内容展示", "class" => "txt", "description" => "可选值为：为空或者“1”表示开启，“4”表示关闭，默认为“1”"); $app['sys_product_close'] = array("type"=>"varchar", "length" => "255", "name" => "产品系统是否关闭", "class" => "txt", "description" => "可选值为：为空或者“1”表示开启，“4”表示关闭，默认为“1”"); $app['display_guest'] = array("type"=>"varchar", "length" => "255", "name" => "开启网站留言板", "class" => "txt", "description" => "可选值为：“1”表示开启，“4”表示关闭，默认为“4”"); $app['stat_code'] = array("type"=>"varchar", "length" => "1024", "name" => "网站使用的统计代码", "class" => "tarea", "description" => ""); $app['copyright'] = array("type"=>"varchar", "length" => "5000", "name" => "网站底部版权处设置", "class" => "tarea", "description" => "请使用HTML代码"); $app['online_service'] = array("type"=>"varchar", "length" => "5000", "name" => "网站客服信息设置", "class" => "tarea", "description" => "请使用HTML代码"); $app['website_icp'] = array("type"=>"varchar", "length" => "255", "name" => "ICP备案号", "class" => "txt", "description" => "ICP备案号"); if (!empty($_POST['dosubmit'])) { $savedata = $_POST['data']; if (!preg_match("/^[a-zA-Z]+[\w_]+$/i", $savedata['site_product_url'])) { go_url("admin.php?action=setting", "产品详细页URL名字只能是英文字母以下下划线，且只能以英文字线开头！"); } if (!preg_match("/^[a-zA-Z]+[\w_]+$/i", $savedata['site_product_list_url'])) { go_url("admin.php?action=setting", "产品列表页URL名字只能是英文字母以下下划线，且只能以英文字线开头！"); } if (!empty($savedata['site_index_url'])) { if (!preg_match("/^[a-zA-Z]+[\w_]+$/i", $savedata['site_index_url'])) { go_url("admin.php?action=setting", "重定义首页URL名字只能是英文字母以下下划线，且只能以英文字线开头！"); } } if (array_key_exists($savedata['site_product_url'], $article_category)) { go_url("admin.php?action=setting", "产品详细页URL名字“{$savedata['site_product_url']}”和文章系统某分类ID冲突！"); } if (array_key_exists($savedata['site_product_list_url'], $article_category)) { go_url("admin.php?action=setting", "产品列表页URL名字“{$savedata['site_product_url']}”和文章系统某分类ID冲突！"); } if ($savedata['site_product_url'] == $savedata['site_product_list_url']) { go_url("admin.php?action=setting", "产品详细页URL名字 与 产品列表页URL名字 不能相等！"); } if ($savedata['site_product_url'] == $savedata['site_index_url'] || $savedata['site_product_list_url'] == $savedata['site_index_url']) { go_url("admin.php?action=setting", "产品详细页URL名字 与 产品列表页URL名字 不能 与 重定义首页URL相等！"); } if (!empty($_FILES['logofile']['name'])) { $fileinfo = pathinfo($_FILES['logofile']['name']); if (!in_array(@strtolower($fileinfo['extension']), array('jpg', 'jpeg', 'gif'))) { go_url("admin.php?action=setting", "LOGO文件格式是不允许上传的！"); } $filename = "{$user_upload_dir}/logo.{$fileinfo['extension']}"; if (file_exists($filename) && preg_match("/^attachments/i", $savedata['logofile'])) unlink($filename); if (file_exists($savedata['logofile']) && preg_match("/^attachments/i", $savedata['logofile'])) unlink($savedata['logofile']); if (move_uploaded_file($_FILES['logofile']['tmp_name'],$filename)) { img_resize($filename, 300, 70); $savedata['logofile'] = str_replace(SITE_ROOT . '/', '', $filename); } } if (!empty($_FILES['banner_ad']['name'])) { $fileinfo = pathinfo($_FILES['banner_ad']['name']); if (!in_array(@strtolower($fileinfo['extension']), $upload_file_type)) { go_url("admin.php?action=setting", "BANNER文件格式是不允许上传的！"); } $filename = "{$user_upload_dir}/banner_ad.{$fileinfo['extension']}"; if (file_exists($filename)) unlink($filename); if (file_exists($savedata['banner_ad']) && preg_match("/^attachments/i", $savedata['banner_ad'])) unlink($savedata['banner_ad']); if (move_uploaded_file($_FILES['banner_ad']['tmp_name'],$filename)) { $savedata['banner_ad'] = str_replace(SITE_ROOT . '/', '', $filename); } } if (!empty($_FILES['banner_big_ad']['name'])) { $fileinfo = pathinfo($_FILES['banner_big_ad']['name']); if (!in_array(@strtolower($fileinfo['extension']), $upload_file_type)) { go_url("admin.php?action=setting", "上传横幅广告文件文件格式是不允许上传的！"); } $filename = "{$user_upload_dir}/banner_big_ad.{$fileinfo['extension']}"; if (file_exists($filename)) unlink($filename); if (file_exists($savedata['banner_big_ad']) && preg_match("/^attachments/i", $savedata['banner_big_ad'])) unlink($savedata['banner_big_ad']); if (move_uploaded_file($_FILES['banner_big_ad']['tmp_name'],$filename)) { $savedata['banner_big_ad'] = str_replace(SITE_ROOT . '/', '', $filename); } } if (!empty($_FILES['site_css_file']['name'])) { $fileinfo = pathinfo($_FILES['site_css_file']['name']); if (@strtolower($fileinfo['extension']) != "css") { go_url("admin.php?action=setting", "请上传CSS格式的样式文件！"); } $filename = "{$user_upload_dir}/site.css"; if (file_exists($filename)) unlink($filename); if (file_exists($savedata['site_css_file']) && preg_match("/^attachments/i", $savedata['site_css_file'])) unlink($savedata['site_css_file']); if (move_uploaded_file($_FILES['site_css_file']['tmp_name'],$filename)) { $savedata['site_css_file'] = str_replace(SITE_ROOT . '/', '', $filename); } } $savedata['site_product_list_url'] = preg_replace("/[\-]+/", "", $savedata['site_product_list_url']); $savedata['site_product_url'] = preg_replace("/[\-]+/", "", $savedata['site_product_url']); save_array_file($savedata, $settingfile); del_cache("setting"); go_url("admin.php", "更改设置成功", "top"); } else { if (file_exists($settingfile) && filesize($settingfile) > 0) { $form = read_array_file($settingfile); } else { $form = read_array_file($defaultsettingfile); } if (is_array($form) && count($form) > 0) foreach ($form as $k => $v) { if (array_key_exists($k, $site)) $site[$k]['value'] = $v; if (array_key_exists($k, $com)) $com[$k]['value'] = $v; if (array_key_exists($k, $menu)) $menu[$k]['value'] = $v; if (array_key_exists($k, $seo)) $seo[$k]['value'] = $v; if (array_key_exists($k, $content)) $content[$k]['value'] = $v; if (array_key_exists($k, $style)) $style[$k]['value'] = $v; if (array_key_exists($k, $app)) $app[$k]['value'] = $v; } include "admin/tpl/setting.tpl.php"; } ?>