<?php


@$vercode=''; //此处取值请自行修改

if(isset($_POST['vercode'])){
if ($_POST['vercode']!=$vercode){
 echo("[err]invalid vercode[/err]");
 exit();
}
}

define('APPTYPEID', 0);
define('CURSCRIPT', 'search');

require './source/class/class_core.php';

$discuz = & discuz_core::instance();

$modarray = array('portal', 'forum', 'blog', 'album', 'group');

//$mod = !in_array($discuz->var['mod'], $modarray) ? 'forum' : $discuz->var['mod'];
$mod='forum'; //zzcity add

define('CURMODULE', $mod);


$modcachelist = array('register' => array('modreasons', 'stamptypeid', 'fields_required', 'fields_optional'));

$cachelist = $slist = array();
if(isset($modcachelist[CURMODULE])) {
 $cachelist = $modcachelist[CURMODULE];
}

$discuz->cachelist = $cachelist;
$discuz->init();


//runhooks();

require_once libfile('function/discuzcode');


//require DISCUZ_ROOT.'./source/module/search/search_'.$mod.'.php';


/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: search_portal.php 8544 2010-04-21 05:25:03Z monkey $
 */

//if(!defined('IN_DISCUZ')) {
// exit('Access Denied');
//}

define('NOROBOT', TRUE);

require_once libfile('function/home');

$sdb = DB::object();



$srchtxt = getgpc('subject');
//$srchtxt = isset($srchtxt) ? htmlspecialchars(trim($srchtxt)) : '';
$fid=intval(getgpc('fid'));
$fid=$fid ?  $fid :0;
if (empty($srchtxt)){
 exit('[err]no subject[/err]');
}
$wherestr= $fid ? " and fid=$fid " : "";


$srchtxtsql = addcslashes($srchtxt, '%_');

$query = $sdb->fetch_first("SELECT tid FROM ".DB::table('forum_thread')." WHERE subject = '$srchtxtsql' $wherestr LIMIT 1");
if(!$query) {
 echo('[no]');
}else{
 echo('[yes]');
}


?>