<?
$rs= new admin;
$menu = cache_read("moduleid-".$menuid.".php",PL_ROOT.$PL_CFG['cache']."/");
$table =$menu[module]."_".$menuid;
if ($b=='1'){
   $rs->update($add, $table,'id',$id);
   msg('信息更新成功', 'phpleft.php?file=add&menuid='.$menuid.'&id='.$id,$lefts);
 }else{
   $add['description']=$add['description']?$add['description']:sysSubStr(strip_tags($add['content']),'100',false);
   $rs->into($add, $table);
   $id = mysql_insert_id();
   $sets = cache_read("set-".$menuid.".php",PL_ROOT.$PL_CFG['cache']."/");
   $sets['htm_show_urlid'] = $sets['htm_show_urlid'] ? $sets['htm_show_urlid'] : 0;
   $adds['linkurl'] = url($id,$sets['htm_show_urlid'],'show');
   $rs->update($adds, $table,'id',$id);
   msg('信息添加成功', 'phpleft.php?file=add&menuid='.$menuid,$lefts);
  }

?>