<?php 


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




if(!defined('IN_SITETEAM')) { exit('Access Denied'); } $type = empty($_GET['type']) ? empty($_POST['type']) ? '' : $_POST['type'] : $_GET['type']; $category = empty($_GET['category']) ? empty($_POST['category']) ? '' : $_POST['category'] : $_GET['category']; $key = empty($_GET['key']) ? empty($_POST['key']) ? '' : $_POST['key'] : $_GET['key']; if (!empty($type) && !empty($category) && !empty($key)) { $settingfile = SITE_ROOT . "/data/setting/{$site_url}/keywords.setting.txt"; if (file_exists($settingfile)) { $keywords_setting = read_array_file($settingfile); $external_link_type = $keywords_setting['external_link_type']; } else { $external_link_type = 1; } if (!in_array($external_link_type, array("1", "2"))) { $external_link_type = 1; } if (!file_exists($user_keywords_external_data_file)) { echo '<font color="#FF0000">没有找到外链关键词数据文件，请先生成。</font>';; exit(); } include $user_keywords_external_data_file; if ($type == 'product') { $product_info_file = SITE_ROOT . "/data/setting/{$site_url}/product/{$category}/{$key}.txt"; if (file_exists($product_info_file)) { $product_info = read_array_file($product_info_file); $product_info['content'] = keywords_update_external_link($product_info['content']); save_array_file($product_info, $product_info_file); } } if ($type == 'article') { $article_info_file = SITE_ROOT . "/data/setting/{$site_url}/article/{$category}/{$key}.txt"; if (file_exists($article_info_file)) { $article_info = read_array_file($article_info_file); $article_info['content'] = keywords_update_external_link($article_info['content']); save_array_file($article_info, $article_info_file); } } echo '<font color="#FF0000">OK...</font>'; } else { $db = new txtSQL('./data/siteteam'); $db->connect("root", "siteteam"); $article_list = $db->execute("select", array('db' => dbname($site_id), 'select' => array('*'), 'table' => 'sm_article')); $product_list = $db->execute("select", array('db' => dbname($site_id), 'select' => array('*'), 'table' => 'sm_product')); $db->disconnect(); include "admin/tpl/keywords_external_update.tpl.php"; } ?>