<?php

/**
 * topicpostdo.php
 *
 * @version       v0.01
 * @create time   2011-5-30
 * @update time   
 * @author        wiipu
 * @copyright     Copyright (c) 寰櫘绉戞妧 WiiPu Tech Inc. ( http://www.wiipu.com)
 * @informaition  

 * Update Record:
 *
 */

	define('THISPATHROOT', str_replace('ui/3g/topicpostdo.php', '', str_replace('\\', '/', __FILE__)));
	require_once(THISPATHROOT.'include/db_conn.php');
	require_once(THISPATHROOT.'include/lib/image_common.php');
	require_once('usercheck.php');
	if($bd===0)
	{
		exit();
	}
	If(empty($userName)){
		If($bdType==4){
			$userName="Guest";
		}else{
			 require_once('checklogin.php');
		} 
	}
	$title=sqlReplace(Trim($_GET["title"]));
	$content=HTMLEncode(trim($_GET["content"]));
	$sina=empty($_POST["sina"])?'':sqlReplace(Trim($_POST["sina"]));
	$file=empty($_GET['file'])?'':sqlReplace($_GET["file"]);
	$f_size=empty($_GET['f_size'])?'':sqlReplace($_GET["f_size"]);
	$f_name=empty($_GET['f_name'])?'':sqlReplace($_GET["f_name"]);
	$f_ext=empty($_GET['f_ext'])?'':sqlReplace($_GET["f_ext"]);
	if (SITEFILTER!=''){
		$filter=str_replace("锛?,',',SITEFILTER);
		$filters=explode(",",$filter);
		for($i=0;$i<count($filters);$i++)
		{
			if(strpos($title.$content,$filters[$i])>-1)
			{
				echo "F";
				exit;
			}
		}
	}
	
	
	$data=array(
	'title'=>$title,
	'content'=>$content,
	'wiibbsUser'=>$userName,
	'bd'=>$bd,
	'upload'=>$file,
	'bdCheck'=>$bdCheck,
	'type'=>$f_ext,
	'fileName'=>str_replace(".".$f_ext,'',$f_name),
	'fileSize'=>$f_size
	);
	$result=$topic->insertTopic($data);
	echo $result;
?>