<?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='portal'; //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('title');
$srchtxt = isset($srchtxt) ? htmlspecialchars(trim($srchtxt)) : '';
$catid=intval(getgpc('catid'));
$catid=$catid ?  $catid :0;
if (empty($srchtxt)){
 exit('[err]no title[/err]');
}
$wherestr= $catid ? " and catid=$catid " : "";


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

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


?>