<?
if($from=='user' && $qq){
  if($pluginBase=='记录'){
    if($keyword){
      DB()->insert('data',array(
        'uin'=>$V['from_uin'],
        'qq'=>$qq,
        'token'=>'blog',
        'value'=>$keyword,
        'data'=>'',
        'time'=>$time,
        'status'=>'ok',
      ));
      $data='记录成功';
    }else{
      $data='请输入您要记录的内容';
    }
  }elseif($pluginBase=='查询'){
    $T=DB()->record('data','*',"qq='$qq' and status='ok' and token='blog' and value like '%$keyword%' order by time desc",20);
    if($T){
      if($keyword){
        $data='“'.$keyword.'”的查询结果: ';
      }else{
        $data='最近20条记录如下：';
      }
      foreach($T as $r){
        $data.="\n\n========".date('Y-m-d H:i:s',$r['time'])."========\n编号:".$r['id']."\n-----------------------------------\n".trim($r['value']);
      }
    }else{
      $data='很抱歉，没有找到匹配的记录！';
    }
  }elseif($pluginBase=='删除'){
    DB()->delete('data',"qq='$qq' and id in ($keyword)");
    $data='删除成功';
  }
}
?>