<?php 


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




if(!defined('IN_SITETEAM')) { exit('Access Denied'); } $settingfile = SITE_ROOT . "/data/setting/{$site_url}/first.txt"; $defaultsettingfile = SITE_ROOT . "/data/default.first.txt"; if (!empty($_POST['dosubmit'])) { $savedata = $_POST['data']; for ($i = 1; $i <= 7; $i++) { if (!empty($_FILES["first_slide_{$i}"]['name'])) { $fileinfo = pathinfo($_FILES["first_slide_{$i}"]['name']); if (!in_array(@strtolower($fileinfo['extension']), $upload_file_type)) { go_url("admin.php?action=first", "第{$i}张图片的格式是不允许上传的！"); } $filename = "{$user_upload_dir}/first_slide_{$i}.{$fileinfo['extension']}"; if (file_exists($filename) && preg_match("/^attachments/i", $savedata["first_slide_{$i}"])) unlink($filename); if (file_exists($savedata["first_slide_{$i}"]) && preg_match("/^attachments/i", $savedata["first_slide_{$i}"])) unlink($savedata["first_slide_{$i}"]); if (move_uploaded_file($_FILES["first_slide_{$i}"]['tmp_name'],$filename)) { img_resize($filename, 338, 283); $savedata["first_slide_{$i}"] = str_replace(SITE_ROOT . '/', '', $filename); } } } if (!empty($_FILES['first_css_file']['name'])) { $fileinfo = pathinfo($_FILES['first_css_file']['name']); if (@strtolower($fileinfo['extension']) != "css") { go_url("admin.php?action=first", "请上传CSS格式的样式文件！"); } $filename = "{$user_upload_dir}/first.css"; if (file_exists($filename)) unlink($filename); if (file_exists($savedata['first_css_file']) && preg_match("/^attachments/i", $savedata['first_css_file'])) unlink($savedata['first_css_file']); if (move_uploaded_file($_FILES['first_css_file']['tmp_name'], $filename)) { $savedata['first_css_file'] = str_replace(SITE_ROOT . '/', '', $filename); } } save_array_file($savedata, $settingfile); del_cache('first'); go_url("admin.php?action=first"); } else { $content['body_name'] = array("type"=>"varchar", "length" => "90", "name" => "内容区标题名字", "class" => "txt", "description" => ""); $content['body_title'] = array("type"=>"varchar", "length" => "90", "name" => "内容区标题小描述", "class" => "txt", "description" => ""); if ($sys_product_close != 4) { $slide['subject'] = array("type"=>"varchar", "length" => "90", "name" => "幻灯片框标题", "class" => "txt", "description" => ""); $slide['first_slide_1'] = array("type"=>"file", "length" => 1024 * 1024, "name" => "第1章(338PX*283PX)幻灯片", "class" => "uploadbtn marginbot", "description" => "<a target='_blank' href='http://ps.net.cn'>在线编辑此图片文件</a>"); $slide['first_slide_link_1'] = array("type"=>"varchar", "length" => "90", "name" => "第1章纪灯片链接网址", "class" => "txt", "description" => ""); $slide['first_slide_2'] = array("type"=>"file", "length" => 1024 * 1024, "name" => "第2章(338PX*283PX)幻灯片", "class" => "uploadbtn marginbot", "description" => "<a target='_blank' href='http://ps.net.cn'>在线编辑此图片文件</a>"); $slide['first_slide_link_2'] = array("type"=>"varchar", "length" => "90", "name" => "第2章纪灯片链接网址", "class" => "txt", "description" => ""); $slide['first_slide_3'] = array("type"=>"file", "length" => 1024 * 1024, "name" => "第3(338PX*283PX)章幻灯片", "class" => "uploadbtn marginbot", "description" => "<a target='_blank' href='http://ps.net.cn'>在线编辑此图片文件</a>"); $slide['first_slide_link_3'] = array("type"=>"varchar", "length" => "90", "name" => "第3章纪灯片链接网址", "class" => "txt", "description" => ""); $slide['first_slide_4'] = array("type"=>"file", "length" => 1024 * 1024, "name" => "第4(338PX*283PX)章幻灯片", "class" => "uploadbtn marginbot", "description" => "<a target='_blank' href='http://ps.net.cn'>在线编辑此图片文件</a>"); $slide['first_slide_link_4'] = array("type"=>"varchar", "length" => "90", "name" => "第4章纪灯片链接网址", "class" => "txt", "description" => ""); $slide['first_slide_5'] = array("type"=>"file", "length" => 1024 * 1024, "name" => "第5(338PX*283PX)章幻灯片", "class" => "uploadbtn marginbot", "description" => "<a target='_blank' href='http://ps.net.cn'>在线编辑此图片文件</a>"); $slide['first_slide_link_5'] = array("type"=>"varchar", "length" => "90", "name" => "第5章纪灯片链接网址", "class" => "txt", "description" => ""); $slide['first_slide_6'] = array("type"=>"file", "length" => 1024 * 1024, "name" => "第6(338PX*283PX)章幻灯片", "class" => "uploadbtn marginbot", "description" => "<a target='_blank' href='http://ps.net.cn'>在线编辑此图片文件</a>"); $slide['first_slide_link_6'] = array("type"=>"varchar", "length" => "90", "name" => "第6章纪灯片链接网址", "class" => "txt", "description" => ""); $slide['first_slide_7'] = array("type"=>"file", "length" => 1024 * 1024, "name" => "第7(338PX*283PX)章幻灯片", "class" => "uploadbtn marginbot", "description" => "<a target='_blank' href='http://ps.net.cn'>在线编辑此图片文件</a>"); $slide['first_slide_link_7'] = array("type"=>"varchar", "length" => "90", "name" => "第7章纪灯片链接网址", "class" => "txt", "description" => ""); } else { $content['site_notice'] = array("type"=>"varchar", "length" => "20000", "editor" => "tiny_mce", "name" => '网站自由版面内容<a style="cursor:hand" onclick="create_editor1(\'site_notice\');">[开]</a><a style="cursor:hand" onclick="close_editor1();">[关]</a><a target="_blank" href="http://ps.net.cn">[图]</a>', "class" => "editcontent", "description" => '必填项'); } if ($display_main_style != 4) { $content['content'] = array("type"=>"varchar", "length" => "20000", "editor" => "tiny_mce", "name" => '首页扩展内容<a style="cursor:hand" onclick="create_editor2(\'content\');">[开]</a><a style="cursor:hand" onclick="close_editor2();">[关]</a><a target="_blank" href="http://ps.net.cn">[图]</a>', "class" => "editcontent", "description" => '必填项'); } $content['first_css_file'] = array("type"=>"file", "length" => 1024 * 1024, "name" => "自定义该栏样式文件", "class" => "uploadbtn marginbot"); 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, $content)) $content[$k]['value'] = $v; if ($sys_product_close != 4) { if (array_key_exists($k, $slide)) $slide[$k]['value'] = $v; } } include "admin/tpl/first.tpl.php"; } ?>