<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>文章提交预览</title>
</head>

<body>
<?php
$GLOBALS['WEATHER_DATA'] = '../../';
@ require ('../../inc/set/set.php');

/* 过滤、检测 */
@ require ('../../inc/function/filter.php');

//过滤词汇
function filter_badword($text) {
  if ($badwords = @file('../../inc/require/badword.txt')) {
    foreach ($badwords as $badword) {
	  $badword = trim($badword);
	  if ($badword != '') {
        $badword = preg_replace('/[0-9a-z]|[\x80-\xff]{3}/iU', '$0([^0-9a-z\x80-\xff]|(&[#a-z0-9]+;)| )*', $badword);
        $badword = preg_replace('/\(\[\^0-9a-z\\\x80-\\\xff\]\|\(&\[#a-z0-9\]\+;\)\| \)\*$/i', '', $badword);
        $badword = preg_replace('/^﻿\(\[\^0-9a-z\\\x80-\\\xff\]\|\(\&\[\#a-z0-9\]\+\;\)\| \)\*/i', '', $badword);
        $text = preg_replace('/'.$badword.'/i', '<span style="background-color:#CC9999" title="此处词汇被过滤"> !!!!! </span>', $text);
      }
    }
  }
  return $text;
}

$content = filter_badword(filter2($_POST['content']));

if (filter_result_check($content) == '')
  die('<script> alert("提交被拒绝！问题分析：1、你没添写 2、您并未输入有效的文本内容，如：你只输入了空格、空html标签等"); parent.delSubmitSafe(); </script></body></html>');
if (abs($web['list_wordcount']) > 0) {
  if (strlen($content) > $web['list_wordcount'])
    die('<script> alert("提交被拒绝！字数超出限定数量'.$web['list_wordcount'].'"); parent.delSubmitSafe(); </script></body></html>');
}

$content = addslashes($content);
die('<script> parent.e162100I.document.body.innerHTML="'.$content.'"; parent.delSubmitSafe(); alert("预览已加载。如果没发现要修改的地方，就可以提交了"); </script></body></html>');

?>
</body>
</html>
