<?php
InitGP('kid');
$ot->save('keywords','kid');
theme_header();
$ot->borderA('#content2','box2');
$ot->addhead('全部关键词');
function doAc($rs){
  if(!$rs['url']){
    return '[<font color="#ff0000">热点</font>]'.$rs['word'];
  }elseif(substr($rs['url'],0,1)=='Q' && is_numeric(substr($rs['url'],1))){
    return '[<font color="#ff0000">热点</font>]问题编号:'.substr($rs['url'],1);
  }elseif(substr($rs['url'],0,1)=='A' && is_numeric(substr($rs['url'],1))){
    return '[<font color="#ff0000">热点</font>]答案编号:'.substr($rs['url'],1);
  }elseif(strtolower(substr($rs['url'],0,7))=='http://'){
    return '[<font color="#0000ff">链接</font>]'.$rs['url'];
  }else{
    return '[<font color="#ff0000">热点</font>]'.$rs['url'];
  }
}
$ot->setlist(
  DB()->page('keywords','*',"1 order by kid desc",20,'?a='.$a.'&b='.$b),
  'kid',
  array(
    array(
      'label'=>'关键词',
      'token'=>'word',
    ),
    array(
      'label'=>'处理方式',
      'token'=>'doAc',
      'type'=>'func',
    ),
    array(
      'label'=>'操作',
      'type'=>'btns',
      'btns'=>array(
        'edit'=>'编辑',
        'del'=>'删除',
      ),
    ),
  )
);
$ot->borderB(1);
$ot->flush();
theme_footer();
?>