<?php 


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




if(!defined('IN_SITETEAM')) { exit('Access Denied'); } $settingfile = SITE_ROOT . "/data/setting/{$site_url}/keywords.setting.txt"; $keywords['base_words'] = array("type"=>"varchar", "length" => "90", "name" => "网站关键词过滤的基本词", "class" => "txt", "description" => "设定网站关键词过滤的基本词，多个用逗号隔开"); $keywords['words_data'] = array("type"=>"varchar", "length" => "290", "name" => "网站核心关键词", "class" => "tarea", "description" => "设定网站关键词过滤的基本词，多个用逗号隔开"); $keywords['external_link_type'] = array("type"=>"varchar", "length" => "90", "name" => "外联关键词链接类型", "class" => "txt", "description" => '“1”表示关键词直接链接至百度，“2”表示将关键词链接百度中权重较高的其它网站，默认为“1”'); $separator = array(",", "，", ".", "。", "?", "？", ":", "：", ";", "；", "!", "！", "|", " ", "-", "_", "/", "\\", "【", "】", "\n", "\r", "\t"); if (!empty($_POST['dosubmit'])) { $savedata = $_POST['data']; if (empty($savedata['base_words'])) { $savedata['base_words'] = str_replace($separator, "," , $site_keywords); } if (empty($savedata['words_data'])) { $savedata['words_data'] = implode(",", explode(",", str_replace("，", "," , $site_keywords))); } else { $temp = explode(",", str_replace($separator, "," , $savedata['words_data'])); $savedata['words_data'] = array(); foreach ($temp as $v) { $words = strip_tags($v); if (empty($words) || strlen($words) < 3) { continue; } $savedata['words_data'][] = $words; } $savedata['words_data'] = implode(",", $savedata['words_data']); } if (empty($savedata) || !in_array($savedata['external_link_type'], array("1", "2"))) { $savedata['external_link_type'] = 1; } save_array_file($savedata, $settingfile); go_url("admin.php?action=keywords&operation=setting"); } else { if (file_exists($settingfile) && filesize($settingfile) > 0) { $form = read_array_file($settingfile); } else { $form['base_words'] = str_replace($separator, "," , $site_keywords); $form['words_data'] = implode(",", explode(",", str_replace("，", "," , $site_keywords))); $form['external_link_type'] = 1; } if (is_array($form) && count($form) > 0) foreach ($form as $k => $v) { if (array_key_exists($k, $keywords)) $keywords[$k]['value'] = $v; } include "admin/tpl/keywords_setting.tpl.php"; } ?>