<?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 = C::app();

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

$cachelist = $slist = array();
$mod = '';
$discuz->cachelist = $cachelist;
$discuz->init();

$mod='portal'; //zzcity add

define('CURMODULE', $mod);
//runhooks();

require_once libfile('function/search');

//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');


$srchtxt =trim($_POST['title']);
$srchtxt = isset($srchtxt) ? dhtmlspecialchars($srchtxt) : '';
$catid=$_POST['catid'];
$catid=$catid ? $catid : 0;
if (empty($srchtxt)){
 exit('[err]no title[/err]');
}
$wherestr= $catid ? " and catid=$catid " : "";

function charcovert($string) {
	if(!get_magic_quotes_gpc()) {
		$string = str_replace('\'', '\\\'', $string);
	} else {
		$string = str_replace('\"', '"', $string);
	}
	return $string;
}


$srchtxtsql = charcovert($srchtxt);

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


?>