<?
if($from=='user' && $qq){
  if(!$keyword){
    $data='请带上您要查询的图片分类';
  }elseif($keyword=='分类'){
    $data='您已创建的分类有: ';
    $T=DB()->record('data','sort',"qq='$qq' and status='ok' and token='pic' group by sort");
    foreach($T as $r){
      $data.=$r['sort'].'、';
    }
  }else{
    $T=DB()->one('data','id,value',"qq='$qq' and status='ok' and sort='$keyword' and token='pic' order by rand()");
    if($T){
      $data='{P}'.ONEZ_ROOT.'/onezdata/pics/'.$T['value'];
      qqVars('last','p');
      qqVars('id',$T['id']);
      qqSendMsg($V['from_uin'],$data);
      return;
    }
  }
}
?>